diff --git a/.editorconfig b/.editorconfig index 404ff0701c..fc4ed3486f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,5 +5,5 @@ indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true -[{*.json,*.yml,*.ts}] +[{*.json,*.yml,*.ts,*.tsx,*.md}] indent_style = space diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f5f20b233d..6477b03f07 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,21 +3,25 @@ # 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 /types/abstract-leveldown/ @MeirionHughes @danwbyrne /types/acc-wizard/ @cyrilschumacher -/types/accept-language-parser/ @kampfgnom +/types/accept/ @feinoujc +/types/accept-language-parser/ @kampfgnom @chatoo2412 /types/accepts/ @bomret @brikou /types/accounting/ @gerich-home @chrisleck /types/ace/ @Diullei /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/active-win/ @BendingBender /types/activedirectory2/ @pasthelod +/types/activestorage/ @cbothner /types/activex-access/ @zspitz /types/activex-adodb/ @zspitz /types/activex-adox/ @zspitz @@ -44,22 +48,31 @@ /types/activex-word/ @zspitz /types/adal-angular/ @unindented @aciccarello /types/add-zero/ @Roaders +/types/adlib/ @Esri @MikeTschudi /types/adm-zip/ @jvilk @abner /types/adone/ @s0m3on3 @maxveres +/types/aes-js/ @federicobond /types/aframe/ @devpaul @bertoritger @twastvedt /types/agenda/ @meirgottlieb @princjef /types/agent-base/ @Shinigami92 /types/aggregate-error/ @BendingBender /types/agora-rtc-sdk/ @menthays +/types/airbnb-prop-types/ @milesj /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/all-keys/ @BendingBender +/types/all-property-names/ @BendingBender /types/allure-js-commons/ @zaqqaz /types/almost-equal/ @cmaddalozzo /types/alt/ @Shearerbeard +/types/amap-js-sdk/ @agasbzj /types/amazon-cognito-auth-js/ @scottescue /types/amazon-product-api/ @MattiLehtinen @alien35 /types/amcharts/ @ldrick @@ -68,7 +81,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,18 +162,21 @@ /types/animation-frame/ @qinfchen /types/animejs/ @A-Babin /types/annyang/ @hisham @theluk -/types/ansi-colors/ @rogierschouten +/types/ansi/ @Gustavo6046 +/types/ansi-colors/ @rogierschouten @BendingBender +/types/ansi-colors/v1/ @rogierschouten /types/ansi-escape-sequences/ @aomarks /types/ansi-escapes/ @jacobbubu -/types/ansi-regex/ @mvachhar +/types/ansi-regex/ @mvachhar @ffflorian /types/ansi-styles/ @brynbellomy @plylrnsdy -/types/ansicolors/ @rogierschouten +/types/ansicolors/ @balupton /types/antlr4/ @mcchatman8009 /types/antlr4-autosuggest/ @jonfreedman /types/any-db/ @rogierschouten /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 +184,8 @@ /types/apigee-access/ @CasperSkydt /types/apollo-codegen/ @bradleyayers @kostspielig /types/apollo-upload-client/ @Slessi +/types/apostrophe/ @afholderman +/types/app-module-path/ @darkwebdev /types/app-root-dir/ @chenyang-biu /types/app-root-path/ @shantmarouti /types/appdmg/ @unindented @@ -178,8 +196,8 @@ /types/aqb/ @Athenkosi-Mase /types/arangodb/ @pluma /types/arbiter/ @arash16 -/types/arcgis-js-api/v3/ @Esri @bsvensson /types/arcgis-js-api/ @Esri @bsvensson +/types/arcgis-js-api/v3/ @Esri @bsvensson /types/arcgis-rest-api/ @JeffJacobson /types/arcgis-to-geojson-utils/ @JeffJacobson /types/archiver/ @dolanmiu @crevil @@ -189,36 +207,46 @@ /types/argparse/ @arcticwaters @tlaziuk @eps1lon /types/args/ @Slessi /types/argv/ @hookclaw +/types/arr-diff/ @BendingBender /types/arr-union/ @mrmlnc /types/array-find-index/ @samverschueren /types/array-foreach/ @skysteve +/types/array-move/ @BendingBender /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/asn1/ @jgeurts /types/asn1js/ @microshine /types/aspnet-identity-pw/ @jt000 +/types/assert/ @nicoabie @LinusU /types/assert-equal-jsx/ @seryl /types/assert-plus/ @KostyaTretyak /types/assertsharp/ @brunolm /types/assets-webpack-plugin/ @kryops -/types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin +/types/astring/ @nkappler +/types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin @Dmitri1337 +/types/async-busboy/ @hirochachacha /types/async-cache/ @BendingBender /types/async-lock/ @elisee @afharo @rhymmor /types/async-polling/ @Goldsmith42 /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 /types/atlaskit__layer/ @lstanden /types/atlaskit__single-select/ @lstanden +/types/atlaskit__tree/ @benhjames /types/atlassian-crowd-client/ @mtgto /types/atmosphere.js/ @toedter @Mory1879 @Scipion /types/atob/ @johngeorgewright @@ -227,27 +255,30 @@ /types/atom-mocha-test-runner/ @GlenCFL /types/atpl/ @soywiz /types/audiosprite/ @Perlmint -/types/auth0/ @wbhob @westy92 @amiram +/types/auth-header/ @ForbesLindesay +/types/auth0/ @westy92 @ianhowe76 @dauledk /types/auth0-angular/ @homesar -/types/auth0-js/v7/ @advancedrei /types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz +/types/auth0-js/v7/ @advancedrei /types/auth0-lock/ @carusology @goldcaddy77 @lfaudreejr @willcaul /types/auth0.widget/ @advancedrei /types/auto-bind/ @sseppola /types/auto-launch/ @rhysd @unindented /types/auto-sni/ @janwo -/types/autobahn/ @darkl @valepu +/types/autobahn/ @darkl @a904guy @valepu @glenroy37 /types/autolinker/ @leonyu -/types/autoprefixer/ @odnamrataizem +/types/autoprefixer/ @odnamrataizem @murt /types/autosize/ @kingdango @keika299 @NeekSandhu /types/autosuggest-highlight/ @senukartur +/types/await-timeout/ @szhu /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 @dalen /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites /types/axe-webdriverjs/ @JoshuaKGoldberg /types/axel/ @ruslan-molodyko +/types/axios-case-converter/ @dkniffin /types/axios-token-interceptor/ @innovation-team /types/axon/ @jewbre /types/azure/ @AndrewGaspar @antiveeranna @SomaticIT @@ -266,20 +297,19 @@ /types/babel__code-frame/ @mohsen1 @ForbesLindesay /types/babel__core/ @yortus @marvinhagemeister @mgroenhoff /types/babel__generator/ @yortus @johnnyestilles @mgroenhoff -/types/babel__parser/ @yortus @marvinhagemeister @mgroenhoff /types/babel__template/ @yortus @marvinhagemeister @mgroenhoff /types/babel__traverse/ @yortus @marvinhagemeister @rpetrich @mgroenhoff /types/babelify/ @TeamworkGuy2 @marvinhagemeister /types/babylon/ @yortus @marvinhagemeister /types/babylon-walk/ @czbuchi /types/babyparse/ @cdiddy77 -/types/backbone/ @borisyankov @nvivo @kenjiru +/types/backbone/ @borisyankov @nvivo @kenjiru @jjoekoullas /types/backbone-associations/ @craigbrett17 /types/backbone-fetch-cache/ @delphinus35 /types/backbone-relational/ @eirikhm /types/backbone.layoutmanager/ @hejiang2000 /types/backbone.localstorage/ @lgrignon -/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs +/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs @jjoekoullas /types/backbone.paginator/ @Nyamazing /types/backbone.radio/ @alphaleonis /types/backgrid/ @jlujan @@ -287,37 +317,45 @@ /types/backo2/ @Retsam /types/backoff/ @BendingBender /types/baconjs/ @alexander-matsievsky @gekkio +/types/badgen/ @m5d215 /types/bagpipes/ @micmro +/types/baidu-app/ @taoqf +/types/bandagedbd__bdapi/ @Acidic9 /types/barbellweights/ @evelijn /types/barcode/ @pvomhoff /types/bardjs/ @TepigMC /types/base-64/ @dolanmiu -/types/base-x/ @chrootsu +/types/base-x/ @chrootsu @BendingBender +/types/base-x/v1/ @chrootsu /types/base16/ @alechill /types/base64-arraybuffer/ @jbencook +/types/base64-async/ @BendingBender /types/base64-js/ @pe8ter /types/base64-url/ @urish /types/base64topdf/ @lucasriondel /types/bases/ @harikv /types/bash-glob/ @mrmlnc /types/basic-auth/ @moonpyk @vesse +/types/basicauth-middleware/ @nchaulet /types/batch-stream/ @drudge +/types/battery-level/ @BendingBender /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 +/types/beeper/ @BendingBender /types/behavior3/ @carrrywu /types/bell/ @SimonSchick /types/bem-cn/ @selkinvitaly /types/bencode/ @tobenna /types/better-curry/ @pocesar /types/better-queue/ @maozedong -/types/better-scroll/ @stoneChen -/types/better-sqlite3/ @Morfent @matrumz +/types/better-scroll/ @stoneChen @cnjack +/types/better-sqlite3/ @Morfent @matrumz @sant123 @loghorn @andykais /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 @@ -326,7 +364,9 @@ /types/bignum/ @Patman64 /types/bigscreen/ @dduugg /types/bin-pack/ @orentrutner -/types/binary-parser/ @riggs @dolanmiu +/types/bin-version/ @BendingBender +/types/binary-parser/ @riggs @dolanmiu @yuhr +/types/binaryextensions/ @BendingBender /types/bind-ponyfill/ @skysteve /types/bindings/ @unindented /types/bintrees/ @CjS77 @@ -338,9 +378,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/bitwise-xor/ @rogierschouten @BendingBender +/types/bl/ @Bartvds @reconbot /types/blacklist/ @mhegazy /types/blazy/ @julienpa /types/blessed/ @brynbellomy @skellock @@ -355,24 +394,25 @@ /types/bloom-filter/ @danwbyrne /types/bloomfilter/ @slawiko /types/blue-tape/ @sodatea -/types/bluebird/v1/ @Bartvds -/types/bluebird/v2/ @Bartvds @falsandtru /types/bluebird/ @lhecker +/types/bluebird/v2/ @Bartvds @falsandtru +/types/bluebird/v1/ @Bartvds /types/bluebird-global/ @d-ph /types/bluebird-retry/ @pvomhoff /types/blueimp-md5/ @rmartone @mkohlmyr -/types/bn.js/ @LogvinovLeon @HenryNguyen5 +/types/bn.js/ @LogvinovLeon @HenryNguyen5 @Gilthoniel /types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk @jwalton /types/body-parser-xml/ @tbounsiar +/types/body-scroll-lock/ @kimcoder /types/bonjour/ @quentin-ol @octo-sniffle /types/bookshelf/ @arcticwaters @vesse -/types/boom/v3/ @rogatty -/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 @danielmachado /types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS @danielmachado +/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 @danielmachado +/types/boom/v3/ @rogatty /types/bootbox/ @vbortone @konpikwastaken @kanup @icereed @trodi @stannynuytkens @renjfk /types/bootpag/ @rdeneau -/types/bootstrap/v3/ @borisyankov /types/bootstrap/ @denisname +/types/bootstrap/v3/ @borisyankov @denisname /types/bootstrap-3-typeahead/ @AndersonFriaca /types/bootstrap-datepicker/ @borisyankov /types/bootstrap-fileinput/ @CheCoxshall @@ -383,16 +423,18 @@ /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 /types/bootstrap.paginator/ @derikwhittaker /types/bootstrap.timepicker/ @derikwhittaker @heatherbooker -/types/bootstrap.v3.datetimepicker/v3/ @bayitajesi /types/bootstrap.v3.datetimepicker/ @katonap +/types/bootstrap.v3.datetimepicker/v3/ @bayitajesi /types/bootstrap3-dialog/ @nakupanda @cnboland /types/bounce.js/ @cherrry /types/box2d/ @jbaldwin +/types/boxen/ @BendingBender /types/bpmn-moddle/ @haydos89 /types/brace-expansion/ @BendingBender /types/braces/ @vemoo @@ -401,6 +443,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,12 +452,17 @@ /types/browser-report/ @JTOne123 /types/browser-resolve/ @marionebl /types/browser-sync/ @joeskeen @aznnomness -/types/browserify/ @AndrewGaspar @jvilk @leonard-thieu -/types/bs58/ @chrootsu +/types/browserify/ @AndrewGaspar @jvilk @leonard-thieu @LinusU +/types/browserslist/ @davecardwell +/types/browserslist-useragent/ @nju33 +/types/bs58/ @chrootsu @BendingBender +/types/bs58/v3/ @chrootsu /types/bson/ @horiuchi @CaselIT -/types/btoa/ @johngeorgewright +/types/btoa/ @johngeorgewright @bricka +/types/buble/ @Kocal /types/bucks/ @zaneli /types/buffer-compare/ @chrootsu +/types/buffer-crc32/ @BendingBender /types/buffer-equal/ @Bartvds /types/buffer-from/ @burnnat /types/buffer-reader/ @nrlquaker @@ -422,8 +470,8 @@ /types/buffers/ @rhencke /types/bufferstream/ @Bartvds /types/builtin-modules/ @ajafff +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana @kjellmorten @pc-jedi /types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev @@ -439,9 +487,14 @@ /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/cacheable-request/ @BendingBender +/types/cached-path-relative/ @TeamworkGuy2 +/types/cadesplugin/ @Delagen @kmvi /types/cal-heatmap/ @RetroChrisB +/types/caller/ @ignocide /types/callsite/ @newclear /types/callsites/ @BendingBender /types/calq/ @eirikhm @@ -450,6 +503,8 @@ /types/camelcase-keys/ @mhegazy /types/camo/ @lucasmciruzzi /types/cancan/ @Vincent-Pang +/types/caniuse-api/ @davecardwell +/types/caniuse-lite/ @mutech /types/cannon/ @clark-stevenson @Gelio /types/canvas-confetti/ @matracey /types/canvas-gauges/ @Mikhus @@ -462,19 +517,23 @@ /types/cash/ @akvlko /types/casperjs/ @jedmao @urielch /types/cassandra-driver/ @Svjard @pc-jedi -/types/catbox/v7/ @jasonswearingen @AJamesPhillips /types/catbox/ @jasonswearingen @AJamesPhillips @saboya +/types/catbox/v7/ @jasonswearingen @AJamesPhillips +/types/catbox-memory/ @SimonSchick /types/catbox-redis/ @SimonSchick /types/cbor/ @pushplay /types/ccap/ @taoqf /types/cesium/ @Zuzon @hnipps @szechyjs @golyalpha -/types/chai/v2/ @Bartvds @AGBrown +/types/cfn-response/ @ivoisbelongtous /types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom +/types/chai/v2/ @Bartvds @AGBrown +/types/chai-almost/ @kclnn /types/chai-arrays/ @clementprevot /types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu @lazerwalker @mattbishop /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 @@ -488,12 +547,13 @@ /types/chai-uuid/ @harm-less /types/chai-webdriverio/ @sherlock1982 /types/chai-xml/ @jedigo +/types/chalk-animation/ @BendingBender /types/chance/ @cbowdon @brikou @cafesanu /types/change-emitter/ @iskandersierra /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 @@ -501,29 +561,35 @@ /types/check-types/ @idchlife /types/checkstyle-formatter/ @mhegazy /types/checksum/ @rogierschouten -/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 +/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 @AzSiAz /types/chess.js/ @JacobFischer /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 /types/chroma-js/ @invliD @mpacholec -/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chroma-js/v0/ @invliD +/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 @MatCarlson /types/chrome-apps/ @niikoo @AdamLay @pine613 @mzsm @RReverser @pyle @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 /types/chromecast-caf-receiver/ @craigrbruce /types/chromecast-caf-sender/ @samuelmaddock /types/chromedriver/ @pe8ter /types/circuit-breaker-js/ @DeTeam /types/circular-json/ @jpevarnek +/types/ckeditor/ @wittwert @stuartlong @viktorpegy /types/ckeditor/v2/ @wittwert -/types/ckeditor/ @wittwert @stuartlong +/types/ckeditor__ckeditor5-core/ @denisname +/types/ckeditor__ckeditor5-engine/ @denisname +/types/ckeditor__ckeditor5-utils/ @denisname /types/clamp-js/ @Hikariii /types/clamp-js-main/ @sinziananicolae /types/classnames/ @adidahiya @JKillian @seansfkelley @mradamczyk @marvinhagemeister /types/cldrjs/ @RamanBut-Husaim @gcastre -/types/clean-css/ @tkrotoff +/types/clean-css/ @tkrotoff @GolaWaya +/types/clean-css/v3/ @tkrotoff +/types/clean-regexp/ @BendingBender /types/clean-stack/ @BendingBender /types/clean-webpack-plugin/ @j-f1 /types/clear-require/ @dan-j @@ -532,9 +598,14 @@ /types/clearbladejs-server/ @ClearBlade /types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun /types/cli/ @kayahr +/types/cli-box/ @athasach +/types/cli-boxes/ @BendingBender /types/cli-color/ @ChaosinaCan +/types/cli-cursor/ @BendingBender +/types/cli-interact/ @ffflorian /types/cli-progress/ @mhegazy /types/cli-spinner/ @janslow +/types/cli-spinners/ @BendingBender /types/cli-table/ @arylo /types/cli-table2/ @mgroenhoff /types/cli-truncate/ @danwbyrne @@ -552,58 +623,67 @@ /types/closure-compiler/ @mprobst /types/cloud-env/ @Morfent /types/cloudflare-apps/ @MartynasZilinskas +/types/clovelced-plugin-audiomanagement/ @marckassay /types/cls-hooked/ @aleung /types/clusterize.js/ @Pr1st0n /types/cmd-shim/ @cspotcode /types/co-body/ @geoffreak /types/co-views/ @devlee @geoffreak /types/code/ @prashaantt -/types/codemirror/ @mihailik @nrbernard @Pr1st0n @rileymiller +/types/codemirror/ @mihailik @nrbernard @Pr1st0n @rileymiller @toddself /types/codependency/ @morphatic /types/coffeeify/ @tkQubo /types/coinbase/ @rogierschouten +/types/coinlist/ @BendingBender /types/coinstring/ @mhegazy /types/collections/ @scarabedore -/types/color/v0/ @LKay -/types/color/v1/ @LKay -/types/color/v2/ @Airlun /types/color/ @Airlun @jameswlane +/types/color/v2/ @Airlun +/types/color/v1/ @LKay +/types/color/v0/ @LKay /types/color-convert/ @Airlun +/types/color-diff/ @katsanva /types/color-name/ @Ailrun /types/color-namer/ @in19farkt /types/color-string/ @BendingBender @danmarshall /types/colorbrewer/ @mtraynham +/types/colornames/ @manuth +/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/combined-stream/ @felixge @tlaziuk @konpikwastaken /types/combokeys/ @iclanton -/types/cometd/ @derekcicerone -/types/command-line-args/v4/ @CzBuCHi @75lb +/types/cometd/ @derekcicerone @unindented @alxHenry +/types/command-exists/ @BendingBender /types/command-line-args/ @75lb +/types/command-line-args/v4/ @CzBuCHi @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 +/types/common-tags/ @zuzusik @tzupengwang @BendingBender /types/commondir/ @leonard-thieu /types/commonmark/ @nicojs @leonard-thieu +/types/compare-func/ @fennibay /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 /types/compression/ @santialbo @rburgt -/types/compression-webpack-plugin/ @dublicator +/types/compression-webpack-plugin/ @dublicator @rhys-vdw /types/compute-quantile/ @mrmlnc /types/compute-stdev/ @mrmlnc /types/concat-stream/ @jmarianer /types/concaveman/ @DenisCarriere -/types/conf/v0/ @SamVerschueren /types/conf/ @SamVerschueren @BendingBender +/types/conf/v1/ @SamVerschueren @BendingBender +/types/conf/v0/ @SamVerschueren /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez /types/config-yaml/ @me @@ -612,6 +692,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 @@ -620,14 +701,18 @@ /types/connect-mongo/ @Syati /types/connect-mongodb-session/ @NattapongSiri /types/connect-pg-simple/ @pasieronen -/types/connect-redis/ @xstoudi @morcerf +/types/connect-redis/ @xstoudi /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/contains-path/ @BendingBender /types/content-disposition/ @bomret +/types/content-range/ @bricka /types/content-type/ @horiuchi @BendingBender /types/contentful-resolve-response/ @antonkarsten /types/contextjs/ @kernhanda @@ -636,21 +721,24 @@ /types/convert-layout/ @xeningem /types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 /types/convict/ @Nemo157 @vesse @elyscape @vanthiyathevan -/types/cookie/ @pine613 +/types/cookie/ @pine /types/cookie-parser/ @santialbo @BendingBender /types/cookie-session/ @borislavjivkov /types/cookie-signature/ @lith-light-g /types/cookie_js/ @slawiko /types/cookiejar/ @paroxp /types/cookies/ @WangZishi @jkeylu @BendingBender +/types/copy/ @ffflorian /types/copy-paste/ @SrTobi /types/copy-text-to-clipboard/ @BendingBender /types/copy-webpack-plugin/ @flying-sheep +/types/copyfiles/ @ffflorian /types/cordova-ionic/ @hendrikmaus /types/cordova-plugin-app-version/ @Ritzlgrmft /types/cordova-plugin-background-mode/ @Lordnoname /types/cordova-plugin-badge/ @timbru31 -/types/cordova-plugin-ble-central/ @gjunge +/types/cordova-plugin-ble-central/ @gjunge @peitschie +/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 +757,21 @@ /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/cosmiconfig/v4/ @ozum +/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-data/ @biltongza +/types/country-list/ @iRoachie @Kimahriman +/types/country-list/v1/ @iRoachie /types/country-select-js/ @humrochagf +/types/countup.js/ @shermendev /types/coverup/ @bevalorous /types/cp-file/ @BendingBender /types/cpx/ @alan-agius4 @@ -688,52 +780,67 @@ /types/cradle/ @panuhorsmalahti /types/crc/ @YuJianrong /types/create-error/ @tkrotoff +/types/create-hash/ @BendingBender +/types/create-hmac/ @BendingBender +/types/create-html-element/ @BendingBender /types/create-react-class/ @jgoz /types/create-subscription/ @Asana @vsiao /types/createjs/ @evilangelist @gyohk /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/crumb/ @lenovouser @SimonSchick /types/cryptiles/ @awendland +/types/crypto-hash/ @BendingBender /types/crypto-js/ @misak113 /types/crypto-random-string/ @MrManny /types/cryptojs/ @giabao +/types/cryptr/ @rrogowski /types/cson/ @stpettersens +/types/cson-parser/ @lenovouser /types/csprng/ @winksaville /types/csrf/ @markis /types/css/ @ilich /types/css-font-loading-module/ @slikts /types/css-modules/ @NeekSandhu /types/css-to-style/ @bengry +/types/css-tree/ @erik-kallen /types/cssbeautify/ @rictic /types/cssnano/ @odnamrataizem -/types/csso/ @screendriver +/types/csso/ @screendriver @erik-kallen /types/csurf/ @horiuchi /types/csv-parse/ @davidm77 @obi-jan-kenobi /types/csv-stringify/ @rogierschouten @arjenvanderende /types/csv2json/ @dex4er /types/csvrow/ @codeanimal /types/csvtojson/ @EricByers @wcarson -/types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender -/types/cucumber/v3/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom /types/cucumber/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom +/types/cucumber/v3/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom +/types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender /types/currency-formatter/ @mhegazy @davidmpaz /types/custom-error-generator/ @thmiceli +/types/custom-functions-runtime/ @OfficeDev @akrantz @Zlatkovsky @mscharlock +/types/cwd/ @BendingBender /types/cwise/ @taoqf /types/cwise-compiler/ @taoqf /types/cwise-parser/ @taoqf /types/cybozulabs-md5/ @pine613 +/types/cycled/ @BendingBender +/types/cypress-axe/ @wKovacs64 /types/cytoscape/ @phreed @wy193777 @ypconstante @janniclas @cerberuser +/types/d/ @BendingBender +/types/d3/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov @denisname /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-array/ @gustavderdrache @borisyankov @tomwanzek @denisname /types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-box/ @lk-chen /types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov @@ -745,16 +852,17 @@ /types/d3-delaunay/ @BTOdell /types/d3-dispatch/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-drag/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-ease/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-fetch/ @ledragon +/types/d3-fetch/ @ledragon @denisname /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 @@ -762,19 +870,19 @@ /types/d3-random/ @tomwanzek @gustavderdrache @borisyankov /types/d3-request/ @Ledragon @gustavderdrache @borisyankov @tomwanzek @denisname /types/d3-sankey/ @tomwanzek @gustavderdrache +/types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov @denisname /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-shape/ @tomwanzek @gustavderdrache @borisyankov @denisname +/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 -/types/d3-zoom/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-zoom/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3.slider/ @lk-chen /types/d3kit/ @morphatic /types/d3pie/ @mc-petry @@ -798,10 +906,12 @@ /types/datatables.net-select/ @szechyjs /types/date-arithmetic/ @HeeL /types/date.format.js/ @balrob -/types/dateformat/ @aicest +/types/dateformat/ @aicest @BendingBender +/types/dateformat/v1/ @aicest /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,10 +919,14 @@ /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 @wcarson +/types/debounce-fn/ @BendingBender +/types/debounce-promise/ @whtsky +/types/debug/ @swook @galtalmor @zamb3zi @brasten /types/decamelize/ @samverschueren /types/decay/ @enaeseth +/types/decode-entities/ @waspothegreat +/types/decode-uri-component/ @BendingBender /types/decompress/ @plantain-00 @jbethke /types/decompress-response/ @DanielRosenwasser /types/decorum/ @dflor003 @@ -824,15 +938,16 @@ /types/deep-freeze/ @Bartvds @aluanhaddad /types/deep-freeze-es6/ @mattbishop /types/deep-freeze-strict/ @mhegazy -/types/deepmerge/ @marvinscharle @syy1125 @AppLover69 +/types/default-gateway/ @BendingBender /types/defaults/ @IbtihelCHNAB +/types/defaults-deep/ @Kocal /types/defer-promise/ @niklasf /types/define-lazy-prop/ @BendingBender /types/defined/ @BendingBender /types/deglob/ @saadq /types/deku/ @pocka -/types/del/v2/ @AyaMorisawa /types/del/ @AyaMorisawa @BendingBender @bitjson +/types/del/v2/ @AyaMorisawa /types/delaunator/ @DenisCarriere @BTOdell /types/delete-empty/ @Alorel /types/deline/ @iarroyo5 @@ -843,13 +958,16 @@ /types/depd/ @danny8002 @BendingBender /types/dependency-tree/ @joscha /types/deployjava/ @cyrilschumacher +/types/deprecate/ @Toilal +/types/deps-sort/ @TeamworkGuy2 /types/derhuerst__cli-on-key/ @jacobbubu /types/destroy/ @BendingBender /types/destroy-on-hwm/ @BendingBender -/types/detect-browser/ @rogierschouten +/types/detect-browser/ @rogierschouten @carusology +/types/detect-character-encoding/ @BendingBender /types/detect-hover/ @thomastilkema -/types/detect-indent/v0/ @Bartvds /types/detect-indent/ @Bartvds @BendingBender +/types/detect-indent/v0/ @Bartvds /types/detect-it/ @thomastilkema /types/detect-newline/ @BendingBender /types/detect-node/ @LogvinovLeon @@ -857,7 +975,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,16 +986,26 @@ /types/di-lite/ @dcrusader /types/diacritics/ @otociulis /types/dialogflow/ @dyladan -/types/diff/ @vvakame @szdc +/types/dicer/ @GoupilRobin @BendingBender +/types/diff/ @vvakame @szdc @moc-yuto @BendingBender +/types/diff/v3/ @vvakame @szdc @moc-yuto /types/diff2html/ @rtfpessoa +/types/diffie-hellman/ @BendingBender +/types/digibyte/ @lautarodragan @werewolfe +/types/dinero.js/ @BendingBender +/types/dir-glob/ @BendingBender /types/dir-resolve/ @andy-ms +/types/dirname-regex/ @BendingBender /types/discontinuous-range/ @OiCMudkips +/types/discord-rpc/ @jasonhaxstuff /types/discourse-sso/ @championswimmer /types/dispatchr/ @Ragg- /types/disposable-email-domains/ @geoffreak +/types/distributions/ @marcolanaro +/types/dlv/ @ryansonshine /types/dnssd/ @angelmerino @Maxr1998 /types/doccookies/ @jonegerton -/types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko +/types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko @CameronDiver @p4sca1 /types/docopt/ @giggio /types/doctrine/ @rictic /types/document-promises/ @NotWoods @@ -883,57 +1013,64 @@ /types/documentdb/ @NoelAbrahams @brettferdosi @ctstone @yifanwu /types/documentdb-server/ @lith-light-g /types/documentdb-session/ @DanielRosenwasser +/types/doge-seed/ @BendingBender /types/dojo/ @vansimke /types/dom-clipboard-api/ @43081j +/types/dom-helpers/ @mctep /types/dom-inputevent/ @diagramatics +/types/dom-loaded/ @ltetzlaff +/types/dom-mediacapture-record/ @eliasmeire /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 /types/dot/ @ZombieHunter /types/dot-object/ @nkovacic -/types/dot-prop/v2/ @samverschueren /types/dot-prop/ @samverschueren @BendingBender +/types/dot-prop/v2/ @samverschueren /types/dotdir-regex/ @mrmlnc /types/dotdotdot/ @milanjaros +/types/dotenv/ @jussikinnula @borekb @enaeseth @maxbeatty /types/dotenv/v2/ @jussikinnula @borekb @enaeseth -/types/dotenv/ @jussikinnula @borekb @enaeseth +/types/dotenv-flow/ @vincentlanglet /types/dotenv-safe/ @krenor -/types/dotenv-webpack/ @karol-majewski +/types/dotenv-webpack/ @karol-majewski @davecardwell /types/dotfile-regex/ @mrmlnc /types/dottie/ @domarmstrong /types/double-ended-queue/ @dsagal /types/doublearray/ @mzsm /types/doubleclick-gpt/ @johngeorgewright @steven-joyce /types/download/ @nicojs -/types/downloadjs/ @cwmoo740 +/types/downloadjs/ @cwmoo740 @josuedevmark /types/dplayer/ @Guanyunhan -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk @claudiopro /types/drag-timetable/ @chinkan /types/draggabilly/ @jaydubu /types/dragster/ @zskovacs /types/dragula/ @pwelter34 @abruzzihraig +/types/drivelist/ @WholeMilk +/types/dropbox-chooser/ @quas94 /types/dropboxjs/ @Steve-Fenton @xperiments /types/dropkickjs/ @VorobeY1326 -/types/dropzone/v4/ @nvivo @outring @renuo @Hikariii /types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro @dwaxweiler +/types/dropzone/v4/ @nvivo @outring @renuo @Hikariii /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 /types/dvtng-jss/ @Ptival /types/dw-bxslider-4/ @namerci -/types/dwt/v12/ @yushulx /types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft /types/dygraphs/ @danvk /types/dymo-label-framework/ @thijskuipers /types/dynatable/ @francoismassart +/types/dynatrace/ @alvaro450 /types/dynogels/ @SpartanLabs @ramondeklein @stephentuso /types/each/ @misak113 /types/earcut/ @NaridaL @@ -946,11 +1083,12 @@ /types/easy-xapi/ @DeadAlready /types/easy-xapi-utils/ @DeadAlready /types/ebongarde-root/ @Ebongarde -/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia +/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia @iRON5 /types/ecma-proposal-math-extensions/ @ksm2 /types/ecurve/ @mhegazy /types/ed25519/ @erikma /types/ed2curve/ @ffflorian +/types/ee-first/ @BendingBender /types/egg-mock/ @sheperdwind /types/egg.js/ @ToastHawaii /types/egjs__axes/ @naver @@ -959,6 +1097,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 @@ -968,9 +1107,9 @@ /types/electron-load-devtool/ @prince0203 /types/electron-notifications/ @djpereira /types/electron-notify/ @djpereira -/types/electron-packager/ @SomaticIT @cortopy @jkleinsc @shiftkey -/types/electron-settings/v2/ @leonard-thieu +/types/electron-packager/ @SomaticIT @cortopy @jkleinsc @shiftkey @malept /types/electron-settings/ @icopp @nrlquaker +/types/electron-settings/v2/ @leonard-thieu /types/electron-spellchecker/ @unindented /types/electron-store/ @unindented @jsynowiec /types/electron-unhandled/ @jeremejevs @@ -979,28 +1118,28 @@ /types/electron-winstaller/ @shiftkey @unindented /types/elegant-spinner/ @danwbyrne /types/element-ready/ @BendingBender -/types/element-resize-detector/ @saranshkataria +/types/element-resize-detector/ @saranshkataria @franklixuefei /types/element-resize-event/ @rogierschouten @plgregoire /types/elementtree/ @dwieeb -/types/elliptic/ @danwbyrne +/types/elliptic/ @danwbyrne @Gilthoniel /types/elm/ @thSoft /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 -/types/ember/v1/ @jedmao -/types/ember/v2/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north /types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north @BryanCrotaz -/types/ember-data/v2/ @dwickern @mike-north @chriskrycho +/types/ember/v2/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north +/types/ember/v1/ @jedmao /types/ember-data/ @dwickern @mike-north @chriskrycho -/types/ember-feature-flags/v3/ @tansongyang @mike-north +/types/ember-data/v2/ @dwickern @mike-north @chriskrycho /types/ember-feature-flags/ @tansongyang @mike-north +/types/ember-feature-flags/v3/ @tansongyang @mike-north /types/ember-mocha/ @dwickern @simonihmig @mike-north -/types/ember-modal-dialog/v2/ @tansongyang @mike-north /types/ember-modal-dialog/ @tansongyang @mike-north +/types/ember-modal-dialog/v2/ @tansongyang @mike-north +/types/ember-qunit/ @dwickern @mike-north @scalvert @dfreeman /types/ember-qunit/v2/ @dwickern @mike-north -/types/ember-qunit/ @dwickern @mike-north -/types/ember-resolver/v4/ @dfreeman @mike-north /types/ember-resolver/ @dfreeman @mike-north -/types/ember-test-helpers/v0/ @dwickern @mike-north +/types/ember-resolver/v4/ @dfreeman @mike-north /types/ember-test-helpers/ @dwickern @mike-north +/types/ember-test-helpers/v0/ @dwickern @mike-north /types/ember-testing-helpers/ @chriskrycho /types/ember__application/ @mike-north /types/ember__array/ @mike-north @@ -1019,19 +1158,27 @@ /types/ember__test-helpers/ @dfreeman @jamescdavis @mike-north /types/ember__utils/ @mike-north /types/emissary/ @vvakame -/types/emoji-mart/ @Kovensky @Nicell +/types/emoji-mart/ @Jessidhia @Nicell /types/emoji-regex/ @iKBAHT /types/emojione/ @dbrgn /types/empower/ @vvakame +/types/empty-dir/ @BendingBender +/types/empty-trash/ @BendingBender /types/emscripten/ @zakki @periklis +/types/encodeurl/ @BendingBender +/types/encoding-down/ @MeirionHughes @danwbyrne /types/end-of-stream/ @strax /types/engine.io/ @KentarouTakeda /types/engine.io-client/ @KentarouTakeda /types/enhanced-resolve/ @e-cloud @onigoetz @johnnyreilly /types/enigma.js/ @konne /types/enquire.js/ @screendriver +/types/ensure-error/ @BendingBender +/types/ensure-posix-path/ @BendingBender /types/ent/ @rogierschouten /types/entities/ @aliceklipper +/types/env-ci/ @BendingBender +/types/env-editor/ @BendingBender /types/env-paths/ @danwbyrne /types/env-to-object/ @MugeSo /types/envify/ @tkQubo @@ -1039,6 +1186,7 @@ /types/enzyme-adapter-react-15/ @tkrotoff /types/enzyme-adapter-react-15.4/ @nali /types/enzyme-adapter-react-16/ @tkrotoff +/types/enzyme-async-helpers/ @kimehrenpohl /types/enzyme-redux/ @knegusen /types/enzyme-to-json/ @joscha /types/eonasdan-bootstrap-datetimepicker/ @ToastHawaii @@ -1053,6 +1201,7 @@ /types/es6-promisify/ @harryshipton @bschlenk /types/es6-shim/ @rbuckton /types/es6-weak-map/ @pine +/types/escape-goat/ @BendingBender /types/escape-html/ @elisee /types/escape-latex/ @olsio /types/escape-regexp/ @jewbre @@ -1062,8 +1211,8 @@ /types/eslint-plugin-prettier/ @ikatyang /types/eslint-scope/ @mysticatea /types/eslint-visitor-keys/ @mysticatea -/types/esprima/v2/ @teppeis @RReverser /types/esprima/ @teppeis @RReverser @peter-scott +/types/esprima/v2/ @teppeis @RReverser /types/esprima-walk/ @tswaters /types/espruino/ @stasberkov @createdbyjurand /types/esri-leaflet/ @strajuser @@ -1074,10 +1223,10 @@ /types/eth-lightwallet/ @LogvinovLeon /types/ethereum-protocol/ @LogvinovLeon /types/ethereumjs-abi/ @LogvinovLeon -/types/ethereumjs-tx/ @LogvinovLeon +/types/ethereumjs-tx/ @LogvinovLeon @dmihal /types/ethereumjs-util/ @cortopy /types/ethjs-signer/ @doppio -/types/eureka-js-client/ @Schnillz +/types/eureka-js-client/ @Schnillz @karl-run @tombarton /types/evaporate/ @kookster @chrisrhoden @ailrun /types/event-emitter/ @LKay /types/event-emitter-es6/ @ahstro @@ -1086,29 +1235,36 @@ /types/event-loop-lag/ @rogierschouten /types/event-stream/ @flcdrg /types/event-to-promise/ @flying-sheep -/types/events/ @yasupeke -/types/eventsource/ @scottleedavis @afroozeh +/types/events/ @yasupeke @weareoutman +/types/eventsource/ @scottleedavis @afroozeh @snakedrak /types/evernote/ @corps /types/ex-react-native-i18n/ @maplerichie /types/excel-style-dataformatter/ @SanderDeWaal1992 /types/exceljs/ @rogierschouten @alitaheri /types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers +/types/execall/ @BendingBender /types/exenv/ @christianchown +/types/exif/ @ffflorian /types/exit/ @Bartvds /types/exit-hook/ @BendingBender /types/exorcist/ @TeamworkGuy2 +/types/expand-tilde/ @carnesen /types/expect/ @jmreidy @merrywhether /types/expect-puppeteer/ @JoshuaKGoldberg @tkrotoff /types/expect.js/ @teppeis /types/expectations/ @vvakame /types/expired-storage/ @intolerance -/types/expo/v23/ @KonstantinKai -/types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger -/types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov +/types/expirymanager/ @DanielRose +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @levansuper @ihmpavel @burtek @jkillian +/types/expo/v30/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo +/types/expo/v27/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo /types/expo/v26/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki +/types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov +/types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger +/types/expo/v23/ @KonstantinKai +/types/expo-localization/ @burtek /types/expo__status-bar-height/ @dawnmist -/types/expo__vector-icons/ @incleaf +/types/expo__vector-icons/ @incleaf @robertying /types/express/ @borisyankov /types/express-brute/ @cyrilschumacher /types/express-brute-memcached/ @cyrilschumacher @@ -1129,6 +1285,7 @@ /types/express-formidable/ @tdolsen @evanshortiss /types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede /types/express-handlebars/ @stpettersens @yhaskell +/types/express-http-proxy/ @ulrichb @Danscho /types/express-jsonschema/ @atd-schubert /types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra /types/express-less/ @xieyubo @@ -1137,27 +1294,36 @@ /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 /types/express-partials/ @jt000 /types/express-promise-router/ @wanganjun -/types/express-rate-limit/ @cyrilschumacher @makepost +/types/express-rate-limit/ @cyrilschumacher @makepost @jdforsythe +/types/express-rate-limit/v2/ @cyrilschumacher @makepost /types/express-redis-cache/ @ajliv /types/express-route-fs/ @kripod /types/express-routemap/ @icopp +/types/express-routes-versioning/ @weffe /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-slow-down/ @jdforsythe /types/express-socket.io-session/ @AylaJK /types/express-to-koa/ @xiaohanzhang /types/express-unless/ @wokim +/types/express-version-request/ @weffe +/types/express-version-route/ @weffe /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 +/types/extra-watch-webpack-plugin/ @davecardwell /types/extract-files/ @Slessi /types/extract-stack/ @BendingBender /types/extract-text-webpack-plugin/ @flying-sheep @katyo @@ -1168,10 +1334,11 @@ /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/faker/v3/ @Kuniwak +/types/factory-girl/ @stackbuilders @sestrella @elcuy /types/faker/ @bensw @basp @Kuniwak @mattbishop +/types/faker/v3/ @Kuniwak /types/falcor/ @Quramy /types/falcor-express/ @Quramy /types/falcor-http-datasource/ @Quramy @@ -1181,24 +1348,32 @@ /types/fancy-log/ @pine /types/fancybox/ @borisyankov /types/farbtastic/ @EnableSoftware -/types/fast-diff/ @djrenren +/types/fast-json-stable-stringify/ @BendingBender /types/fast-levenshtein/ @mizunashi-mana /types/fast-list/ @BendingBender /types/fast-stats/ @rogierschouten +/types/fast64/ @rarmatei /types/fastclick/ @shinnn +/types/fastify-accepts/ @leomelzer +/types/fastify-cors/ @jannikkeye +/types/fastify-favicon/ @tuelsch +/types/fastify-jwt/ @jannikkeye +/types/fastify-multipart/ @jannikkeye +/types/fastify-rate-limit/ @pc-jedi +/types/fastify-static/ @leomelzer /types/favico.js/ @drowse314-dev-ymat -/types/favicons/ @mohsen1 +/types/favicons/ @mohsen1 @metsawyr /types/fb/ @JoshStrobl /types/fb-watchman/ @whtsky /types/fbemitter/ @kmxz /types/feather-icons/ @jineshshah36 /types/featherlight/ @xStrom -/types/feathersjs__authentication/ @AbraaoAlves @j2L4e +/types/feathersjs__authentication/ @AbraaoAlves @j2L4e @NickBolles /types/feathersjs__authentication-client/ @AbraaoAlves @j2L4e /types/feathersjs__authentication-jwt/ @j2L4e /types/feathersjs__authentication-local/ @j2L4e /types/feathersjs__authentication-oauth1/ @j2L4e -/types/feathersjs__authentication-oauth2/ @j2L4e +/types/feathersjs__authentication-oauth2/ @j2L4e @NickBolles /types/feathersjs__configuration/ @j2L4e /types/feathersjs__errors/ @j2L4e /types/feathersjs__express/ @j2L4e @DadUndead @@ -1212,7 +1387,8 @@ /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 @captain-igloo @ChenNima +/types/fetch-mock/v6/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues @mtsmfm /types/fetch.io/ @newraina /types/ffi/ @loyd @waitingsong /types/ffi-napi/ @keerthi16 @KiranNiranjan @@ -1228,31 +1404,44 @@ /types/file-type/ @tcaesvk @BendingBender /types/file-url/ @coderslagoon /types/filenamify/ @rokt33r -/types/filesize/ @GiedriusGrabauskas @renchap +/types/filenamify-url/ @cprecioso +/types/filesize/ @GiedriusGrabauskas @renchap @Ky6uk /types/fill-pdf/ @westy92 +/types/filter-console/ @BendingBender /types/filter-invalid-dom-props/ @icopp /types/finalhandler/ @chrootsu /types/finch/ @DavidSichau /types/find/ @andypyrope +/types/find-cache-dir/ @BendingBender +/types/find-java-home/ @sjx233 +/types/find-package-json/ @BendingBender /types/find-parent-dir/ @ikatyang /types/find-process/ @buaban /types/find-project-root/ @ikatyang /types/find-root/ @Alorel /types/find-up/ @BendingBender -/types/find-versions/ @LogvinovLeon -/types/findup-sync/ @Bartvds @ngbrown +/types/find-versions/ @LogvinovLeon @carnesen +/types/findup-sync/ @Bartvds @ngbrown @BendingBender +/types/findup-sync/v0/ @Bartvds @ngbrown +/types/fined/ @BendingBender /types/fingerprintjs/ @zaneli -/types/fingerprintjs2/ @curtstate +/types/fingerprintjs2/ @curtstate @BendingBender +/types/fingerprintjs2/v1/ @curtstate /types/firebase-client/ @fpsscarecrow /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/first-run/ @BendingBender /types/fixed-data-table/ @pepaar @stephenjelfs /types/fixed-data-table-2/ @ilivit +/types/fkill/ @BendingBender +/types/flagged-respawn/ @BendingBender /types/flat/ @chrootsu +/types/fleximap/ @DanielRose +/types/flexmonster/ @flexmonster /types/flexslider/ @diullei /types/flickity/ @clmcgrath @wagich /types/flight/ @jonathanhedren @@ -1260,11 +1449,17 @@ /types/flipsnap/ @kubosho @gsino @mayuki /types/float-regex/ @wanganjun /types/flot/ @burlandm @Anticom @admiralsmaster +/types/flowdoc/ @animify /types/flowjs/ @ryan10132 +/types/fluent/ @huy-nguyen /types/fluent-ffmpeg/ @tcaesvk @DingWeizhe @mabidina +/types/fluent-langneg/ @huy-nguyen +/types/fluent-react/ @huy-nguyen /types/flush-write-stream/ @djcsdy +/types/flushable/ @pash90 /types/flux/ @stkb @GiedriusGrabauskas /types/fluxible/ @xbim +/types/fluxible-addons-react/ @xbim /types/fluxible-router/ @xbim /types/fluxxor/ @mrk21 /types/fm-websync/ @markusmauch @@ -1274,7 +1469,9 @@ /types/fontoxml/ @rolandzwaga /types/forever-agent/ @yavanosta /types/forever-monitor/ @shuntksh @wrboyce +/types/forge-apis/ @Autodesk-Forge /types/forge-di/ @adamcarr +/types/forge-viewer/ @Autodesk-Forge /types/form-data/ @soywiz @leonyu @BendingBender /types/form-serialize/ @tyler-johnson /types/form-serializer/ @flqw @@ -1289,22 +1486,23 @@ /types/foundation/ @borisyankov /types/fpsmeter/ @alampros /types/framebus/ @kbukum +/types/franc/ @wlegate /types/frctl__fractal/ @pmccloghrylaing /types/freedom/ @jpevarnek /types/freeport/ @atd-schubert /types/fresh/ @BendingBender /types/freshy/ @qlonik /types/friendly-errors-webpack-plugin/ @bahlo -/types/frisby/v0/ @johnny4753 /types/frisby/ @cwoodland @johnny4753 +/types/frisby/v0/ @johnny4753 /types/from/ @Bartvds /types/from2/ @BendingBender /types/fromjs/ @glenndierckx /types/fromnow/ @marinewater /types/fs-cson/ @dex4er /types/fs-ext/ @OguzhanE -/types/fs-extra/v4/ @alan-agius4 @midknight41 @shiftkey @mees- /types/fs-extra/ @alan-agius4 @midknight41 @shiftkey @mees- @jrockwood +/types/fs-extra/v4/ @alan-agius4 @midknight41 @shiftkey @mees- /types/fs-extra-promise/ @midknight41 @jasonswearingen @HiromiShikata /types/fs-extra-promise-es6/ @midknight41 @jasonswearingen @geoffreak @HiromiShikata /types/fs-finder/ @misak113 @@ -1323,11 +1521,13 @@ /types/fusioncharts/ @rohitkr @shivarajkv /types/fuzzaldrin/ @mhegazy /types/fuzzaldrin-plus/ @jeancroy @jkillian @reyronald +/types/fuzzy-search/ @alex-deas @BendingBender /types/fuzzyset/ @lgrignon @narainsagar /types/fuzzyset.js/ @lgrignon @narainsagar /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 @@ -1462,7 +1662,7 @@ /types/gapi.client.youtubereporting/ @Bolisov /types/gapi.drive/ @baxtersa /types/gapi.pagespeedonline/ @sgtfrankieboy -/types/gapi.people/ @tkrotoff +/types/gapi.people/ @tkrotoff @joshuaobrien /types/gapi.plus/ @tkrotoff /types/gapi.translate/ @sgtfrankieboy /types/gapi.urlshortener/ @sgtfrankieboy @@ -1470,6 +1670,7 @@ /types/gapi.youtubeanalytics/ @sgtfrankieboy /types/gaussian/ @scttcper /types/gc-stats/ @vfernandestoptal +/types/gdal/ @andreidigori /types/geetest/ @plantain-00 /types/gen-readlines/ @CodeAnimal /types/generate-changelog/ @ffflorian @@ -1478,62 +1679,97 @@ /types/generic-pool/ @jerray @wrboyce /types/gently/ @bonnici /types/geodesy/ @DenisCarriere @HandyG52 @excelulous -/types/geojson/ @cobster @atd-schubert @JeffJacobson @icholy +/types/geojson/ @cobster @atd-schubert @JeffJacobson @icholy @danvk /types/geojson2osm/ @DenisCarriere /types/geokdbush/ @DenisCarriere +/types/geolite2/ @ffflorian /types/geometry-dom/ @nakakura /types/geopattern/ @Gaelan /types/gestalt/ @serranoarevalo /types/get-caller-file/ @ajafff +/types/get-certain/ @BendingBender +/types/get-emails/ @BendingBender +/types/get-emoji/ @BendingBender /types/get-folder-size/ @mszczepanczyk +/types/get-func-name/ @BendingBender /types/get-node-dimensions/ @vincekovacs +/types/get-port/ @plantain-00 @BendingBender +/types/get-range/ @BendingBender /types/get-stdin/ @DanielRosenwasser /types/get-stream/ @douglasduteil @BendingBender +/types/get-urls/ @BendingBender /types/get-value/ @DanielRosenwasser +/types/getenv/ @impankratov /types/getopts/ @azasypkin /types/getos/ @BendingBender /types/gettext.js/ @jucrouzet +/types/gfc/ @BendingBender +/types/gh-pages/ @DanielRosenwasser +/types/ghauth/ @Leko /types/gifffer/ @gatimus /types/gijgo/ @atatanasov /types/giraffe/ @darthapo /types/git/ @vvakame +/types/git-add-remote/ @BendingBender /types/git-branch/ @rynclark /types/git-config/ @stpettersens +/types/git-config-path/ @BendingBender /types/git-remote-origin-url/ @janslow +/types/git-repo-name/ @BendingBender +/types/git-rev-sync/ @khoi-fish +/types/git-root-dir/ @ffflorian /types/git-url-parse/ @ajafff +/types/git-user-email/ @BendingBender +/types/git-user-name/ @BendingBender +/types/git-username/ @BendingBender +/types/gitconfiglocal/ @ffflorian /types/github-url-to-object/ @ajafff +/types/github-username/ @BendingBender /types/github-username-regex/ @BehindTheMath -/types/gitlab/ @yanqing6628780 @Arylo +/types/gl/ @sjx233 /types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist @surtr-isaz +/types/gl-react/ @jussikinnula +/types/gl-react-dom/ @jussikinnula +/types/gl-react-expo/ @jussikinnula +/types/gl-react-headless/ @jussikinnula +/types/gl-react-native/ @jussikinnula /types/gl-shader/ @MathiasPaumgarten /types/gl-texture2d/ @MathiasPaumgarten /types/gldatepicker/ @qcz /types/glidejs/ @milanjaros -/types/glob/ @vvakame @voy +/types/glob/ @vvakame @voy @ajafff +/types/glob/v5/ @vvakame @voy /types/glob-base/ @alan-agius4 /types/glob-expand/ @vvakame /types/glob-parent/ @mrmlnc /types/glob-stream/ @Bartvds @mrmlnc /types/glob-to-regexp/ @whatasoda +/types/global-dirs/ @BendingBender +/types/global-modules/ @BendingBender +/types/global-paths/ @BendingBender +/types/global-prefix/ @BendingBender /types/global-tunnel-ng/ @BendingBender /types/globalize/ @gcastre @afromogli @bryanforbes /types/globalize-compiler/ @iclanton /types/globby/ @douglasduteil @ikatyang /types/globule/ @durad /types/glue/ @garfty -/types/gm/ @ChaosinaCan @maartenvanvliet +/types/glue/v4/ @gjednaszewski +/types/gm/ @ChaosinaCan @maartenvanvliet @mlejva /types/go/ @NorthwoodsSoftware /types/google-adwords-scripts/ @jafaircl /types/google-apps-script/ @motemen @grant /types/google-apps-script-oauth2/ @dhayab /types/google-cloud__datastore/ @beaulac @ogawa0071 @ThomasdenH +/types/google-cloud__kms/ @ben-tbotlabs /types/google-cloud__pubsub/ @pheromonez @LunaPg @msiviero -/types/google-cloud__storage/ @blove @nbperry @welkie @ogawa0071 +/types/google-cloud__tasks/ @ifiokjr /types/google-earth/ @icholy /types/google-images/ @dolanmiu /types/google-libphonenumber/ @leonyu @winfinit /types/google-map-react/ @honzabrecka /types/google-maps/ @DeividasBakanas @GiedriusGrabauskas +/types/google-maps-react/ @gburgett @jpowell /types/google-protobuf/ @marcuslongmuir /types/google-translate-api/ @maple3142 /types/google.analytics/ @tyler-murphy @@ -1541,42 +1777,49 @@ /types/google.fonts/ @danmarshall /types/google.geolocation/ @vbortone /types/google.picker/ @grapswiz -/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm +/types/google.script.client-side/ @clomie +/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm @shrujalshah28 +/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/graceful-fs/v2/ @Bartvds +/types/googlepay/ @Fluccioni @Radu-Raicea @fstanis +/types/got/ @BendingBender @LinusU @ikokostya @stijnvn +/types/got/v8/ @BendingBender @LinusU @ikokostya /types/graceful-fs/ @Bartvds @BendingBender +/types/graceful-fs/v2/ @Bartvds /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 @langpavel /types/graphql-date/ @enaeseth /types/graphql-deduplicator/ @lfades /types/graphql-depth-limit/ @eritikass +/types/graphql-errors/ @MatiasOlivera +/types/graphql-fields/ @feinoujc /types/graphql-iso-date/ @jwaldrip /types/graphql-list-fields/ @filipows /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 /types/gravatar/ @denis-sokolov /types/gravatar-url/ @ivangabriele /types/greasemonkey/ @kotas -/types/grecaptcha/v0/ @brentj73 /types/grecaptcha/ @DethAriel @rafaeltavares +/types/grecaptcha/v0/ @brentj73 /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/guardian__prosemirror-invisibles/ @dddotsev /types/guid/ @maroy1986 /types/gulp/ @GiedriusGrabauskas /types/gulp-angular-templatecache/ @amanmahajan7 @@ -1618,6 +1861,7 @@ /types/gulp-jasmine/ @andypyrope /types/gulp-jasmine-browser/ @tkrotoff /types/gulp-json-editor/ @peterjuras +/types/gulp-json-validator/ @pe8ter /types/gulp-jsonmin/ @romain-faust /types/gulp-jsonminify/ @pine /types/gulp-jspm/ @peterjuras @@ -1655,27 +1899,35 @@ /types/gulp-watch/ @tkrotoff /types/gulp-zip/ @dudeofawesome /types/gzip-js/ @rhysd -/types/gzip-size/v3/ @plantain-00 /types/gzip-size/ @plantain-00 @jimivdw @andrewiggins -/types/h2o2/ @jasonswearingen @AJamesPhillips +/types/gzip-size/v3/ @plantain-00 +/types/h2o2/ @jasonswearingen @AJamesPhillips @garthk /types/halfred/ @dherges /types/halogen/ @steller /types/hammerjs/ @milkisevil @codler /types/handlebars/ @borisyankov @evil-shrike -/types/hapi/v8/ @jasonswearingen -/types/hapi/v12/ @jasonswearingen -/types/hapi/v15/ @jasonswearingen +/types/handlebars-helpers/ @Toilal +/types/hapi/ @rafaelsouzaf @jhsimms @SimonSchick @saboya +/types/hapi/v17/ @rafaelsouzaf @jhsimms @SimonSchick @saboya /types/hapi/v16/ @jasonswearingen @AJamesPhillips -/types/hapi/ @rafaelsouzaf @jhsimms @SimonSchick +/types/hapi/v15/ @jasonswearingen +/types/hapi/v12/ @jasonswearingen +/types/hapi/v8/ @jasonswearingen /types/hapi-auth-basic/ @AJamesPhillips @saboya -/types/hapi-auth-jwt2/v7/ @warrenseymour +/types/hapi-auth-bearer-token/ @saboya +/types/hapi-auth-cookie/ @lenovouser @SimonSchick @Mutmatt /types/hapi-auth-jwt2/ @warrenseymour @SimonSchick +/types/hapi-auth-jwt2/v7/ @warrenseymour /types/hapi-decorators/ @kenhowardpdx +/types/hapi-pino/ @saboya +/types/happypack/ @akashishu777 /types/har-format/ @micmro /types/hard-rejection/ @BendingBender /types/hard-source-webpack-plugin/ @woitechen /types/harmony-proxy/ @remojansen /types/has-ansi/ @BendingBender +/types/has-emoji/ @BendingBender +/types/has-yarn/ @BendgingBender /types/hash-file/ @HiromiShikata /types/hash-stream/ @BendingBender /types/hash-sum/ @DanielRosenwasser @@ -1683,6 +1935,7 @@ /types/hasher/ @flyfishMT /types/hashids/ @pocesar /types/hashmap/ @outring +/types/hashtag-regex/ @diogofcunha /types/hat/ @tup1tsa /types/haversine/ @screendriver /types/hbs/ @davidm77 @@ -1699,6 +1952,7 @@ /types/heredatalens/ @denyo /types/heremaps/ @Josh-ES @denyo @fx88 /types/heroku-logger/ @kylevogt +/types/hex-rgb/ @BendingBender /types/hex-rgba/ @r3nya /types/hexo-bunyan/ @segayuu /types/hexo-fs/ @segayuu @@ -1709,42 +1963,46 @@ /types/highland/ @Bartvds @hgwood @iwllyu @alvis @notbobthebuilder /types/highlight.js/ @nikeee @sourrust @joshuakgoldberg /types/hiredis/ @titan -/types/history/v2/ @sergey-buturlakin @ngbrown -/types/history/v3/ @sergey-buturlakin @ngbrown @LKay /types/history/ @sergey-buturlakin @ngbrown @rokoroku +/types/history/v3/ @sergey-buturlakin @ngbrown @LKay +/types/history/v2/ @sergey-buturlakin @ngbrown /types/history.js/ @borisyankov @gjunge /types/historykana/ @h-shiratsuki /types/hjson/ @crunchie84 -/types/hls.js/ @jgainfort +/types/hls.js/ @jgainfort @brookback @adripanico /types/hoek/ @prashaantt /types/hoist-non-react-statics/ @JounQin /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 -/types/html-minifier/v1/ @tkrotoff /types/html-minifier/ @tkrotoff @rikuayanokozy +/types/html-minifier/v1/ @tkrotoff /types/html-pdf/ @westy92 /types/html-tag-names/ @sandersn +/types/html-tags/ @BendingBender /types/html-to-text/ @erykwarren /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 -/types/http-assert/ @jkeylu +/types/http-assert/ @jkeylu @stripedpajamas /types/http-aws-es/ @marcogrcr +/types/http-cache-semantics/ @BendingBender /types/http-codes/ @mhegazy /types/http-context/ @mtraynham /types/http-errors/ @tkrotoff @BendingBender /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 @@ -1756,18 +2014,22 @@ /types/humane/ @jmvrbanac /types/humanize-plus/ @DenisCarriere /types/humanize-string/ @ragnarok56 +/types/humanize-url/ @BendingBender /types/humanparser/ @MichalPodeszwa /types/humps/ @nikeee /types/hyco-ws/ @mrcabellom +/types/hyper-aws4/ @bambutz /types/hyperscript/ @spacejack @jmfirth /types/hypertext-application-language/ @maks3w /types/hystrixjs/ @igorsechyn /types/i18n/ @SomaticIT @FindQ +/types/i18n-abide/ @smbell /types/i18n-js/ @ypresto +/types/i18next/ @mxl @deerawan @GiedriusGrabauskas @lenovouser @qqilihq @butchyyyy +/types/i18next/v8/ @mxl @deerawan @GiedriusGrabauskas /types/i18next/v2/ @mxl @deerawan @GiedriusGrabauskas -/types/i18next/ @mxl @deerawan @GiedriusGrabauskas -/types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas /types/i18next-browser-languagedetector/ @cyrilschumacher @GiedriusGrabauskas +/types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas /types/i18next-express-middleware/ @cyrilschumacher /types/i18next-ko/ @dwaxweiler /types/i18next-node-fs-backend/ @cyrilschumacher @lenovouser @@ -1780,6 +2042,7 @@ /types/ibm_db/ @agov /types/icepick/ @ngbrown @tobico /types/icheck/ @qcz +/types/icon-gen/ @ffflorian /types/iconv/ @delphinus35 /types/idyll/ @iocat /types/idyll-ast/ @iocat @@ -1791,6 +2054,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 @@ -1802,76 +2066,110 @@ /types/images/ @DingWeizhe /types/imagesloaded/ @coldacid @apexskier /types/imap/ @psnider -/types/imap-simple/ @pushplay +/types/imap-simple/ @pushplay @iaarnio /types/imgur-rest-api/ @lukewestby +/types/immediate/ @BendingBender /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 -/types/indent-string/ @mhegazy -/types/inert/v4/ @nycdotnet @AJamesPhillips +/types/indent-string/ @mhegazy @BendingBender /types/inert/ @nycdotnet @AJamesPhillips @lenovouser +/types/inert/v4/ @nycdotnet @AJamesPhillips /types/inflected/ @dsci /types/inflection/ @shiwano /types/inherits/ @chrootsu -/types/ini/ @marcinporebski +/types/ini/ @marcinporebski @carnesen /types/iniparser/ @chrootsu +/types/init-package-json/ @kfarnung +/types/ink/ @cprecioso /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-css/ @hvoecking /types/insert-module-globals/ @leonard-thieu /types/insight/ @vvakame +/types/instabug-reactnative/ @pengcao1 /types/integer/ @Morfent /types/intercom-client/ @jineshshah36 @peping /types/intercom-web/ @fongandrew @salbahra @onatm /types/intercomjs/ @spencerwi /types/internal-ip/ @BendingBender +/types/internal-ip/v2/ @BendingBender +/types/interpret/ @BendingBender /types/intl/ @RagibHasin /types/intl-locales-supported/ @Slessi /types/intl-messageformat/ @mhegazy /types/intl-relativeformat/ @mohsen1 -/types/intl-tel-input/ @fdnhkj @leonard-thieu +/types/intl-tel-input/ @fdnhkj @leonard-thieu @molnarm +/types/intl-tel-input/v13/ @fdnhkj @leonard-thieu /types/into-stream/ @BendingBender /types/intrinsic-scale/ @shalomdotnet /types/intro.js/ @anahkiasen /types/invariant/ @bennett000 /types/inversify-devtools/ @inversify -/types/ion-rangeslider/v1/ @dduugg @Karel-van-de-Plassche +/types/iobroker/ @AlCalzone /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/ion-rangeslider/v1/ @dduugg @Karel-van-de-Plassche +/types/iopipe__iopipe/ @javonharper +/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot @funthing @iamolegga @tingwai-to @pettyalex +/types/ioredis/v3/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot @pettyalex /types/iota.lib.js/ @fogsh -/types/ip/ @codeanimal +/types/ip/ @codeanimal @BendingBender /types/ip-address/ @icopp @danwbyrne -/types/ip-regex/ @unindented +/types/ip-regex/ @renarsvilnis +/types/ip-regex/v2/ @unindented /types/ipcheck/ @bengry +/types/ipify/ @BendingBender /types/irc/ @phillips1012 +/types/iri/ @BendingBender /types/iron/ @simonschick @rafaelsouzaf -/types/is/ @cabralRodrigo +/types/is/ @cabralRodrigo @gricey432 +/types/is-absolute/ @BendingBender /types/is-absolute-url/ @mhegazy /types/is-alphanumerical/ @vutran /types/is-archive/ @mhegazy /types/is-array/ @pine +/types/is-array-sorted/ @BendingBender /types/is-binary-path/ @DanielRosenwasser +/types/is-buffer/ @rokt33r /types/is-callable/ @nieltg +/types/is-charging/ @BendingBender /types/is-ci/ @atd-schubert /types/is-color/ @VitorLuizC /types/is-compressed/ @mhegazy +/types/is-docker/ @YashdalfTheGray +/types/is-dotdir/ @BendingBender +/types/is-dotfile/ @BendingBender +/types/is-elevated/ @BendingBender /types/is-empty/ @termosa /types/is-finite/ @mhegazy +/types/is-fullwidth-code-point/ @BendingBender +/types/is-function/ @evangeloszotos +/types/is-git-url/ @BendingBender /types/is-glob/ @mrmlnc -/types/is-hotkey/ @petester42 +/types/is-hotkey/ @petester42 @kalley +/types/is-installed-globally/ @BendingBender /types/is-ip/ @coderslagoon /types/is-mobile/ @LogvinovLeon /types/is-my-json-valid/ @kruncher /types/is-negated-glob/ @ajafff /types/is-number/ @harryshipton +/types/is-obj/ @forivall /types/is-object/ @wbhob +/types/is-online/ @BendingBender /types/is-path-cwd/ @DanielRosenwasser /types/is-path-in-cwd/ @mhegazy +/types/is-plain-obj/ @BendingBender +/types/is-png/ @jameswilddev +/types/is-progressive/ @BendingBender /types/is-promise/ @DanielRosenwasser +/types/is-reachable/ @BendingBender +/types/is-regexp/ @forivall +/types/is-relative/ @BendingBender /types/is-relative-url/ @mhegazy /types/is-root/ @mhegazy /types/is-root-path/ @mhegazy @@ -1881,17 +2179,26 @@ /types/is-svg/ @BendingBender /types/is-text-path/ @mhegazy /types/is-touch-device/ @screendriver +/types/is-trademarked/ @BendingBender +/types/is-typedarray/ @BendingBender +/types/is-unc-path/ @BendingBender /types/is-url/ @RyotaMurohoshi /types/is-url-superb/ @kryops /types/is-uuid/ @tedre191 +/types/is-valid-glob/ @BendingBender +/types/is-valid-path/ @Goldsmith42 /types/is-windows/ @mizunashi-mana +/types/isaac/ @mo /types/isbn-utils/ @elhaard /types/iscroll/ @csrakowski @devlato +/types/isexe/ @BendingBender /types/ismobilejs/ @Ty3uK /types/iso-3166-2/ @sicilica /types/iso8601-localizer/ @avielfedida /types/isomorphic-fetch/ @toddlucas /types/isotope-layout/ @avidenic @malinushj +/types/issue-parser/ @Leko +/types/issue-regex/ @BendingBender /types/istanbul/ @tkrotoff /types/istanbul-lib-coverage/ @jason0x43 /types/istanbul-lib-hook/ @jason0x43 @@ -1900,14 +2207,18 @@ /types/istanbul-lib-source-maps/ @jason0x43 /types/istanbul-middleware/ @hookclaw /types/istanbul-reports/ @jason0x43 +/types/istextorbinary/ @BendingBender /types/ityped/ @DanielRosenwasser /types/ix.js/ @Igorbek /types/jackrabbit/ @elvisvoer /types/jade/ @panuhorsmalahti /types/jalaali-js/ @alitaheri /types/japanese-holidays/ @syamatoo -/types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B +/types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B @cyungmann @Roaders @devoto13 @fdim @pe8ter +/types/jasmine/v2/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B @cyungmann @devoto13 @fdim +/types/jasmine/v1/ @borisyankov /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,10 +2229,10 @@ /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 +/types/javascript-astar/ @ptlis @lazerwalker /types/javascript-bignum/ @sandersn /types/javascript-obfuscator/ @sanex3339 /types/javascript-state-machine/ @borisyankov @mdocter @MrBigDog2U @samael65535 @taoqf @@ -1929,9 +2240,10 @@ /types/jcanvas/ @rogierschouten /types/jdataview/ @RReverser /types/jdenticon/ @mtr +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell @sebald @andys8 /types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell @sebald /types/jest-axe/ @JoshuaKGoldberg +/types/jest-cli/ @lifeiscontent /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang /types/jest-each/ @theutz @nickmccurdy @@ -1950,24 +2262,27 @@ /types/jexl/ @m-tomczyk /types/jfs/ @tlaziuk /types/jira-client/ @KOPTE3 @orta +/types/jju/ @ecraig12345 @rlidwka /types/jjv/ @Nemo157 /types/jjve/ @Nemo157 /types/jmespath/ @pushplay -/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/johnny-five/ @nakakura @ujvzolee @workshop2 @xtrimsystems @marcinobiedz /types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd @thewillg @SimonSchick +/types/joi/v13/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd @thewillg @SimonSchick +/types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @aconanlai +/types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW /types/joigoose/ @boothwhack /types/josa/ @vichyssoise /types/jotform-css.js/ @pandawood +/types/jpeg-autorotate/ @Slessi /types/jpeg-js/ @DanielRosenwasser /types/jpegtran-bin/ @hikoma /types/jpm/ @github-account-because-they-want-it /types/jqgrid/ @lokeshpeta /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/ @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/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/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-ajax-chain/ @humana-fragilitas /types/jquery-alertable/ @stever /types/jquery-animate-scroll/ @AndersonFriaca @@ -1982,6 +2297,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 @@ -2091,6 +2407,7 @@ /types/js-data-angular/ @reppners /types/js-fixtures/ @kazimanzurrashid /types/js-git/ @Bartvds +/types/js-levenshtein/ @Kallu609 @naftis /types/js-md5/ @mwmccarthy /types/js-money/ @kanatkubash /types/js-nacl/ @ethanfrey @@ -2100,11 +2417,12 @@ /types/js-sha512/ @nicojs /types/js-string-escape/ @viralpickaxe /types/js-to-java/ @skyitachi -/types/js-url/ @pine613 +/types/js-types/ @BendingBender +/types/js-url/ @pine /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 +2430,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 @catalandres /types/jsftp/ @xyleen /types/jsgraph/ @rosinbum /types/jshamcrest/ @dharkness @@ -2125,8 +2443,10 @@ /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-server/ @jeremyben /types/json-socket/ @svi3c /types/json-stable-stringify/ @mhfrantz /types/json-stringify-safe/ @BendingBender @@ -2134,33 +2454,40 @@ /types/json2md/ @MartynasZilinskas /types/json3/ @NN--- /types/json5/ @Esemesek +/types/json_ml/ @pluma +/types/jsonabc/ @ffflorian +/types/jsonapi-serializer/ @chiangf /types/jsonata/ @nick121212 /types/jsoneditor/ @alejo90 @errietta /types/jsoneditor-for-react/ @joshuakgoldberg /types/jsoneditoronline/ @vbortone -/types/jsonfile/ @dbowring +/types/jsonfile/ @dbowring @BendingBender +/types/jsonfile/v4/ @dbowring /types/jsonic/ @jacobbubu /types/jsonminify/ @no23reason /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/jspdf/ @amberjs +/types/jspath/ @dex4er +/types/jspdf/ @amberjs @lleios @jemerald /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki /types/jsreport-core/ @taoqf -/types/jsreport-html-to-xlsx/v1/ @me +/types/jsreport-html-embedded-in-docx/ @taoqf /types/jsreport-html-to-xlsx/ @me +/types/jsreport-html-to-xlsx/v1/ @me /types/jsreport-jsrender/ @taoqf /types/jsreport-phantom-pdf/ @taoqf /types/jsreport-xlsx/ @taoqf /types/jsrp/ @harryshipton /types/jss/ @appsforartists @kof @pelotom @eps1lon -/types/jssha/ @randombk @SrTobi +/types/jssha/ @randombk @SrTobi @cakoose /types/jstimezonedetect/ @olamothe /types/jstorage/ @dflor003 /types/jstree/ @adaskothebeast @@ -2174,48 +2501,61 @@ /types/jui/ @easylogic /types/jui-core/ @easylogic /types/jui-grid/ @easylogic +/types/junk/ @BendingBender +/types/just-debounce-it/ @azizhk /types/just-extend/ @pe8ter +/types/just-pick/ @pe8ter /types/jweixin/ @taoqf @gomydodo -/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bpdsw +/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bpdsw @bebebebebe @djcsdy @drewwyatt /types/jws/ @JustinBeckwith /types/jwt-client/ @timoteoponce -/types/jwt-decode/v1/ @QuatroDevOfficial /types/jwt-decode/ @GiedriusGrabauskas @madsmadsen +/types/jwt-decode/v1/ @QuatroDevOfficial /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/ @tkrotoff @43081j @devoto13 +/types/karma/v1/ @tkrotoff @43081j /types/karma-chai/ @JayAndCatchFire /types/karma-chai-sinon/ @vasek17 -/types/karma-coverage/ @tkrotoff +/types/karma-coverage/ @tkrotoff @devoto13 /types/karma-fixture/ @evictor @afshawnlotfi /types/karma-jasmine/ @michelsalib /types/karma-viewport/ @karak /types/karma-webpack/ @mtraynham -/types/katex/ @mrand01 +/types/katex/ @mrand01 @knguyen0125 /types/kcors/ @Xstoudi @izayoiko -/types/kdbush/ @DenisCarriere +/types/kdbush/ @DenisCarriere @chrfrasco +/types/kdbxweb/ @Roang-zero1 /types/keen-tracking/ @rui-ferreira /types/kefir/ @AyaMorisawa @HitoriSensei /types/kendo-ui/ @telerik -/types/keyboardjs/ @vbortone @piranha771 +/types/kerberos/ @velezsarain +/types/keyboardjs/ @vbortone @piranha771 @teoxoy +/types/keycloak-connect/ @gstamac /types/keygrip/ @jkeylu /types/keymaster/ @nitram509 /types/keymirror/ @jfahrenkrug /types/keypress.js/ @rcchen /types/keysym/ @harryshipton /types/keytar/ @miniak @shiftkey @juturu -/types/keyv/ @Arylo +/types/keyv/ @Arylo @BendingBender +/types/keyv__mongo/ @BendingBender +/types/keyv__mysql/ @BendingBender +/types/keyv__postgres/ @BendingBender +/types/keyv__redis/ @BendingBender +/types/keyv__sqlite/ @BendingBender /types/kik-browser/ @joelday -/types/klaw/v1/ @mceachen /types/klaw/ @mceachen +/types/klaw/v1/ @mceachen /types/klaw-sync/ @shiftkey /types/kms-json/ @sunnyone -/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 +/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 @joelshepherd /types/knex-postgis/ @vesse /types/knockback/ @borisyankov -/types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @ltlombardi +/types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @ltlombardi @Retsam /types/knockout-amd-helpers/ @DavidSichau /types/knockout-secure-binding/ @pine613 /types/knockout-transformations/ @johnnyreilly @Nemo157 @@ -2231,12 +2571,14 @@ /types/knockout.validation/ @danludwig /types/knockout.viewmodel/ @oising /types/knockstrap/ @adaskothebeast +/types/known/ @BendingBender /types/knuddels-userapps-api/ @Knuddels /types/ko.plus/ @conficient /types/koa/ @DavidCai1993 @jkeylu @brikou /types/koa-basic-auth/ @Tobias4872 /types/koa-better-body/ @danwbyrne -/types/koa-bodyparser/ @hellopao @anup-2s +/types/koa-bodyparser/ @hellopao @anup-2s @hirochachacha +/types/koa-bouncer/ @maruware /types/koa-bunyan-logger/ @sjmcdowall /types/koa-cache-control/ @pe8ter /types/koa-compose/ @jkeylu @@ -2251,9 +2593,10 @@ /types/koa-hbs/ @jcbmln @mudkipme /types/koa-helmet/ @me /types/koa-html-minifier/ @romain-faust -/types/koa-joi-router/ @wingsbob @move-zig +/types/koa-joi-router/ @wingsbob @move-zig @hirochachacha /types/koa-json/ @brooklyndev /types/koa-json-error/ @mudkipme +/types/koa-log/ @havenchyk /types/koa-logger/ @geoffreak @tlaziuk /types/koa-logger-winston/ @stevehipwell /types/koa-morgan/ @vesse @@ -2262,28 +2605,34 @@ /types/koa-passport/ @horiuchi @tlaziuk @brendtumi /types/koa-pino-logger/ @khell /types/koa-pug/ @Xstoudi +/types/koa-qs/ @RemyJeancolas /types/koa-range/ @strax +/types/koa-ratelimit/ @OutdatedVersion +/types/koa-ratelimit-lru/ @danwbyrne /types/koa-redis/ @nsimmons /types/koa-redis-cache/ @dimamukhin /types/koa-requestid/ @sjmcdowall /types/koa-response-time/ @thorsedeke @sjmcdowall /types/koa-route/ @migstopheles @jacogr -/types/koa-router/ @hellopao @schfkt @JounQin @romain-faust +/types/koa-router/ @hellopao @schfkt @JounQin @romain-faust @Guillaume-Mayer @falinor /types/koa-send/ @pe8ter @tlaziuk -/types/koa-session/ @kerol2r20 @tlaziuk +/types/koa-session/ @kerol2r20 @tlaziuk @hirochachacha /types/koa-session-minimal/ @longztian /types/koa-sslify/ @wingsbob /types/koa-static/ @hellopao @tlaziuk /types/koa-static-cache/ @JounQin +/types/koa-static-server/ @wulunyi +/types/koa-useragent/ @rvboris /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,18 +2641,24 @@ /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/latest-semver/ @BendingBender +/types/latest-version/ @BendingBender /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/ldap-filters/ @pluma /types/ldapjs/ @cvillemure @peterkooijmans /types/leadfoot/ @theintern -/types/leaflet/v0/ @rgripper /types/leaflet/ @alejo90 @atd-schubert @mcauer +/types/leaflet/v0/ @rgripper /types/leaflet-areaselect/ @awallat /types/leaflet-curve/ @onikiienko /types/leaflet-draw/ @matt-guest @reblace @YunS-Stacy @beschoenen @@ -2314,12 +2669,12 @@ /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 -/types/leaflet.awesome-markers/v0/ @Odrin @sebek64 /types/leaflet.awesome-markers/ @sebek64 +/types/leaflet.awesome-markers/v0/ @Odrin @sebek64 /types/leaflet.fullscreen/ @wcomartin /types/leaflet.gridlayer.googlemutant/ @ernest-rhinozeros /types/leaflet.heat/ @onderceylan @@ -2329,35 +2684,54 @@ /types/leaflet.pancontrol/ @Brictarus /types/leaflet.pm/ @tkleinke /types/leaflet.polylinemeasure/ @RiON69 +/types/leakage/ @atd-schubert +/types/leap-year/ @BendingBender /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/ @MeirionHughes @danwbyrne +/types/leveldown/v1/ @tarruda @LinusU +/types/levelup/ @MeirionHughes @danwbyrne +/types/levelup/v1/ @blittle @tarruda /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 +/types/liftoff/ @BendingBender /types/lil-uuid/ @Pr1st0n /types/lime-js/ @arthur-xavier /types/line-by-line/ @etomsen +/types/line-column-path/ @BendingBender /types/line-reader/ @stpettersens /types/linear-gradient/ @Jack-Works /types/lingui__core/ @huan086 +/types/lingui__macro/ @huan086 /types/lingui__react/ @huan086 +/types/linkify-issues/ @BendingBender /types/linkify-it/ @praxxis +/types/linkify-urls/ @BendingBender +/types/linkifyjs/ @szhu @ovidiubute +/types/list-git-remotes/ @BendingBender +/types/list-stream/ @IanStorm /types/listr/ @durad /types/lls/ @borislavjivkov +/types/load-google-maps-api/ @oBusk /types/load-json-file/ @SamVerschueren +/types/loadable__component/ @martynaskadisa +/types/loadable__server/ @martynaskadisa /types/loader-runner/ @e-cloud /types/loader-utils/ @Perlmint @TotooriaHyperion /types/loadjs/ @screendriver @@ -2368,12 +2742,14 @@ /types/localized-countries/ @coderslagoon /types/localizejs-library/ @salbahra /types/locate-path/ @me -/types/lockfile/v0/ @Bartvds +/types/lock-system/ @BendingBender /types/lockfile/ @Bartvds @BendingBender +/types/lockfile/v0/ @Bartvds /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 +/types/lodash/v3/ @bczengel @chrootsu /types/lodash-es/ @stephenlautier @e-cloud /types/lodash-webpack-plugin/ @bumbleblym /types/lodash.add/ @bczengel @chrootsu @stepancar @@ -2671,8 +3047,10 @@ /types/lokijs/ @TeamworkGuy2 @thomasconner /types/lolex/ @Nemo157 @joshuakgoldberg @rogierschouten /types/long/ @peterkooijmans +/types/looks-same/ @xcatliu /types/loopback/ @kattsushi @enko @sequoia @drmikecrowe @karimsa /types/loopback-boot/ @kattsushi +/types/loopbench/ @BendingBender /types/lorem-ipsum/ @durad /types/lory.js/ @kubosho @milkisevil /types/loud-rejection/ @BendingBender @@ -2682,58 +3060,70 @@ /types/lozad/ @plantain-00 /types/lru-cache/ @Bartvds @BendingBender /types/lscache/ @Chris-Martinezz -/types/ltx/ @PJakcson +/types/ltx/ @PJakcson @BendingBender /types/luaparse/ @stpettersens +/types/lunr/ @seantanly @hokiegeek /types/lunr/v0/ @sebastian-lenz -/types/lunr/ @seantanly /types/lusca/ @crutchcorn -/types/luxon/ @colbydehart @FourwingsY @jsiebern +/types/luxon/ @colbydehart @FourwingsY @jsiebern @mastermatt @pietrovismara @dawnmist /types/lwip/ @AyaMorisawa /types/lz-string/ @M0ns1gn0r +/types/lzma-native/ @leshow +/types/macrotask/ @BendingBender /types/magic-number/ @stpettersens /types/magicsuggest/ @leonardochaia /types/magnet-uri/ @tlaziuk /types/mailcheck/ @pocesar /types/maildev/ @cyrilschumacher @zbarbuto /types/mailgen/ @vothanhkiet @jordanfarrer -/types/mailgun-js/ @sampsonjoliver +/types/mailgun-js/ @sampsonjoliver @andipaetzold /types/mailparser/ @psnider /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-keyboard-trap/ @darkwebdev +/types/makeup-prevent-scroll-keys/ @darkwebdev +/types/makeup-screenreader-trap/ @darkwebdev /types/mali-compose/ @danwbyrne /types/mali-onerror/ @danwbyrne /types/mandrill-api/ @pocesar +/types/mangopay2-nodejs-sdk/ @ifiokjr /types/map-obj/ @BendingBender -/types/mapbox/ @anahkiasen +/types/mapbox/ @anahkiasen @Fluccioni /types/mapbox-gl/ @dobrud @patrickr /types/mapbox-gl-leaflet/ @agorshkov23 /types/mapbox__geo-viewport/ @fnberta /types/mapbox__geojson-area/ @n0nick /types/mapbox__polyline/ @Kern0 @mklopets +/types/mapbox__s3urls/ @sebastianvera /types/mapbox__shelf-pack/ @Perlmint /types/mapnik/ @ipv4sec /types/mapsjs/ @davismj /types/mariasql/ @bennett000 -/types/mark.js/ @renjfk @RomanGotsiy +/types/mark.js/ @renjfk @RomanGotsiy @LucianBuzzo /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 +/types/marked/ @worr @BendingBender @CrossR @mwickett +/types/marked-terminal/ @bkendall /types/marker-animate-unobtrusive/ @viskin /types/markerclustererplus/ @enanox @mxl /types/markitup/ @drillbits /types/marko/ @darkwebdev /types/maskedinput/ @lokeshpeta /types/masonry-layout/ @m-a-wilson @warriorrocker +/types/massive/ @swissspidy @clarenceh @AmazingTurtle @mike-engel +/types/massive/v4/ @swissspidy @clarenceh @AmazingTurtle /types/massive/v3/ @swissspidy @clarenceh -/types/massive/ @swissspidy @clarenceh @AmazingTurtle /types/match-media-mock/ @asvetliakov -/types/match-sorter/ @claasahl -/types/material-components-web/ @BrentDouglas @ckosti +/types/match-sorter/ @claasahl @chrisru +/types/matcher/ @BendingBender +/types/material-components-web/ @BrentDouglas @ckosti @agroupp /types/material-design-lite/ @bradzacher /types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz @reggino /types/material-ui-datatables/ @coding2012 @@ -2743,13 +3133,15 @@ /types/material__checkbox/ @BrentDouglas @ckosti /types/material__chips/ @BrentDouglas @ckosti /types/material__dialog/ @BrentDouglas @ckosti -/types/material__drawer/ @BrentDouglas @ckosti +/types/material__dom/ @agroupp +/types/material__drawer/ @BrentDouglas @ckosti @agroupp /types/material__floating-label/ @BrentDouglas @ckosti /types/material__form-field/ @BrentDouglas @ckosti /types/material__grid-list/ @BrentDouglas @ckosti /types/material__icon-toggle/ @BrentDouglas @ckosti /types/material__line-ripple/ @BrentDouglas @ckosti /types/material__linear-progress/ @BrentDouglas @ckosti +/types/material__list/ @agroupp /types/material__menu/ @BrentDouglas @ckosti /types/material__notched-outline/ @BrentDouglas @ckosti /types/material__radio/ @BrentDouglas @ckosti @@ -2763,33 +3155,41 @@ /types/material__textfield/ @BrentDouglas @ckosti /types/material__toolbar/ @BrentDouglas @ckosti /types/material__top-app-bar/ @BrentDouglas @ckosti -/types/materialize-css/v0/ @eriklieben @leonyu @SinghSukhdeep @jfcere @scote @LiadIdan /types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy +/types/materialize-css/v0/ @eriklieben @leonyu @SinghSukhdeep @jfcere @scote @LiadIdan /types/math3d/ @laszlojakab @jimsmart /types/mathjax/ @rolandzwaga -/types/mathjs/ @siavol @andnp @bradbesserman +/types/mathjs/ @siavol @andnp @bradbesserman @pawkrol /types/matter-js/ @piranha771 @hasparus -/types/maxmind/ @geoffreak +/types/mcrypt/ @pluma /types/mcustomscrollbar/ @flurg /types/md5/ @arcdev1 @jprogrammer +/types/md5-file/ @BamButz +/types/mdast/ @lujun2 /types/mdns/ @reppners /types/mdurl/ @rokt33r /types/media-typer/ @BendingBender /types/medium-editor/ @keika299 @pascaliske /types/megajs/ @danwbyrne /types/mem/ @SamVerschueren +/types/mem-cache/ @MutterPedro /types/mem-fs/ @MyFoodBag /types/mem-fs-editor/ @MyFoodBag /types/memcached/ @KentarouTakeda /types/memdown/ @MeirionHughes @danwbyrne /types/memjs/ @leizongmin /types/memoize-one/ @karol-majewski @franklixuefei +/types/memoize-one/v3/ @karol-majewski @franklixuefei /types/memoizee/ @juanpicado /types/memory-cache/ @jedigo @thieman /types/memory-fs/ @e-cloud +/types/memory-pager/ @BendingBender +/types/memorystream/ @bangbang93 /types/memwatch-next/ @cyrilschumacher /types/meow/ @KnisterPeter @praxxis @bitjson /types/merge-descriptors/ @danny8002 +/types/merge-env/ @BendingBender +/types/merge-images/ @BendingBender /types/merge-stream/ @k-kagurazaka @tomxtobin @daniel-zazula @djcsdy /types/merge2/ @tkrotoff @smac89 /types/merkle/ @kerol2r20 @@ -2798,13 +3198,14 @@ /types/meshblu/ @fnipo /types/mess/ @Nemo157 /types/messenger/ @derekcicerone -/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel @andrei-markeev @lmachens +/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel @andrei-markeev @lmachens @gunn /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 @@ -2813,9 +3214,11 @@ /types/mfiles/ @avonwyss /types/micro/ @kaoDev /types/micro-cors/ @CallumDenby -/types/micromatch/v2/ @glen-84 +/types/micro-events/ @AlexanderSychev /types/micromatch/ @glen-84 @vemoo +/types/micromatch/v2/ @glen-84 /types/microrouter/ @mathieudutour +/types/microservice-utilities/ @runebaas /types/microsoft-ajax/ @pjmagee /types/microsoft-live-connect/ @jvilk /types/microsoft-sdk-soap/ @markusmauch @@ -2827,6 +3230,7 @@ /types/mime-db/ @AJamesPhillips /types/mime-types/ @Perlmint /types/mimos/ @AJamesPhillips +/types/min-indent/ @BendingBender /types/mina/ @lhk @mattanja @kant2002 /types/mini-css-extract-plugin/ @JounQin /types/minimal-bit-array/ @jeremejevs @@ -2840,12 +3244,15 @@ /types/mithril-global/ @spacejack @isiahmeadows /types/mitm/ @alejo90 /types/mixpanel/ @hjellek @Manduro +/types/mixpanel-browser/ @karlos1337 /types/mixto/ @vvakame -/types/mjml/ @aahoughton +/types/mjml/ @aahoughton @marpstar +/types/mjml-react/ @henrinormak /types/mkdirp/ @Bartvds @mrmlnc /types/mkdirp-promise/ @pluma /types/mkpath/ @optical /types/ml-levenberg-marquardt/ @m93a +/types/mnemonic-words/ @BendingBender /types/mobx-apollo/ @pselden /types/mobx-devtools-mst/ @pluma /types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode @1999 @@ -2860,39 +3267,45 @@ /types/mock-require/ @gDelgado14 /types/mockdate/ @brunolm /types/mockery/ @jt000 +/types/mockingoose/ @hirochachacha /types/modernizr/ @borisyankov @theodorejb @leonyu @lucax88x @nhardy /types/modesl/ @neeschit +/types/modular-scale/ @mikefowler /types/module-alias/ @KevinRamharak +/types/module-deps/ @TeamworkGuy2 /types/moji/ @yasupeke /types/moment-business/ @wonbyte /types/moment-business-time/ @swist /types/moment-duration-format/ @SwintDC @TwoStone @leonard-thieu @bendykowski /types/moment-holiday/ @rwdalpe /types/moment-jalaali/ @alitaheri -/types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas +/types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas @chemass /types/moment-round/ @jacobbaskin /types/moment-shortformat/ @whatasoda /types/moment-strftime2/ @dex4er -/types/moment-timezone/ @michelsalib @alanblins +/types/moment-timezone/ @michelsalib @alanblins @asermax /types/money-math/ @taoqf /types/mongo-sanitize/ @CedricCazin +/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 @erikc5000 /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-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 @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 @Fazendaaa @NormanPerrin @danmana @stablio @emmanuelgautier @frontendmonster @mingchen +/types/mongoose/v4/ @simonxca @horiuchi @lukasz-zak /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz /types/mongoose-mock/ @jt000 /types/mongoose-paginate/ @linusbrolin @simonxca +/types/mongoose-paginate-v2/ @linusbrolin @simonxca @woutgg /types/mongoose-promise/ @simonxca /types/mongoose-seeder/ @Crevil /types/mongoose-sequence/ @linusbrolin /types/mongoose-simple-random/ @rsxdalv /types/mongoose-unique-validator/ @stevehipwell /types/mongorito/ @pinguet62 +/types/mongration/ @soulthreads +/types/month-days/ @BendingBender /types/moo/ @deltaidea @MofX /types/moonjs/ @DanielRosenwasser /types/morgan/ @staticfunction @pscanf @@ -2900,8 +3313,10 @@ /types/morris.js/ @mareek @sindilevich /types/mosca/ @GabrielGouv @jerray /types/motor-hat/ @muntyan -/types/mousetrap/ @qcz +/types/mousetrap/ @qcz @alanhchoi /types/move-concurrently/ @mgroenhoff +/types/move-file/ @BendingBender +/types/moveto/ @shermendev /types/moviedb/ @basarat @0x6368656174 /types/moxios/ @itoasuka /types/mozilla-readability/ @charlesvdv @@ -2915,13 +3330,16 @@ /types/msportalfx-test/ @julioct /types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado /types/mu2/ @jedigo +/types/mui-datatables/ @favna /types/muicss/ @samuelneff /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob -/types/multer-gridfs-storage/v1/ @devconcept /types/multer-gridfs-storage/ @devconcept +/types/multer-gridfs-storage/v2/ @devconcept +/types/multer-gridfs-storage/v1/ @devconcept /types/multer-s3/ @tcaesvk @galtalmor @terski +/types/multi-progress/ @DHBrett /types/multi-typeof/ @mhegazy -/types/multimatch/ @stephenlautier +/types/multimatch/ @stephenlautier @BendingBender /types/multiparty/ @kenfdev /types/multiplexjs/ @KamyarNazeri /types/multisort/ @CzBuCHi @@ -2932,10 +3350,12 @@ /types/murmurhash3js/ @dlee-nvisia /types/musicmetadata/ @Xstoudi /types/mustache/ @markashleybell @manuth +/types/mustache-express/ @BendingBender +/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 @@ -2953,31 +3373,44 @@ /types/navermaps/ @ckboyjiy /types/navigation/ @grahammendick /types/navigation-react/ @grahammendick +/types/navigator-permissions/ @vargavince91 @minddocdev /types/navigo/ @aersamkull @dancespiele @deini /types/nblas/ @erikgerrits -/types/nconf/ @jedigo @jmthibault +/types/nconf/ @jedigo @jmthibault @ew73 /types/ncp/ @bartvds /types/ndarray/ @pawsong @taoqf /types/nearley/ @deltaidea @BendingBender +/types/neat-csv/ @calamitizer /types/nedb/ @reppners @anthonynichols @afharo /types/nedb-logger/ @thisboyiscrazy -/types/needle/v0/ @bigsan +/types/needle/ @bigsan @nikeee @sindilevich @bryanspears /types/needle/v1/ @bigsan @nikeee -/types/needle/ @bigsan @nikeee @sindilevich +/types/needle/v0/ @bigsan +/types/negative-array/ @BendingBender +/types/negative-zero/ @BendingBender /types/negotiator/ @BendingBender /types/neo4j/ @cyrilschumacher /types/nes/ @NoHomey @saboya /types/nested-error-stacks/ @woutervh- /types/net-keepalive/ @hertzg +/types/netease-captcha/ @norubidium +/types/netlify-identity-widget/ @nkprince007 /types/netmask/ @mhfrantz /types/network-interfaces/ @anderswestberg +/types/new-github-issue-url/ @BendingBender +/types/new-github-release-url/ @BendingBender /types/new-relic-browser/ @renehamburger @piotrkubisa /types/newline-remove/ @OpenByteDev -/types/newman/ @LogvinovLeon -/types/newrelic/ @mastermatt +/types/newman/ @LogvinovLeon @Graham42 +/types/newrelic/ @mastermatt @brookspatton @MichaelRBond /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-seo/ @ThomasK33 +/types/next-server/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira @ajliv +/types/next-tick/ @BendingBender +/types/nextgen-events/ @katsanva /types/ng-command/ @stephenlautier /types/ng-cordova/ @ksachdeva /types/ng-dialog/ @stephenlautier @@ -3001,33 +3434,38 @@ /types/ngtoaster/ @btesser /types/ngwysiwyg/ @patrick-mackay /types/nightmare/ @horiuchi @samyang-au @Bleser92 -/types/nightwatch/ @rkavalap @schlesiger +/types/nightwatch/ @rkavalap @schlesiger @ClaytonAstrom +/types/nise/ @a-tarasyuk /types/nivo-slider/ @AndersonFriaca /types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko +/types/noble-mac/ @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/ @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 @samuela @kuehlein +/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/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/v7/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry +/types/node/v6/ @Microsoft @DefinitelyTyped @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry +/types/node/v4/ @Microsoft @DefinitelyTyped @eps1lon @Archcry +/types/node/v0/ @Microsoft @DefinitelyTyped /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-emoji/ @jonestristand @styu @rimiti +/types/node-fetch/ @torstenwerner @nikcorg @vinaybedre /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 @Apologiz @timhwang21 @supaiku0 @andersk /types/node-gcm/ @horiuchi /types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy +/types/node-gettext/ @sameercaresu /types/node-hid/ @mhegazy @ert78gb @thegecko /types/node-horseman/ @apratheek /types/node-hue-api/ @fjmorel @@ -3039,17 +3477,19 @@ /types/node-memwatch/ @Kroisse /types/node-mysql-wrapper/ @kataras /types/node-notifier/ @tkQubo -/types/node-polyglot/ @timjk +/types/node-polyglot/ @timjk @liamross /types/node-powershell/ @rodrigoff /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-rsa/ @alitaheri @xm @ffflorian /types/node-schedule/ @cyrilschumacher @flowpl /types/node-slack/ @tkQubo /types/node-snap7/ @heilingbrunner /types/node-sprite-generator/ @Perlmint +/types/node-sql-parser/ @taozhi8833998 /types/node-ssdp/ @OrionNebula /types/node-static/ @Morfent /types/node-statsd/ @alexturek @convoyinc @@ -3058,6 +3498,7 @@ /types/node-validator/ @kengorab /types/node-vault/ @YuJianrong /types/node-wit/ @julienduf +/types/node-xlsx/ @cWatermelon /types/node-xmpp-client/ @PJakcson /types/node-xmpp-core/ @PJakcson /types/node-zookeeper-client/ @plantain-00 @jessezhang91 @@ -3066,8 +3507,8 @@ /types/node_redis/ @borisyankov /types/nodecredstash/ @migstopheles /types/nodegit/ @dolanmiu @tniessen -/types/nodemailer/v3/ @rogierschouten /types/nodemailer/ @rogierschouten @dex4er @bioball +/types/nodemailer/v3/ @rogierschouten /types/nodemailer-direct-transport/ @rogierschouten /types/nodemailer-mailgun-transport/ @otociulis /types/nodemailer-pickup-transport/ @psnider @@ -3078,26 +3519,35 @@ /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-path/ @BendingBender +/types/normalize-url/ @odin3 @BendingBender @mathieumg /types/notie/ @mateusdemboski /types/notify/ @hellochar /types/notifyjs/ @soundTricker @NateScarlet /types/notifyjs-browser/ @bahman616 /types/notyf/ @gurov -/types/nouislider/v7/ @acoreyj -/types/nouislider/v8/ @bleuarg /types/nouislider/ @bleuarg @lagaffe +/types/nouislider/v8/ @bleuarg +/types/nouislider/v7/ @acoreyj /types/novnc-core/ @smithkl42 @BendingBender /types/npm/ @SomaticIT -/types/npm-package-arg/ @mgroenhoff +/types/npm-email/ @BendingBender +/types/npm-keyword/ @BendingBender +/types/npm-license-crawler/ @ffflorian +/types/npm-name/ @BendingBender +/types/npm-package-arg/ @mgroenhoff @OiYouYeahYou /types/npm-packlist/ @ajafff +/types/npm-paths/ @BendingBender +/types/npm-run-path/ @BendingBender +/types/npm-user/ @BendingBender +/types/npm-user-packages/ @BendingBender /types/npmlog/ @DanielMSchmidt @littlepiggy03 /types/ns-api/ @Archcry /types/nslog/ @unindented /types/nsqjs/ @cezaryrk -/types/nuka-carousel/ @Romic /types/number-is-nan/ @mhegazy /types/number-to-words/ @frederickfogerty /types/numeral/ @vbortone @BehindTheMath @klujanrosas @@ -3108,13 +3558,16 @@ /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-shim/ @BendingBender /types/oauth.js/ @nobuoka -/types/oauth2-server/ @vangorra @cirick @d-fischer +/types/oauth2-server/ @vangorra @cirick @d-fischer @rvitorsantos /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 @@ -3123,7 +3576,7 @@ /types/object-keys-mapping/ @newraina /types/object-map/ @wolfgang42 /types/object-merge/ @OpenByteDev -/types/object-path/ @pocesar +/types/object-path/ @pocesar @BendingBender /types/object-refs/ @3fd /types/object.getownpropertydescriptors/ @VitorLuizC /types/oblo-util/ @Oblosys @@ -3131,8 +3584,11 @@ /types/observe-js/ @herrmanno /types/oclazyload/ @rolandzwaga /types/odata/ @janhommes @jcchalte +/types/oembed-parser/ @BendingBender /types/ofe/ @Morfent /types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT +/types/office-js-preview/ @OfficeDev @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT +/types/office-runtime/ @Zlatkovsky @mscharlock /types/offline-js/ @cgwrench /types/oibackoff/ @geoffreak /types/oidc-token-manager/ @rosieks @@ -3140,46 +3596,57 @@ /types/okta__okta-vue/ @innovation-team /types/ol/ @yairtawil /types/omggif/ @ffflorian +/types/on-change/ @BendingBender /types/on-finished/ @czechboy0 @BendingBender /types/on-headers/ @jjeffery @BendingBender +/types/on-wake-up/ @ajafff /types/once/ @denis-sokolov @BendingBender +/types/one-time/ @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/open-editor/ @BendingBender +/types/openapi-factory/ @runebaas /types/opener/ @tikurahul -/types/openfin/v17/ @chrisbarker +/types/openfin/ @chrisbarker @rdepena @whyn07m3 @licui3936 +/types/openfin/v34/ @chrisbarker @rdepena @whyn07m3 /types/openfin/v29/ @chrisbarker @rdepena -/types/openfin/ @chrisbarker @rdepena @whyn07m3 +/types/openfin/v17/ @chrisbarker /types/openjscad/ @danmarshall -/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/openlayers/v3/ @osechet @matthiasdailey-ccri +/types/openlayers/v2/ @bolhovsky +/types/openpgp/ @errietta @damonpam @po5i @ecamellini /types/openstack-wrapper/ @sanjaymadane /types/opentok/ @westy92 @CatGuardian /types/opentype.js/ @danmarshall @edzis /types/opn/ @shinnn @SomaticIT @tlent +/types/opossum/ @quinnlangille @merufm @lance @mastermatt /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/ora/v1/ @basarat @screendriver @BendingBender @azasypkin +/types/ora/v0/ @basarat @screendriver +/types/oracle__oraclejet/ @nolakara @jingxwu /types/oracledb/ @Bigous /types/orchestrator/ @tkQubo @TeamworkGuy2 /types/orderedmap/ @bradleyayers /types/orientjs/ @saeedtabrizi +/types/original/ @wcarson /types/os-homedir/ @mhegazy -/types/os-locale/v1/ @AyaMorisawa @BendingBender /types/os-locale/ @AyaMorisawa @BendingBender +/types/os-locale/v1/ @AyaMorisawa @BendingBender /types/os-name/ @BendingBender /types/os-tmpdir/ @mhegazy /types/osmosis/ @jurajkocan @evanshortiss /types/osmtogeojson/ @tkqubo /types/osrm/ @DenisCarriere /types/otplib/ @renjfk +/types/overlayscrollbars/ @KingSora /types/overwatch-api/ @JoshuaHall /types/owasp-password-strength-test/ @stephtr /types/owl.carousel/ @igorissen @KennethanCeyer @@ -3189,11 +3656,13 @@ /types/p-cancelable/ @BendingBender /types/p-catch-if/ @LinusU /types/p-debounce/ @BendingBender -/types/p-defer/ @SamVerschueren +/types/p-defer/ @SamVerschueren @BendingBender /types/p-do-whilst/ @BendingBender /types/p-each-series/ @BendingBender /types/p-event/ @BendingBender /types/p-every/ @BendingBender +/types/p-forever/ @BendingBender +/types/p-is-promise/ @BendingBender /types/p-lazy/ @BendingBender /types/p-limit/ @BendingBender @LinusU /types/p-loading/ @renjfk @@ -3202,10 +3671,13 @@ /types/p-map/ @BendingBender /types/p-map-series/ @BendingBender /types/p-memoize/ @forabi +/types/p-min-delay/ @BendingBender /types/p-one/ @BendingBender +/types/p-pipe/ @BendingBender /types/p-progress/ @icopp /types/p-props/ @BendingBender /types/p-queue/ @BendingBender @evanshortiss +/types/p-queue/v2/ @BendingBender @evanshortiss /types/p-reduce/ @BendingBender /types/p-reflect/ @BendingBender /types/p-retry/ @BendingBender @@ -3214,40 +3686,55 @@ /types/p-some/ @BendingBender /types/p-tap/ @BendingBender /types/p-throttle/ @BendingBender +/types/p-time/ @BendingBender /types/p-timeout/ @BendingBender +/types/p-times/ @BendingBender /types/p-try/ @BendingBender @LinusU /types/p-wait-for/ @BendingBender +/types/p-wait-for/v1/ @BendingBender +/types/p-waterfall/ @BendingBender /types/p-whilst/ @BendingBender /types/p2/ @clark-stevenson -/types/package-json/ @jinwoo +/types/p5/ @p5-types +/types/package-json/ @jinwoo @BendingBender /types/packery/ @piraveen @hanssens /types/pad/ @mhegazy /types/page/ @43081j /types/paho-mqtt/ @amikhalev /types/pako/ @cappellin @calebegg +/types/palx/ @mikefowler /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/parents/ @TeamworkGuy2 /types/parity-pmd/ @leovujanic @jewbre /types/parity-pmr/ @leovujanic /types/parity-poe/ @leovujanic -/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas -/types/parse-git-config/ @leonard-thieu @deltaidea +/types/park-miller/ @BendingBender +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas @agoldis +/types/parse/v1/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas +/types/parse-columns/ @BendingBender +/types/parse-filepath/ @BendingBender +/types/parse-git-config/ @leonard-thieu @deltaidea @BendingBender +/types/parse-git-config/v2/ @leonard-thieu @deltaidea /types/parse-github-url/ @ajafff /types/parse-glob/ @glen-84 /types/parse-json/ @mrmlnc /types/parse-link-header/ @zelein /types/parse-mockdb/ @dpoetzsch /types/parse-ms/ @Roaders +/types/parse-numeric-range/ @eoin-obrien +/types/parse-passwd/ @BendingBender /types/parse-torrent/ @niieani @tlaziuk /types/parse-torrent-file/ @tlaziuk /types/parse-unit/ @Jack-Works -/types/parse5/v4/ @inikulin @andnp /types/parse5/ @inikulin +/types/parse5/v4/ @inikulin @andnp /types/parse5-html-rewriting-stream/ @samuelli /types/parse5-htmlparser2-tree-adapter/ @inikulin /types/parse5-parser-stream/ @inikulin @@ -3257,38 +3744,47 @@ /types/parsecurrency/ @cristianrgreco /types/parseurl/ @bomret /types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu @MrJohz -/types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 +/types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 @kstiehl /types/passport-anonymous/ @0x6368656174 +/types/passport-auth0/ @johnbendi @iamvishnusankar @duncanhall +/types/passport-azure-ad/ @ShekharNain /types/passport-beam/ @AtlasDev +/types/passport-bnet/ @ivan94 /types/passport-cognito/ @mbutsykin /types/passport-discord/ @kzay /types/passport-facebook/ @staticfunction @lucasmacosta /types/passport-facebook-token/ @rmartone @mrand01 -/types/passport-github/ @yasupeke -/types/passport-github2/ @yasupeke @mthmulders @codepunkt +/types/passport-github/ @yasupeke @reggaepanda +/types/passport-github2/ @yasupeke @mthmulders @codepunkt @ivan94 /types/passport-google-oauth/ @staticfunction /types/passport-google-oauth2/ @bluehatbrit -/types/passport-http/ @krizalys @tlaziuk @cjbarth +/types/passport-http/ @krizalys @tlaziuk @cjbarth @jamesadarich /types/passport-http-bearer/ @isman-usoh /types/passport-jwt/ @jindev /types/passport-kakao/ @Park9eon @zerocho +/types/passport-linkedin-oauth2/ @andrewvetovitz /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 @ivan94 /types/passport-oauth2-client-password/ @akaNightmare /types/passport-remember-me-extended/ @AylaJK -/types/passport-saml/ @cjbarth @dassennato +/types/passport-saml/ @cjbarth @dassennato @ksamborski /types/passport-steam/ @kzay /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 /types/path-exists/ @shiwano @BendingBender +/types/path-exists/v1/ @shiwano /types/path-is-absolute/ @mhegazy /types/path-is-inside/ @aomarks +/types/path-key/ @BendingBender +/types/path-regex/ @BendingBender +/types/path-type/ @BendingBender /types/pathfinding/ @BNedry /types/pathjs/ @lokeshpeta /types/pathwatcher/ @GlenCFL @@ -3298,9 +3794,10 @@ /types/paypal-rest-sdk/ @trainerbill /types/pbf/ @cschwarz /types/pbkdf2/ @timonegk +/types/pdf2image/ @taoqf /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,10 +3805,12 @@ /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 +/types/petit-dom/ @JamesMessinger /types/pg/ @pspeter3 +/types/pg/v6/ @pspeter3 /types/pg-ears/ @bradleyayers /types/pg-escape/ @khell /types/pg-format/ @zopf @@ -3337,14 +3836,17 @@ /types/pick-weight/ @rsxdalv /types/pickadate/ @theodorejb @leonard-thieu /types/picturefill/ @alaz +/types/pid-from-port/ @BendingBender /types/pidusage/ @cyrilschumacher @mx601595686 /types/pify/ @samverschueren @mad-mike @c7hm4r -/types/pigpio/ @manerfan -/types/pikaday/ @MidnightDesign @wake42 +/types/pigpio/ @manerfan @erikma +/types/pigpio-dht/ @erikma +/types/pikaday/ @MidnightDesign @wake42 @mezoistvan /types/pikaday-time/ @Sayan751 /types/pinkyswear/ @chances +/types/pino/ @psnider @BendingBender @screendriver @paambaati @alferpal @mortiy /types/pino/v3/ @psnider -/types/pino/ @psnider @BendingBender @screendriver @paambaati +/types/pino-http/ @screendriver /types/pino-multi-stream/ @JakeGinnivan /types/pinterest-sdk/ @adamburmister /types/pinyin/ @wanganjun @@ -3353,12 +3855,15 @@ /types/pixi.js/ @clark-stevenson /types/pkg-conf/ @jorgegonzalez /types/pkg-dir/ @NK-WEB-Git +/types/pkg-up/ @forivall +/types/pkg-versions/ @BendingBender /types/pkijs/ @microshine /types/platform/ @JakeH /types/playcanvas/ @Neoflash1979 /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 @@ -3372,6 +3877,13 @@ /types/podcast/ @nikeee /types/podium/ @AJamesPhillips /types/point-in-polygon/ @dyst5422 @kogai +/types/pollyjs__adapter/ @feinoujc +/types/pollyjs__adapter-fetch/ @feinoujc +/types/pollyjs__adapter-node-http/ @jlmessenger +/types/pollyjs__core/ @feinoujc +/types/pollyjs__persister/ @feinoujc +/types/pollyjs__persister-fs/ @feinoujc +/types/pollyjs__utils/ @feinoujc /types/polyfill-service/ @Alorel /types/polylabel/ @DenisCarriere /types/polyline/ @Kern0 @@ -3379,7 +3891,15 @@ /types/polymer-ts/ @lgrignon /types/popcorn/ @grapswiz /types/portscanner/ @douglasduteil +/types/positive-zero/ @BendingBender /types/postal/ @lokeshpeta @myitcv +/types/postcss-calc/ @huan086 +/types/postcss-icss-values/ @huan086 +/types/postcss-modules-extract-imports/ @huan086 +/types/postcss-modules-local-by-default/ @huan086 +/types/postcss-modules-resolve-imports/ @huan086 +/types/postcss-modules-scope/ @huan086 +/types/postcss-url/ @lenovouser /types/postman-collection/ @kbuzby /types/postmark/ @benbayard @jineshshah36 /types/pouch-redux-middleware/ @charrondev @@ -3393,7 +3913,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 @@ -3408,10 +3928,13 @@ /types/preloadjs/ @endel /types/prelude-ls/ @AyaMorisawa /types/prettier/ @ikatyang -/types/pretty-bytes/v4/ @plantain-00 /types/pretty-bytes/ @plantain-00 @danielasy +/types/pretty-bytes/v4/ @plantain-00 /types/pretty-format/ @ikatyang -/types/pretty-ms/ @BendingBender @ocboogie +/types/pretty-hrtime/ @BendingBender +/types/pretty-ms/ @BendingBender @ocboogie @silh +/types/pretty-ms/v3/ @BendingBender @ocboogie +/types/preval.macro/ @huan086 /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak /types/prismic-dom/ @nickw444 @sbilstein @@ -3421,7 +3944,7 @@ /types/progress/ @sebastian-lenz /types/progressbar/ @atd-schubert /types/progressjs/ @zaneli -/types/proj4/ @DenisCarriere +/types/proj4/ @DenisCarriere @BendingBender /types/proj4leaflet/ @BendingBender /types/project-oxford/ @scsouthw /types/prometheus-gc-stats/ @danwbyrne @@ -3429,20 +3952,23 @@ /types/promise-ftp/ @coolreader18 /types/promise-ftp-common/ @coolreader18 /types/promise-map-limit/ @kohlmannj +/types/promise-memoize/ @forivall /types/promise-pg/ @coldacid -/types/promise-polyfill/ @skysteve +/types/promise-polyfill/ @skysteve @djcsdy /types/promise-pool/ @vilic /types/promise-queue/ @LachlanStuart /types/promise-retry/ @shirakaba /types/promise-sftp/ @coolreader18 /types/promise-timeout/ @Aankhen /types/promise.prototype.finally/ @slavik57 @BendingBender +/types/promised-ldap/ @pluma /types/promised-temp/ @rokadias /types/promisify-node/ @borekb /types/promisify-supertest/ @aleung /types/prompt-sync/ @MugeSo /types/prompt-sync-history/ @MugeSo /types/promptly/ @danrspencer +/types/prompts/ @Berkays @danielpa9708 @kamontat /types/prop-types/ @DovydasNavickas @ferdaber /types/proper-lockfile/ @qlonik /types/properties-reader/ @Goldsmith42 @@ -3462,7 +3988,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 @@ -3471,57 +3997,75 @@ /types/proxy-lists/ @BehindTheMath /types/proxy-verifier/ @BehindTheMath /types/proxyquire/ @jt000 +/types/ps-list/ @BendingBender /types/ps-tree/ @alessiopcc +/types/pseudo-audio-param/ @kirbysayshi +/types/psl/ @BendingBender /types/ptomasroos__react-native-multi-slider/ @Slessi /types/pty.js/ @enlight /types/public-ip/ @BendingBender -/types/pubnub/ @bitbankinc @rollymaduk @vitosamson +/types/pubnub/ @bitbankinc @rollymaduk @vitosamson @FlorianDr @danduh /types/pubsub-js/ @borisyankov /types/pug/ @TonyPythoneer @19majkel94 /types/pulltorefreshjs/ @DanielRosenwasser @humpedli /types/pump/ @tlaziuk /types/pumpify/ @JustinBeckwith @aoberoi +/types/punycode/ @yavanosta /types/pupa/ @nju33 +/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 @SimonSchick /types/puppeteer/v0/ @marvinhagemeister @cdeutsch -/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 +/types/puppeteer-core/ @mtsmfm /types/pure-render-decorator/ @seansfkelley /types/purl/ @danfma /types/pusher-js/ @tkqubo @cainlevy /types/pvutils/ @microshine /types/python-shell/ @dolanmiu @WORMSS -/types/q/v0/ @bnemetchek @johnnyreilly /types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau @TeamworkGuy2 +/types/q/v0/ @bnemetchek @johnnyreilly /types/q-io/ @Bartvds /types/q-retry/ @vilic -/types/qhistory/ @Kovensky -/types/qiniu-js/ @taoqf +/types/qhistory/ @Jessidhia +/types/qiniu-js/ @taoqf @qiqizjl /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 /types/qrcode.react/ @mleko /types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti +/types/qs-middleware/ @davecardwell /types/qtip2/ @Seltzer @leonard-thieu -/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro +/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro @jarrku /types/querystringify/ @ilich /types/quick-lru/ @BendingBender +/types/quick-lru/v1/ @BendingBender /types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone @mhamri /types/quixote/ @greybax -/types/qunit/v1/ @diullei /types/qunit/ @waratuman @mike-north +/types/qunit/v1/ @diullei /types/qunit-dom/ @happycollision /types/quoted-printable/ @pushplay /types/qwest/ @lindsayevans /types/r-script/ @NaridaL /types/rabbit.js/ @wokim +/types/rabbitmq-schema/ @rulezzz1987 /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/radix64/ @huan086 +/types/raf/ @BenLorantfy +/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 @jottenlips @minitesh +/types/random-boolean/ @BendingBender +/types/random-float/ @BendingBender +/types/random-int/ @BendingBender +/types/random-item/ @BendingBender /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev +/types/random-obj-key/ @BendingBender +/types/random-obj-prop/ @BendingBender /types/random-seed/ @endel /types/random-string/ @stpettersens +/types/randoma/ @BendingBender +/types/randombytes/ @BendingBender /types/randomcolor/ @feitzi @BradyLiles /types/range-parser/ @tlaziuk /types/rangyinputs/ @ersimont @@ -3541,190 +4085,225 @@ /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/ @DanielRosenwasser @BendingBender +/types/rc-progress/ @jussikinnula /types/rc-select/ @DenisTirilis /types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @Deanna2 +/types/rc-switch/ @karol-majewski +/types/rc-time-picker/ @Hoff97 +/types/rc-tooltip/ @rhysd @ahstro @vsaarinen /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/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei @Jessidhia @pshrmn @threepointone +/types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz /types/react-adal/ @dkorolev1 -/types/react-albus/ @sseppola -/types/react-alert/ @ssyrell +/types/react-albus/ @sseppola @conradreuter @kuirak +/types/react-alert/ @g1eny0ung +/types/react-alert/v2/ @ssyrell /types/react-alice-carousel/ @endigo /types/react-amplitude/ @rayzor65 /types/react-animate-on-scroll/ @ralbuque /types/react-app/ @prakarshpandey -/types/react-aria-menubutton/ @forabi @crohlfs +/types/react-aria-menubutton/ @forabi @crohlfs @karmats /types/react-aria-modal/ @forabi /types/react-autocomplete/ @lstanden /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-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly +/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen @enricoboccadifuoco @lonyele +/types/react-better-password/ @mhuynh1 +/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly @janb87 +/types/react-blessed/ @me /types/react-body-classname/ @mhegazy -/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya @t49tran +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya @t49tran @bes /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar /types/react-bootstrap-daterangepicker/ @ianks -/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-bootstrap-table/v2/ @flaub @alelode @UJosue10 +/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson @arichter83 @dalevfenton +/types/react-breadcrumbs/ @guoyunhe /types/react-breadcrumbs-dynamic/ @mitsuruog /types/react-broadcast/ @kandros /types/react-burger-menu/ @radziksh +/types/react-cache/ @skovy /types/react-calendar-heatmap/ @9renpoto /types/react-calendar-timeline/ @radziksh @acemac /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 /types/react-collapsible/ @knegusen -/types/react-color/ @LKay @markspolakovs @mntdn -/types/react-confirm/ @santiagodoldan +/types/react-color/ @LKay @markspolakovs @mntdn @nkgrnkgr +/types/react-confirm/ @santiagodoldan @marknelissen /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-collapse/ @dford07 /types/react-css-modules/ @KostyaEsmukov @skirsdeda /types/react-css-transition-replace/ @LKay /types/react-currency-formatter/ @pastushenkoy @Jeka-Vasiliev -/types/react-custom-scrollbars/v3/ @David-LeBlanc-git /types/react-custom-scrollbars/ @David-LeBlanc-git @kittimiyo -/types/react-data-grid/v1/ @SupernaviX -/types/react-data-grid/v2/ @SupernaviX @KieranPeat @martinnov92 +/types/react-custom-scrollbars/v3/ @David-LeBlanc-git /types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 @baso53 +/types/react-data-grid/v2/ @SupernaviX @KieranPeat @martinnov92 +/types/react-data-grid/v1/ @SupernaviX /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-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley @justingrant @jakeboone02 +/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/v15/ @MartynasZilinskas /types/react-dom-factories/ @jgoz +/types/react-dotdotdot/ @jczyzewski +/types/react-draft-wysiwyg/ @imechZhangLY @brunoMaurice /types/react-dragtastic/ @nscarcella -/types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard -/types/react-dropzone/v3/ @matdube @LynxEyes @goblindegook @benbayard @LKay /types/react-dropzone/ @matdube @LynxEyes @goblindegook @benbayard @LKay @codeaid @jurosh @ekilah +/types/react-dropzone/v3/ @matdube @LynxEyes @goblindegook @benbayard @LKay +/types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard /types/react-dynamic-number/ @eugrdn /types/react-easy-chart/ @danzel /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 +/types/react-filepond/ @zposten /types/react-flag-icon-css/ @jonfreedman /types/react-flags-select/ @senukartur -/types/react-flatpickr/ @begincalendar +/types/react-flatpickr/ @begincalendar @snaveevans /types/react-flex/ @pushplay /types/react-flexr/ @pushplay /types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory -/types/react-form/v1/ @cameron-mcateer /types/react-form/ @cameron-mcateer @TiuSh +/types/react-form/v1/ @cameron-mcateer /types/react-foundation/ @danielearwicker +/types/react-frontload/ @rockon404 /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 +/types/react-google-recaptcha/ @KoalaHuman @tomsturge /types/react-gravatar/ @invliD -/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway +/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway @manav-m /types/react-hamburger-menu/ @grzesie2k -/types/react-hammerjs/v0/ @jsonunger /types/react-hammerjs/ @jsonunger @cecchi -/types/react-helmet/v4/ @evanbb @isman-usoh +/types/react-hammerjs/v0/ @jsonunger +/types/react-headroom/ @zerocho /types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit +/types/react-helmet/v4/ @evanbb @isman-usoh /types/react-helmet-async/ @forabi +/types/react-highcharts/ @j1r1k /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-howler/ @maksimovicdanijel /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-crop/ @danielasy @chaaya +/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 @daggerjames +/types/react-inlinesvg/ @MyCryptoHQ @nickmccurdy /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-input-mask/v1/ @apare +/types/react-instantsearch/ @gburgett @jpowell +/types/react-instantsearch-core/ @gburgett @jpowell @davidfurlong +/types/react-instantsearch-dom/ @gburgett @jpowell +/types/react-instantsearch-native/ @gburgett @jpowell +/types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari @formatlos @lukyth @obedm503 /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 @eps1lon /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 @iplus26 @KurtPreston @phbou72 @LucianBuzzo +/types/react-json-tree/ @gnestor @zainafzal08 +/types/react-jsonschema-form/ @iamdanfox @iplus26 @phbou72 @LucianBuzzo @sthenault @sbusch +/types/react-jss/ @eps1lon @jlaw90 /types/react-lazyload/ @m0a /types/react-lazylog/ @benjaminRomano /types/react-leaflet/ @danzel @davschne @yuit +/types/react-leaflet-markercluster/ @Kimahriman /types/react-lifecycle-component/ @pixelshaded +/types/react-lifecycles-compat/ @bySabi /types/react-list/ @buptyyf @tomshen -/types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs +/types/react-loadable/ @Jessidhia @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 @efedorenko /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 @souvik-ghosh /types/react-native-android-taskdescription/ @christianchown -/types/react-native-auth0/ @ascariandrea +/types/react-native-auth0/ @ascariandrea @marknelissen /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 -/types/react-native-dialog/ @MrLuje +/types/react-native-datepicker/ @jacobbaskin @nossbigg +/types/react-native-dialog/ @MrLuje @stackbuilders @ibarrae /types/react-native-dialogflow/ @jasonmerino /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 +/types/react-native-draggable-flatlist/ @stackbuilders @ibarrae /types/react-native-drawer/ @jnbt @suniahk /types/react-native-drawer-layout/ @jmfirth /types/react-native-elevated-view/ @fhelwanger /types/react-native-fabric/ @josephroque /types/react-native-fbsdk/ @ifiokjr /types/react-native-fetch-blob/ @MNBuyskih +/types/react-native-flip-card/ @imjakechapman /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 @@ -3732,21 +4311,29 @@ /types/react-native-keychain/ @DavidFarinha /types/react-native-loading-spinner-overlay/ @fhelwanger /types/react-native-material-design-searchbar/ @iRoachie +/types/react-native-material-dropdown/ @jaydeep987 /types/react-native-material-kit/ @iRoachie @timwangdev /types/react-native-material-textfield/ @mindhivefi @iRoachie /types/react-native-material-ui/ @iRoachie /types/react-native-mauron85-background-geolocation/ @djereg /types/react-native-mixpanel/ @r3nya +/types/react-native-modal-dropdown/ @echoulen /types/react-native-modalbox/ @iRoachie /types/react-native-multi-slider/ @Slessi /types/react-native-navbar/ @ryokik /types/react-native-orientation/ @MoLow /types/react-native-permissions/ @vincentlanglet /types/react-native-photo-view/ @christianchown +/types/react-native-platform-touchable/ @tngranados /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-read-more-text/ @solkaz +/types/react-native-referrer/ @christianchown +/types/react-native-restart/ @christianchown /types/react-native-safari-view/ @mrand01 +/types/react-native-safe-area/ @pvinis +/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 +4343,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,190 +4352,221 @@ /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-native-zeroconf/ @mattapet +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @alechill @builtbyproxy @jkillian @jeroenvervaeke @chagasaway @denissb @skovhus +/types/react-navigation/v2/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @alechill @builtbyproxy @jkillian @jeroenvervaeke @chagasaway /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-material-bottom-tabs/ @iRoachie /types/react-no-ssr/ @rafalfilipek /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar /types/react-notification-system-redux/ @LKay /types/react-notify-toast/ @klaascuvelier /types/react-numeric-input/ @heatherbooker @akx +/types/react-onclickoutside/ @LKay @surgeboris /types/react-onclickoutside/v5/ @LKay -/types/react-onclickoutside/ @LKay -/types/react-onsenui/ @salim7 @jemmyw -/types/react-overlays/ @aaronbeall @vitosamson +/types/react-onsenui/ @salim7 @jemmyw @lirbank +/types/react-outside-click-handler/ @zubivan +/types/react-overlays/ @aaronbeall @vitosamson @aarondancer /types/react-owl-carousel/ @tbounsiar @igorissen @KennethanCeyer +/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke @sugarshin @SPWizard01 +/types/react-paginate/v5/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke /types/react-paginate/v4/ @deevus @wouterhardeman @pegel03 @archy-bold -/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke -/types/react-places-autocomplete/ @guilhermehubner @r3nya +/types/react-panelgroup/ @qgolsteyn +/types/react-places-autocomplete/ @guilhermehubner @r3nya @ApeNox @azizhk +/types/react-places-autocomplete/v6/ @guilhermehubner @r3nya @ApeNox @azizhk /types/react-plotly.js/ @jonfreedman +/types/react-plyr/ @baorv /types/react-pointable/ @istefo @mdibyo /types/react-popover/ @jacoporicare -/types/react-portal/v3/ @shuntksh /types/react-portal/ @shuntksh @HorusGoul +/types/react-portal/v3/ @shuntksh /types/react-primitives/ @aghoneim92 @davidpett /types/react-props-decorators/ @tkqubo /types/react-qr-reader/ @davidkevork /types/react-radio-group/ @jsonunger +/types/react-rangeslider/ @RichieRock /types/react-recaptcha/ @mhegazy @zzanol +/types/react-reconciler/ @Methuselah96 +/types/react-redux/ @tkqubo @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa @apapirovski @surgeboris @soerenbf +/types/react-redux/v6/ @tkqubo @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa @apapirovski @surgeboris /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 /types/react-redux-i18n/ @clementdevos /types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba -/types/react-relay/ @graphcool @voxmatt @alloy @npirotte @ckknight @kastermester +/types/react-relay/ @graphcool @voxmatt @alloy @npirotte @ckknight @kastermester @mattkrick /types/react-request/ @dannycochran /types/react-resize-detector/ @matthew-matvei @aMoniker @rdrgn /types/react-resolver/ @forabi -/types/react-responsive/v1/ @asvetliakov /types/react-responsive/ @asvetliakov @alechill @xaviergonz +/types/react-responsive/v1/ @asvetliakov /types/react-rnd/ @Ragg- @fsubal @zyh825 +/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/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen @gillchristian @nulladdict /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-bootstrap/ @vlesierse @LKay @olmobrutall -/types/react-router-config/ @lith-light-g @johnnyreilly +/types/react-router-config/ @lith-light-g @johnnyreilly @NullMDR /types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson @johnnyreilly /types/react-router-hash-link/ @zoompie /types/react-router-native/ @ezintz @fhelwanger /types/react-router-navigation/ @kaoDev @johnnyreilly /types/react-router-navigation-core/ @kaoDev @johnnyreilly /types/react-router-param-link/ @mtsg -/types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi -/types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas /types/react-router-redux/ @huy-nguyen @8398a7 @mykolas +/types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas +/types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi +/types/react-rte/ @jclyons52 /types/react-s-alert/ @mitsuruog /types/react-scroll/ @sudoplz @GiedriusGrabauskas /types/react-scrollbar/ @stephenjelfs -/types/react-select/v1/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur @eps1lon @endurance @RCGuillaume /types/react-select/ @claasahl @jonfreedman +/types/react-select/v1/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur @eps1lon @endurance @RCGuillaume /types/react-share/ @icopp /types/react-show-more/ @naortor /types/react-side-effect/ @remojansen @0xcaff /types/react-sidebar/ @jeroenvervaeke -/types/react-sketchapp/ @ricokahler @DomiR +/types/react-simple-maps/ @thepocp @pronebird +/types/react-sketchapp/ @ricokahler @DomiR @saschazar21 /types/react-slick/ @andrewBalekha @GiedriusGrabauskas @r3nya /types/react-slider/ @jsonunger /types/react-smooth-scrollbar/ @asvetliakov /types/react-sortable-hoc/ @NoHomey @charlesrey /types/react-sortable-pane/ @rhysd /types/react-sortable-tree/ @wouterhardeman @jzoric @kevinsperrine @acemac @dolezel +/types/react-sortable-tree-theme-file-explorer/ @dolezel /types/react-sound/ @koss-lebedev /types/react-sparklines/ @henrinormak -/types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol +/types/react-spinkit/v1/ @tkqubo @mleko @pelotom +/types/react-splitter-layout/ @snaptags +/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 +/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia @yhnavein @virzak /types/react-svg-inline/ @kiyopikko /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar /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 @Gelio /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 /types/react-tap-event-plugin/ @mxl -/types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly /types/react-test-renderer/ @arvitaly @lochbrunner @johnnyreilly @jgoz +/types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly /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 -/types/react-toggle/v2/ @LKay @jsonunger /types/react-toggle/ @LKay -/types/react-tooltip/ @DeividasBakanas +/types/react-toggle/v2/ @LKay @jsonunger +/types/react-tooltip/ @DeividasBakanas @Vijayasingam /types/react-touch/ @grzesie2k /types/react-tracking/ @alloy -/types/react-transition-group/v1/ @LKay /types/react-transition-group/ @LKay @Epskampie @ybiquitous +/types/react-transition-group/v1/ @LKay /types/react-treeview/ @janslow /types/react-truncate/ @mattvperry /types/react-twitter-auth/ @paulfasola @loginwashere +/types/react-ultimate-pagination/ @BenLorantfy /types/react-user-tour/ @ccancellieri /types/react-vertical-timeline-component/ @stephane-monnot /types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh @mgoszcz2 @brandonhall +/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @Stevearzh @mgoszcz2 @brandonhall @sbusch /types/react-virtualized-select/ @seansfkelley +/types/react-visibility-sensor/ @JRasmusBm @gcangussu /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 @tzarger /types/react-widgets-moment/ @dawnmist /types/react-window/ @martynaskadisa -/types/react-youtube/ @kgtkr +/types/react-window-size/ @jakejrichards +/types/react-wow/ @mikepthomas +/types/react-youtube/ @kgtkr @salguerooo /types/react-youtube-embed/ @charles-salmon /types/reactable/ @spielc /types/reactcss/ @chrisgervang @LKay +/types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @timc13 @patrickrgaffney @prabodht @georg94 /types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva -/types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @KurtPreston @timc13 @patrickrgaffney @prabodht /types/read/ @timjk /types/read-chunk/ @crispybee /types/read-package-tree/ @mgroenhoff /types/read-pkg/ @jdxcode /types/read-pkg-up/ @dudeofawesome @jdxcode +/types/readable-stream/ @TeamworkGuy2 /types/readdir-enhanced/ @mrmlnc /types/readdir-stream/ @Bartvds /types/readline-sync/ @jonestristand /types/readline-transform/ @dex4er /types/reapop/ @Barrokgl +/types/rebass/ @rhysd @ryee-dev @jamesmckenzie +/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/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow @crusectrl @apalugniok @RobertStigsson @kousaku-maron +/types/recharts-scale/ @johnnyreilly +/types/rechoir/ @BendingBender /types/recluster/ @dex4er -/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra +/types/recompose/ @iskandersierra @clayne11 @Pajn @lucasterra @brian-lives-outdoors @TiuSh /types/reconnect-core/ @thw0rted /types/reconnectingwebsocket/ @nguarracino -/types/recursive-readdir/v1/ @elisee +/types/recorder-js/ @higuri /types/recursive-readdir/ @elisee @MicahZoltu -/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski +/types/recursive-readdir/v1/ @elisee +/types/redent/ @BendingBender +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete @blablapolicja @ferrantejake /types/redis-errors/ @43081j /types/redis-mock/ @BendingBender -/types/redis-rate-limiter/ @westy92 +/types/redis-rate-limiter/ @westy92 @nodify-at /types/redis-scripto/ @westy92 -/types/redlock/v2/ @chrootsu /types/redlock/ @chrootsu @BendingBender +/types/redlock/v2/ @chrootsu /types/redom/ @RauliL @nemoinho -/types/reduce-reducers/ @huy-nguyen +/types/reduce-reducers/ @huy-nguyen @daliusd /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 +/types/redux-auth-wrapper/v1/ @LKay /types/redux-batched-subscribe/ @mDibyo /types/redux-debounced/ @seansfkelley /types/redux-devtools/ @mc-petry /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 @geirsagberg /types/redux-first-router-link/ @janb87 /types/redux-first-router-restore-scroll/ @icopp /types/redux-first-routing/ @tlaziuk +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun @mshaaban088 +/types/redux-form/v6/ @carsonf @aikoven @LKay @bancek @mshaaban088 /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-immutable-state-invariant/ @remojansen @highflying +/types/redux-immutable/ @oizie @sebald @gavingregory @lukyth +/types/redux-immutable/v3/ @oizie @sebald @gavingregory +/types/redux-immutable-state-invariant/ @remojansen @highflying @mihai-dinculescu /types/redux-infinite-scroll/ @silkyfray /types/redux-injectable-store/ @unindented /types/redux-localstorage/ @LKay /types/redux-localstorage-debounce/ @LKay /types/redux-localstorage-filter/ @LKay /types/redux-logger/ @arusakov @kgroat -/types/redux-mock-store/v0/ @MarianPalkus /types/redux-mock-store/ @MarianPalkus +/types/redux-mock-store/v0/ @MarianPalkus /types/redux-optimistic-ui/ @asvetliakov /types/redux-orm/ @keenondrums /types/redux-pack/ @tansongyang @quicksnap @no-stack-dub-sack @@ -3957,9 +4576,11 @@ /types/redux-promise-middleware/ @ianks /types/redux-recycle/ @LKay /types/redux-router/ @stepancar -/types/redux-saga-tester/ @BenLorantfy +/types/redux-saga-tester/ @BenLorantfy @lawsumisu +/types/redux-sentry-middleware/ @dolezel /types/redux-shortcuts/ @tstirrat /types/redux-socket.io/ @snakeego +/types/redux-state-sync/ @AOHUA @AntonioMendez /types/redux-storage/ @asvetliakov /types/redux-storage-engine-jsurl/ @screendriver /types/redux-storage-engine-localstorage/ @screendriver @@ -3974,23 +4595,29 @@ /types/ref-struct-di/ @keerthi16 @KiranNiranjan /types/ref-union/ @loyd /types/ref-union-di/ @keerthi16 @KiranNiranjan -/types/reflux/v0/ @mauricedb /types/reflux/ @mauricedb @LiangZugeng +/types/reflux/v0/ @mauricedb /types/registry-auth-token/ @mauricedb @LiangZugeng +/types/regression/ @MattiasMartens /types/relateurl/ @tkrotoff /types/relaxed-json/ @18steps /types/relay-runtime/ @voxmatt @alloy -/types/remarkable/ @makepost +/types/rellax/ @shermendev +/types/remarkable/ @makepost @chigix +/types/remote-origin-url/ @BendingBender /types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker /types/remove-markdown/ @RagibHasin /types/rename/ @Aankhen /types/replace-ext/ @DeividasBakanas +/types/replace-string/ @BendingBender +/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 /types/request-promise-native/ @gustavohenke @mastermatt +/types/request-stats/ @BendingBender /types/requestidlecallback/ @hax /types/requestretry/ @EricByers @trainerbill /types/require-dir/ @weekens @@ -3999,28 +4626,35 @@ /types/require-relative/ @MattiasBuelens /types/requirejs/ @jbaldwin /types/requirejs-domready/ @lefb766 +/types/requires-port/ @BendingBender /types/resemblejs/ @pimterry /types/reservoir/ @danvk /types/resize-img/ @higuri /types/resolve/ @marionebl @ajafff -/types/resolve-from/ @unional +/types/resolve-cwd/ @BendingBender +/types/resolve-from/ @unional @BendingBender +/types/resolve-from/v2/ @unional +/types/resolve-global/ @BendingBender +/types/resolve-pkg/ @mabels @BendingBender /types/resourcejs/ @shaunluttin -/types/response-time/ @urossmolnik @TonyPythoneer +/types/response-time/ @urossmolnik @TonyPythoneer @danmana +/types/responselike/ @BendingBender /types/rest/ @Nemo157 /types/restangular/ @borisyankov /types/restful.js/ @tkqubo -/types/restify/v4/ @blittle @stevehipwell -/types/restify/v5/ @blittle @stevehipwell @leanazulyoro /types/restify/ @blittle @stevehipwell @leanazulyoro @mgebundy +/types/restify/v5/ @blittle @stevehipwell @leanazulyoro +/types/restify/v4/ @blittle @stevehipwell /types/restify-cookies/ @weekens /types/restify-cors-middleware/ @dthunell /types/restify-errors/ @stevehipwell /types/restify-plugins/ @KostyaTretyak /types/restler/ @cyrilschumacher /types/restling/ @loghorn +/types/restore-cursor/ @BendingBender /types/resumablejs/ @DanielMcAssey /types/rethinkdb/ @alexgorbatchev @AdrianFarmadin @kondi @hoishin -/types/retry/ @krenor +/types/retry/ @krenor @BendingBender /types/retry-as-promised/ @Raigen /types/rev-hash/ @ikatyang /types/revalidate/ @alex3165 @@ -4028,8 +4662,9 @@ /types/reveal/ @robertop87 @Nava2 /types/rewire/ @borislavjivkov @CaselIT /types/rfc2047/ @mugifly +/types/rgb-hex/ @BendingBender /types/rgrove__parse-xml/ @petejohanson -/types/rheostat/ @SashaBayan @kourge +/types/rheostat/ @SashaBayan @kourge @StefanWerW /types/rickshaw/ @niemyjski /types/rimraf/ @soywiz @e-cloud @bash /types/riot/ @Stubb0rn @@ -4038,22 +4673,33 @@ /types/riot-route/ @karak /types/riotcontrol/ @chrootsu /types/riotjs/ @vvakame +/types/ripemd160/ @BendingBender /types/rison/ @impworks /types/rivets/ @TrevorDev @matjanos +/types/rmc-drawer/ @Hoff97 /types/rmfr/ @pluma +/types/rn-fetch-blob/ @pengcao1 /types/roads/ @dancespiele /types/roads-server/ @dancespiele +/types/rocksdb/ @MeirionHughes @danwbyrne /types/roll/ @icopp /types/rolling-rate-limiter/ @l-jonas +/types/rollup-plugin-commonjs/ @eoin-obrien +/types/rollup-plugin-delete/ @vladshcherbin /types/rollup-plugin-json/ @asmockler @hotell +/types/rollup-plugin-node-builtins/ @Kocal +/types/rollup-plugin-node-globals/ @kocal +/types/rollup-plugin-node-resolve/ @eoin-obrien +/types/rollup-plugin-sourcemaps/ @eoin-obrien +/types/roman-numerals/ @pluma /types/ronomon__crypto-async/ @BendingBender -/types/rosie/ @abner @subvertallchris @abukurov +/types/rosie/ @abner @subvertallchris @abukurov @adam187 /types/roslib/ @Pro @skycoop @dgorobopec /types/rot-js/ @atiaxi /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 @@ -4103,18 +4749,37 @@ /types/sanitize-filename/ @Nemo157 /types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester @WillGibson @sirMerr /types/sap__xsenv/ @mad-mike +/types/sarif/ @rscrivens +/types/sasl-anonymous/ @BendingBender +/types/sasl-digest-md5/ @BendingBender +/types/sasl-external/ @BendingBender +/types/sasl-plain/ @BendingBender +/types/sasl-scram-sha-1/ @BendingBender +/types/saslmechanisms/ @BendingBender +/types/saslprep/ @BendingBender +/types/sass/ @lenovouser @jleider /types/sass-graph/ @marvinhagemeister /types/sass-webpack-plugin/ @AepKill /types/sat/ @omni360 /types/satnav/ @DotNetNerd /types/saywhen/ @SeanSobey +/types/sc-auth/ @DanielRose +/types/sc-broker/ @DanielRose +/types/sc-broker-cluster/ @DanielRose +/types/sc-channel/ @DanielRose +/types/sc-framework-health-check/ @DanielRose +/types/sc-hot-reboot/ @DanielRose /types/scalike/ @ryoppy +/types/scc-broker-client/ @DanielRose +/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/script-ext-html-webpack-plugin/ @davecardwell /types/scriptjs/ @ssttevee /types/scroll-into-view/ @zivni /types/scroller/ @haskellcamargo @@ -4124,21 +4789,24 @@ /types/scrypt-async/ @xStrom @stesix /types/scrypt-js/ @danwbyrne /types/scryptsy/ @micksatana +/types/sdbm/ @BendingBender /types/sdp-transform/ @loc /types/seamless/ @danmana -/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg +/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg @RMHonor @pheromonez +/types/season/ @dex4er /types/secp256k1/ @anler /types/seed-random/ @l-jonas /types/seededshuffle/ @urish /types/seedrandom/ @kernhanda /types/segment-analytics/ @fongandrew -/types/select2/v3/ @borisyankov /types/select2/ @borisyankov @denisname +/types/select2/v3/ @borisyankov /types/selectables/ @renjfk /types/selectize/ @adidahiya @naBausch /types/selenium-standalone/ @SanderDeWaal1992 +/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn @oddui /types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina -/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn +/types/semantic-release/ @lgaticaq /types/semantic-ui/ @leonard-thieu /types/semantic-ui-accordion/ @leonard-thieu /types/semantic-ui-api/ @leonard-thieu @@ -4164,130 +4832,166 @@ /types/semver/ @Bartvds @BendingBender @LucianBuzzo /types/semver-compare/ @vincekovacs /types/semver-diff/ @chrismbarr +/types/semver-regex/ @BendingBender /types/semver-sort/ @LogvinovLeon +/types/semver-truncate/ @BendingBender /types/sencha_touch/ @brian428 /types/send/ @MikeJerred /types/seneca/ @psnider @kevynb +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b @Antoine38660 @smff /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-cursor-pagination/ @pilagod /types/sequelize-fixtures/ @cschwarz /types/sequencify/ @npenin /types/sequester/ @Strate /types/serialize-error/ @thomasthiebaud -/types/serialize-javascript/ @lith-light-g -/types/serialport/v4/ @codefoster +/types/serialize-javascript/ @lith-light-g @Pochodaydayup /types/serialport/ @codefoster @apearson +/types/serialport/v6/ @codefoster @apearson +/types/serialport/v4/ @codefoster /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-cookie-parser/ @nickp10 @ilyaztsv /types/set-value/ @DanielRosenwasser +/types/setasap/ @djcsdy /types/settings/ @shreyjain1994 +/types/sha/ @oBusk +/types/sha.js/ @BendingBender /types/sha1/ @arcdev1 +/types/sha256/ @nhardy /types/shallow-equals/ @rsolomon -/types/shallowequal/ @seansfkelley +/types/shallowequal/ @seansfkelley @BendingBender +/types/shallowequal/v0/ @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 @JamieWoodbury +/types/shasum/ @TeamworkGuy2 +/types/shebang-command/ @BendingBender +/types/shebang-regex/ @BendingBender /types/sheetify/ @toddself /types/shell-escape/ @nenadalm -/types/shell-quote/ @jason0x43 -/types/shelljs/ @nikeee @voy @gkalpak @pheromonez +/types/shell-quote/ @jason0x43 @CameronDiver +/types/shelljs/ @nikeee @voy @gkalpak @pheromonez @aldafu /types/shelljs-exec-proxy/ @qlonik /types/shimmer/ @kjin /types/shipit/ @cyrilschumacher /types/shipit-utils/ @cyrilschumacher /types/shopify-buy/ @openminder @straiforos @totemika +/types/shorten-repo-url/ @BendingBender /types/shortid/ @stpettersens @despairblue -/types/shot/ @AJamesPhillips +/types/shot/ @AJamesPhillips @SimonSchick +/types/shot/v3/ @AJamesPhillips @SimonSchick /types/should-sinon/ @Arylo -/types/showdown/ @cbowdon @tan9 @arielsaldana +/types/showdown/ @hamedbaatour @cbowdon @tan9 @arielsaldana +/types/shpjs/ @littlebtc /types/shrink-ray/ @forabi +/types/shuffle-seed/ @LeartS /types/siema/ @Irmiz @0x6368656174 @samnau /types/siesta/ @bquarmby /types/sigmajs/ @qinfchen /types/sigmund/ @BendingBender +/types/signal-exit/ @BendingBender /types/signale/ @resir014 @kingdaro @rjoydip /types/signalr/ @borisyankov @keesey @GiedriusGrabauskas /types/signalr-no-jquery/ @gjoshevski /types/signals/ @diullei /types/signature_pad/ @AbubakerB @jrmihalick @leejaedus +/types/simpl-schema/ @arichter83 @Qkramer @deskoh /types/simple-assign/ @NoHomey /types/simple-cw-node/ @vvakame /types/simple-lru/ @NN--- /types/simple-mock/ @leonyu +/types/simple-oauth2/ @mad-mike @troy-lamerton @netux @LinusU /types/simple-oauth2/v1/ @mad-mike @troy-lamerton @netux -/types/simple-oauth2/ @mad-mike @troy-lamerton @netux /types/simple-peer/ @tlaziuk /types/simple-url-cache/ @a-lucas /types/simple-websocket/ @dex4er /types/simple-xml/ @notVitaliy -/types/simplebar/v1/ @gregonnet @leonard-thieu /types/simplebar/ @gregonnet @leonard-thieu +/types/simplebar/v1/ @gregonnet @leonard-thieu /types/simplemde/ @Scalesoft /types/simplesmtp/ @rogierschouten /types/simplestorage.js/ @axelcostaspena @mxl +/types/sindresorhus__class-names/ @BendingBender +/types/sindresorhus__df/ @whatknight +/types/sindresorhus__djb2a/ @BendingBender +/types/sindresorhus__fnv1a/ @BendingBender +/types/sindresorhus__slugify/ @cprecioso +/types/sindresorhus__string-hash/ @BendingBender +/types/sindresorhus__to-milliseconds/ @BendingBender /types/single-line-log/ @ffflorian -/types/single-spa-react/ @Garrett-Smith-iq -/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg +/types/single-spa-react/ @Garrett-Smith-iq @chrisdopuch +/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski @johnjesse @alecf @SimonSchick /types/sinon-as-promised/ @igrayson -/types/sinon-chai/v2/ @kazimanzurrashid @jedmao /types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt +/types/sinon-chai/v2/ @kazimanzurrashid @jedmao /types/sinon-chrome/ @pimterry @crimx @kobanyan /types/sinon-express-mock/ @jpchip @tlaziuk /types/sinon-mongoose/ @stevehipwell /types/sinon-stub-promise/ @vintem @tstackhouse /types/sinon-test/ @mummybot -/types/sip.js/ @decyrus /types/sipml/ @chookies /types/sitemap2/ @shundy /types/six-runtime/ @493636333 /types/sizzle/ @leonard-thieu /types/sjcl/ @Evgenus /types/skatejs/ @Hotell +/types/sketchapp/ @manekinekko /types/ski/ @AyaMorisawa -/types/skyway/ @nakakura +/types/skin-tone/ @BendingBender +/types/skyway/ @nakakura @izmhr /types/slack-mock/ @kkalavantavanich /types/slack-node/ @geoffreak /types/slack-winston/ @BlueHatbRit /types/slackdown/ @nju33 /types/slackify-html/ @hypexr -/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil @isubasti +/types/slash/ @BendingBender +/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 @Kornil /types/sleep/ @rajarz +/types/slice-ansi/ @dwieeb /types/slickgrid/ @jbaldwin /types/slideout/ @ToastHawaii /types/slimerjs/ @alexwall /types/slocket/ @BendingBender /types/slug/ @mhegazy /types/smart-fox-server/ @ChanceM +/types/smart-truncate/ @oyalhi +/types/smooth-scroll/ @andreiho /types/smoothscroll-polyfill/ @kryops -/types/smtp-server/v1/ @markisme @Taisiias /types/smtp-server/ @markisme @Taisiias @dex4er +/types/smtp-server/v1/ @markisme @Taisiias /types/smtpapi/ @a-morales +/types/snakecase-keys/ @BendingBender /types/snappy/ @reconbot -/types/snapsvg/ @lhk @mattanja @kant2002 +/types/snapsvg/ @lhk @mattanja @kant2002 @terrymun /types/snazzy-info-window/ @milosd92 /types/snekfetch/ @ANekoIsFineToo @ShayBox @Dev-Yukine -/types/snoowrap/ @vitosamson @TheAppleFreak +/types/snoowrap/ @vitosamson @TheAppleFreak @willwull +/types/snowball-stemmers/ @ryanvolum /types/snowboy/ @dolanmiu /types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro +/types/socket.io/v1/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro /types/socket.io-client/ @progre @divillysausages @florentpoujol /types/socket.io-p2p/ @saenglert /types/socket.io-parser/ @plantain-00 /types/socket.io-redis/ @nupplaphil @seeLuck /types/socket.io.users/ @kataras +/types/socketcluster/ @DanielRose +/types/socketcluster-client/ @DanielRose +/types/socketcluster-server/ @DanielRose /types/socketio-jwt/ @ehallander9591 /types/socketio-jwt-auth/ @codeanimal /types/socketio-wildcard/ @BendingBender @@ -4297,8 +5001,10 @@ /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/sort-object-keys/ @forivall +/types/sortablejs/ @Maw-Fox @maartenstaa /types/soundmanager2/ @elton2048 /types/soupbintcp/ @jewbre /types/source-list-map/ @e-cloud @@ -4306,16 +5012,17 @@ /types/space-pen/ @vvakame /types/spark-md5/ @bastienmoulia /types/sparkly/ @BendingBender -/types/sparkpost/v1/ @geoffreak /types/sparkpost/ @geoffreak @bondz @vvu +/types/sparkpost/v1/ @geoffreak /types/sparqljs/ @AlexeyMz +/types/sparse-bitfield/ @BendingBender /types/spatialite/ @atd-schubert /types/spdx-correct/ @jinwoo /types/spdx-satisfies/ @jinwoo /types/spdy/ @tony19 /types/speakeasy/ @legendecas @mrOlorin @xeoneux /types/speakingurl/ @Goldsmith42 -/types/spectacle/ @zmaybury +/types/spected/ @benneq /types/spectrum/ @M-Zuber @Ailrun /types/split/ @marcinporebski /types/split.js/ @icholy @@ -4325,17 +5032,19 @@ /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-template/ @q42jaap /types/sql.js/ @Hozuki /types/sqlanywhere/ @pkeuter /types/sqlite3/ @nmalaguti @dpyro @BehindTheMath /types/sqlstring/ @marvinhagemeister /types/squirejs/ @bradleyayers +/types/srcset/ @BendingBender /types/srp/ @Patman64 /types/ssh-key-decrypt/ @BendingBender -/types/ssh2/ @tkQubo @rbuckton -/types/ssh2-sftp-client/ @igrayson @ascariandrea @kartik2406 +/types/ssh2/ @tkQubo @rbuckton @wrboyce @lucasmotta +/types/ssh2-sftp-client/ @igrayson @ascariandrea @kartik2406 @viamuli /types/ssh2-streams/ @rbuckton /types/sshpk/ @mabels /types/stack-mapper/ @rogierschouten @@ -4343,9 +5052,11 @@ /types/stack-utils/ @BendingBender /types/stacktrace-js/ @exceptionless @pilagod /types/stale-lru-cache/ @cxcorp -/types/stampit/v2/ @koresar /types/stampit/ @koresar @lummish +/types/stampit/v2/ @koresar /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,27 +5069,34 @@ /types/steam-totp/ @phenomax /types/steamid/ @Slessi /types/steed/ @Paul-Isache -/types/stellar-sdk/ @carl-foster @tristonj @pselden @maxbause +/types/stellar-base/ @carl-foster @tristonj @pselden @maxbause @charlie-wasp @Akuukis +/types/stellar-sdk/ @carl-foster @tristonj @pselden @maxbause @charlie-wasp @Akuukis /types/stemmer/ @will-ockmore /types/sticky-cluster/ @paustint +/types/stompit/ @DanielRose /types/stompjs/ @jimic @Dr4k4n -/types/stoppable/ @EricByers -/types/store/ @vbortone @harry0000 @Ky6uk +/types/stoppable/ @EricByers @jplusje +/types/storage-helper/ @ajafff +/types/store/ @vbortone @harry0000 @Ky6uk @igl00 /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 +/types/storybook__addon-backgrounds/ @hyunseob @adhrinae /types/storybook__addon-centered/ @kiyopikko /types/storybook__addon-info/ @mkornblum @fyrkant /types/storybook__addon-jest/ @halfmatthalfcat -/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay +/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay @MLoughry /types/storybook__addon-links/ @joscha @jessepinho -/types/storybook__addon-notes/ @joscha @amacleay -/types/storybook__addon-options/ @joscha @simonhn @amacleay +/types/storybook__addon-notes/ @joscha @amacleay @MLoughry +/types/storybook__addon-options/ @joscha @simonhn @amacleay @gaetanmaisse @adam187 /types/storybook__addon-storyshots/ @bradleyayers -/types/storybook__react/ @joscha @wapgear -/types/storybook__react-native/ @joscha @wapgear @alechill @iRoachie +/types/storybook__addon-viewport/ @Vinnl +/types/storybook__react/ @joscha @wapgear @dandean +/types/storybook__react-native/ @joscha @wapgear @alechill @iRoachie @ceyhuno /types/storybook__vue/ @pntgupta +/types/strange/ @wanganjun +/types/stream-array/ @Tyler-Murphy /types/stream-buffers/ @Jason3S /types/stream-chain/ @uhop /types/stream-csv-as-json/ @uhop @@ -4388,52 +5106,67 @@ /types/stream-series/ @k-kagurazaka /types/stream-shift/ @djcsdy /types/stream-throttle/ @danwbyrne -/types/stream-to-array/v0/ @Bartvds /types/stream-to-array/ @Bartvds @BendingBender +/types/stream-to-array/v0/ @Bartvds /types/stream-to-promise/ @Alorel +/types/stream-to-string/ @BendingBender /types/streaming-json-stringify/ @BendingBender /types/streamjs/ @erosb /types/streamtest/ @lummish /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-similarity/ @ragtime +/types/string-length/ @BendingBender +/types/string-replace-webpack-plugin/ @pd4d10 +/types/string-similarity/ @ragtime @BendingBender +/types/string-similarity/v1/ @ragtime /types/string-template/ @TonyPythoneer /types/string-width/ @jacobbubu /types/string_score/ @marcinporebski +/types/stringify-attributes/ @BendingBender /types/stringify-object/ @khoomeister /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy +/types/strip-color/ @BendingBender +/types/strip-indent/ @BendingBender /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 @SimonSchick @yultyyev @cpsoinos /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/stripejs/ @RobinvanTienhoven +/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @slangeder +/types/stripejs/ @RobinvanTienhoven @mattferderer /types/strong-cluster-control/ @shuntksh /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/ @Igorbek @Igmat @lavoaster @Jessidhia +/types/styled-components/v3/ @Igorbek @Igmat /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 @adam187 @gretzky +/types/styled-theming/ @ArjanJ +/types/stylelint/ @alan-agius4 @filipsalpe /types/stylelint/v7/ @alan-agius4 -/types/stylelint/ @alan-agius4 /types/stylelint-webpack-plugin/ @bahlo +/types/stylenames/ @bengry /types/stylus/ @SomaticIT /types/subscribe-ui-event/ @wangcheng678 /types/subsume/ @BendingBender +/types/subsume/v1/ @BendingBender +/types/subtitle/ @jenglamlow /types/succinct/ @EnableSoftware /types/sudo-block/ @BendingBender /types/suitescript/ @darrenhillconsulting /types/summernote/ @wstaelens @nusantara-cloud /types/sumo-logger/ @forabi @clementallen /types/suncalc/ @horiuchi +/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @beeequeue @lukaselmer /types/superagent/v2/ @varju @NicoZelaya @mxl -/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @beeequeue /types/superagent-bunyan/ @bricka /types/superagent-no-cache/ @mxl /types/superagent-prefix/ @mxl @@ -4441,8 +5174,8 @@ /types/superstruct/ @edwardsnare /types/supertest/ @varju @pietu /types/supertest-as-promised/ @tkrotoff -/types/supports-color/v3/ @mgroenhoff /types/supports-color/ @mgroenhoff @mtraynham +/types/supports-color/v3/ @mgroenhoff /types/svg-injector/ @poke /types/svg-parser/ @mrmlnc /types/svg-path-bounding-box/ @NotWoods @@ -4457,7 +5190,7 @@ /types/sw-precache/ @JounQin /types/sw-precache-webpack-plugin/ @JounQin /types/swag/ @shiwano -/types/swagger-express-middleware/ @alexandreroba +/types/swagger-express-middleware/ @alexandreroba @tromgy /types/swagger-express-mw/ @micmro /types/swagger-express-validator/ @pinguet62 /types/swagger-hapi/ @micmro @@ -4466,7 +5199,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 @@ -4477,63 +5210,84 @@ /types/swig/ @CodeAnimal @soywiz /types/swig-email-templates/ @mrhen @micksatana /types/swipe/ @kant2002 +/types/swiper/ @sgaliano @lucax88x @ematseruk @odahcam @jmca @daem0ndev /types/swiper/v3/ @sgaliano @lucax88x -/types/swiper/ @sgaliano @lucax88x @ematseruk @odahcam /types/swipeview/ @borisyankov /types/switchery/ @bgrieder @claylaut /types/swiz/ @jedigo /types/sylvester/ @StephaneAlie +/types/symlink-or-copy/ @BendingBender /types/synaptic/ @ToastHawaii @austincummings +/types/syntax-error/ @TeamworkGuy2 /types/systeminformation/ @PixelcrabAT /types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad +/types/tabbable/ @mokkan /types/table/ @evanshortiss @mrmlnc /types/tableau/ @protip +/types/tableify/ @forivall /types/tabris-plugin-firebase/ @eclipsesource -/types/tabtab/ @vojtechhabarta +/types/tabtab/ @vojtechhabarta @kamontat /types/tabulator/ @euginio /types/tail/ @spacejack -/types/tapable/v0/ @e-cloud /types/tapable/ @e-cloud @johnnyreilly -/types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty +/types/tapable/v0/ @e-cloud +/types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty @rostrowski /types/tar/ @SomaticIT @connor4312 /types/tar-fs/ @Umoxfo /types/tar-stream/ @glicht /types/task-graph-runner/ @mgroenhoff +/types/task-worklet/ @karol-majewski /types/tcp-ping/ @stegano +/types/tcp-port-used/ @gautejohan /types/teddy/ @lannonbr /types/tedious/ @rogierschouten @cjthompson @v-suhame /types/tedious-connection-pool/ @sandorfr /types/telebot/ @mariotsi /types/temp/ @DanielRosenwasser +/types/temp-dir/ @BendingBender /types/temp-write/ @BendingBender /types/tempfile/ @SamVerschueren @BendingBender -/types/tempy/ @douglasduteil +/types/tempy/ @douglasduteil @maistho +/types/term-size/ @BendingBender +/types/terminal-image/ @BendingBender +/types/terminal-kit/ @katsanva +/types/terminal-link/ @BendingBender /types/terminal-menu/ @aravindarun +/types/tern/ @nkappler +/types/terser/ @JordiAnderl +/types/terser-webpack-plugin/ @Danscho +/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-clipper/ @krzysztof-grzybek +/types/text-encoding/ @pine @mohsen1 @nwmqpa /types/text-encoding-utf-8/ @trxcllnt /types/text-table/ @saadq /types/textarea-caret/ @shiftkey +/types/textextensions/ @BendingBender /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 @KonstantinLukaschenko @danyim +/types/three-tds-loader/ @KonstantinLukaschenko @sschoensee /types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher @tatethurston /types/throttle/ @BendingBender /types/throttle-debounce/ @czbuchi @franklixuefei /types/through/ @AndrewGaspar -/types/through2/v0/ @Bartvds @jedmao /types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 @Alorel +/types/through2/v0/ @Bartvds @jedmao /types/through2-concurrent/ @Alorel /types/through2-map/ @LucasHill +/types/tildify/ @BendingBender /types/tile-reduce/ @DenisCarriere /types/tilebelt/ @DenisCarriere /types/time-span/ @BendingBender @mdvorscak @@ -4541,10 +5295,13 @@ /types/timelinejs3/ @MikeMatusz /types/timer-machine/ @dolanmiu /types/timezone-js/ @bonnici +/types/timing-safe-equal/ @BendingBender +/types/timsort/ @Vunovati /types/tinajs__tina/ @Jimexist /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 @@ -4559,73 +5316,88 @@ /types/to-absolute-glob/ @ajafff /types/to-camel-case/ @j-f1 /types/to-markdown/ @SuperPaintman +/types/to-semver/ @BendingBender /types/to-snake-case/ @LogvinovLeon /types/to-title-case-gouch/ @stpettersens /types/toastr/ @borisyankov /types/tocktimer/ @evanshortiss /types/tokgen/ @l-jonas -/types/toobusy-js/ @atd-schubert +/types/toobusy-js/ @atd-schubert @BendingBender /types/tooltipster/ @stephenlautier @pjmagee @VorobeY1326 @leonard-thieu @janhi @joeskeen +/types/topo/ @BendingBender /types/topojson/ @ricardo-mello @chenzhutian @denisname /types/topojson-client/ @denisname @ricardo-mello /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 /types/tough-cookie/ @leonard-thieu @LiJinyao @no2chem /types/tough-cookie-filestore/ @friedow /types/traceback/ @misak113 -/types/tracking/ @pimterry +/types/tracking/ @pimterry @bratter /types/transducers-js/ @colinkahn @dphilipson @NaridaL /types/transducers.js/ @dphilipson /types/transliteration/ @tony19 -/types/trash/ @matthew-matvei @hoishin +/types/trash/ @matthew-matvei @hoishin @BendingBender /types/traverse/ @newclear /types/traverson/ @marcinporebski /types/travis-fold/ @andy-ms /types/trayballoon/ @korve +/types/treeify/ @mike-north /types/tress/ @sindilevich +/types/trezor-connect/ @federicobond +/types/trianglify/ @unindented +/types/trie-prefix-tree/ @jlismore /types/trim/ @skysteve /types/triple-beam/ @danwbyrne /types/triplesec/ @threesquared /types/trunk8/ @niemyjski +/types/trusted-types/ @vrana /types/tryer/ @bengry +/types/ts-nameof/ @dsherret /types/tspromise/ @soywiz /types/ttf2woff2/ @ThomasdenH /types/tunnel/ @BendingBender -/types/tus-js-client/ @kevhiggins +/types/tus-js-client/ @kevhiggins @Acconut /types/tv4/ @Bartvds @psnider /types/tween.js/ @Amos47 @sunetos @jzarnikov @alexburner /types/tweenjs/ @evilangelist @jcyuan /types/tweezer.js/ @praxxis -/types/twig/ @soywiz @enko +/types/twig/ @soywiz @enko @mtizziani /types/twilio/ @nickiannone @ashleybrener +/types/twilio-common/ @gatimus /types/twilio-video/ @minddocdev @darioblanco /types/twit/ @Volox @sapphiredev @abraham @siwalikm @plhery /types/twitch-ext/ @beheh -/types/twitter/ @chitoku-k +/types/twitter/ @BendingBender +/types/twitter-for-web/ @chitoku-k /types/twitter-stream-channels/ @adrianbardan /types/twitter-text/ @rhysd /types/twix/ @j3ko +/types/two.js/ @cprecioso /types/type-check/ @hansrwindhoff -/types/type-detect/v0/ @Bartvds /types/type-detect/ @Bartvds +/types/type-detect/v0/ @Bartvds /types/type-is/ @BendingBender /types/type-name/ @armorik83 /types/typeahead/ @igochkov @gjunge /types/typedarray-pool/ @pawsong /types/typeof/ @OpenByteDev /types/typescript-deferred/ @DirtyHairy -/types/typography/ @boyeborg +/types/typography/ @boyeborg @krzysztofzuraw @dominicfallows +/types/typpy/ @BendingBender /types/tz-format/ @samverschueren /types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo +/types/ua-string/ @BendingBender /types/uglify-es/ @alan-agius4 -/types/uglify-js/v2/ @tkrotoff /types/uglify-js/ @alan-agius4 @tkrotoff @johnnyreilly +/types/uglify-js/v2/ @tkrotoff /types/uglifycss/ @blendsdk /types/uglifyjs-webpack-plugin/ @vajkayrene +/types/ui-box/ @nettofarah /types/ui-grid/ @btesser @joeskeen @pbojanczyk /types/ui-router-extras/ @mputters @marcel-k @LaserUnicorns /types/ui-select/ @nkovacic @@ -4636,6 +5408,7 @@ /types/umbraco/ @DeCareSystemsIreland /types/umd/ @TeamworkGuy2 /types/umzug/ @drinchev @mlamp @trodi @emmanuelgautier +/types/unc-path-regex/ @BendingBender /types/underscore/ @borisyankov @jbaldwin @ccurrens @clottman @confususs /types/underscore-ko/ @MagicMau /types/underscore.string/ @rygine @@ -4646,40 +5419,46 @@ /types/uniqid/ @idchlife /types/unique-hash-stream/ @BendingBender /types/unique-random/ @Kuniwak -/types/unist/ @bizen241 +/types/unique-random-array/ @BendingBender +/types/unique-string/ @BendingBender +/types/unist/ @bizen241 @lujun2 @hrajchert @wooorm @rokt33r +/types/unist-util-is/ @rokt33r /types/unity-webapi/ @jmvrbanac /types/universal-analytics/ @Bartvds @DarkerTV /types/universal-cookie/ @tomi -/types/universal-router/ @jtmthf @tlaziuk @Lodin /types/unorm/ @chbrown /types/untildify/ @BendingBender /types/unused-filename/ @BendingBender /types/unzip/ @coding2012 /types/unzipper/ @s73obrien @natemara @bartje321 +/types/update-notifier/ @vvakame @nchen63 @bitjson @grinich /types/update-notifier/v1/ @vvakame @nchen63 -/types/update-notifier/ @vvakame @nchen63 @bitjson /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 /types/urijs/ @RodneyJT @xt0rted @petejohanson /types/uritemplate/ @teyc @rubensworks +/types/urix/ @BendingBender /types/url-assembler/ @wolfgang42 -/types/url-join/ @rogierschouten @devrelm +/types/url-join/ @rogierschouten @devrelm @BendingBender +/types/url-join/v0/ @rogierschouten @devrelm /types/url-metadata/ @mrkmg /types/url-params/ @danielsogl -/types/url-parse/ @ChernenkoPaul @harisiva @DimitryDushkin +/types/url-parse/ @ChernenkoPaul @harisiva @DimitryDushkin @davidgoli /types/url-regex/ @unindented @sosukesuzuki /types/url-safe-base64/ @johngeorgewright /types/url-search-params/ @nick121212 @nrathi /types/url-template/ @marcinporebski +/types/urlencode/ @kimcoder /types/urllib/ @sorayama /types/urlparser/ @OpenByteDev /types/urlrouter/ @soywiz /types/urlsafe-base64/ @tkrotoff /types/usage/ @pvomhoff /types/usb/ @underscorebrody @thegecko +/types/user-event/ @whtsky /types/user-home/ @mhegazy /types/useragent/ @geoffreak /types/username/ @kayahr @krivachy @@ -4692,7 +5471,10 @@ /types/uuid-js/ @mhegazy /types/uuid-parse/ @screendriver /types/uuid-validate/ @HiromiShikata +/types/uuidv4/ @Hinaser /types/uws/ @plantain-00 @orblazer +/types/v-chart-plugin/ @natemara +/types/v8flags/ @BendingBender /types/valdr/ @ilbertz /types/valdr-message/ @ilbertz /types/valerie/ @conficient @@ -4700,24 +5482,25 @@ /types/valiant/ @whatasoda /types/valid-url/ @stevehipwell /types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya @qqilihq -/types/validatorjs/ @LKay @danmana +/types/validatorjs/ @LKay @danmana @MatiasOlivera /types/vanilla-modal/ @samnau /types/vanilla-tilt/ @BrunnerLivio /types/varint/ @dbrockman /types/vary/ @BendingBender -/types/vast-client/ @jgainfort +/types/vast-client/ @jgainfort @kobawan /types/vec3/ @xstoudi /types/vectorious/ @erikgerrits -/types/vega/ @pelotom /types/velocity-animate/ @smrq +/types/venn/ @marcwjj /types/verror/ @svi3c @max4t /types/vertx3-eventbus-client/ @oddeirik /types/vex-js/ @gdcohan /types/vexdb/ @MayorMonty /types/vexflow/ @rquiring @sebastianhaas @bohoffi @sschmidTU /types/vfile/ @bizen241 @rokt33r -/types/vfile-location/ @ikatyang -/types/victory/ @asvetliakov @snerks @Havret @alredyExist +/types/vfile-location/ @ikatyang @rokt33r +/types/vfile-message/ @rokt33r +/types/victory/ @asvetliakov @snerks @Havret @alredyExist @jlismore /types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray @AkxeOne @meikidd /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 @@ -4725,16 +5508,18 @@ /types/viewporter/ @borisyankov /types/vimeo/ @DazWilkin /types/vimeo__player/ @denisyilmaz @timc13 @terrymun -/types/vinyl/v0/ @jedmao /types/vinyl/ @vvakame @jedmao @thorn0 +/types/vinyl/v0/ @jedmao /types/vinyl-buffer/ @tkQubo -/types/vinyl-fs/ @vvakame @remisery +/types/vinyl-fs/ @vvakame @remisery @TeamworkGuy2 +/types/vinyl-fs/v1/ @vvakame @remisery +/types/vinyl-fs/v0/ @vvakame @remisery /types/vinyl-paths/ @tkQubo /types/virtual-dom/ @chbrown /types/virtual-keyboard/ @bsurai -/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura @dcop @avrahamcool -/types/vision/v4/ @jasonswearingen @AJamesPhillips +/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura @dcop @avrahamcool @divideby /types/vision/ @jasonswearingen @AJamesPhillips @lenovouser +/types/vision/v4/ @jasonswearingen @AJamesPhillips /types/vitalsigns/ @cyrilschumacher /types/vivus/ @DanielRosenwasser @lekhmanrus /types/vkbeautify/ @sch3lp @@ -4751,16 +5536,21 @@ /types/vue-scrollto/ @vincekovacs /types/vue-select/ @silh /types/vue2-datepicker/ @ChristianStornowski -/types/vuex-i18n/ @jaeggerr @noamkfir +/types/vuelidate/ @janesser @jubairsaidi +/types/vuex-i18n/ @jaeggerr @noamkfir @barahliush /types/w2ui/ @Ptival +/types/w3c-css-typed-object-model-level-1/ @yavanosta /types/w3c-generic-sensor/ @kenchris /types/w3c-image-capture/ @cosium /types/w3c-permissions/ @jberube /types/w3c-screen-orientation/ @kenchris /types/w3c-web-usb/ @larsgk +/types/wait-for-localhost/ @BendingBender /types/waitme/ @totpero /types/wake_on_lan/ @SrTobi +/types/walk/ @poppa /types/wallabyjs/ @andrewconnell +/types/wallop/ @leemcd56 /types/wallpaper/ @BendingBender /types/wampy/ @KSDaemon /types/warning/ @cvle @@ -4769,38 +5559,40 @@ /types/watchpack/ @e-cloud /types/waterline/ @arvitaly /types/watson-developer-cloud/ @waldo000000 @Naktibalda +/types/wavesurfer.js/ @higuri /types/waypoints/ @dominikbulaj @Koloto @evil-shrike +/types/wcag-contrast/ @plantain-00 /types/wcwidth/ @rokt33r /types/weak/ @int0h -/types/weapp-api/ @vargeek +/types/weapp-api/ @vargeek @pbestz /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/web-resource-inliner/ @BendingBender +/types/web3/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino @zlumer @archangel-irk @sogasg @donamk @dkent600 @nerddan @alexkvak /types/web3-eth-abi/ @LogvinovLeon /types/web3-provider-engine/ @LogvinovLeon /types/webappsec-credential-management/ @iainmcgin -/types/webassembly-js-api/ @periklis +/types/webassembly-js-api/ @periklis @chicoxyzzy /types/webassembly-web-api/ @jhenninger /types/webcl/ @NCARalph /types/webcomponents.js/ @adidahiya /types/webcrypto/ @iislucas -/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @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/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein @grgur +/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @christophehurpeau @rwaskiewicz @kuehlein /types/webpack-assets-manifest/ @FranklinWhale /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 /types/webpack-chunk-hash/ @mtraynham /types/webpack-cleanup-plugin/ @malj /types/webpack-config-utils/ @hotell -/types/webpack-dev-middleware/v1/ @bumbleblym @reduckted /types/webpack-dev-middleware/ @bumbleblym @reduckted @chrisabrams +/types/webpack-dev-middleware/v1/ @bumbleblym @reduckted /types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 @arturovt /types/webpack-dotenv-plugin/ @kryops /types/webpack-env/ @use-strict @rhonsby @@ -4808,17 +5600,19 @@ /types/webpack-hot-client/ @rynclark @ZSkycat /types/webpack-hot-middleware/ @bumbleblym @icylace @chrisabrams /types/webpack-manifest-plugin/ @r3nya -/types/webpack-merge/v0/ @deevus /types/webpack-merge/ @deevus @mtraynham +/types/webpack-merge/v0/ @deevus /types/webpack-node-externals/ @mtraynham /types/webpack-notifier/ @bumbleblym -/types/webpack-serve/v1/ @rynclark @Jokcy @ZSkycat /types/webpack-serve/ @rynclark @Jokcy @ZSkycat +/types/webpack-serve/v1/ @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 @@ -4840,39 +5634,45 @@ /types/whatwg-url/ @aomarks /types/wheel/ @BTOdell /types/when/ @derekcicerone @Nemo157 +/types/when-dom-ready/ @BendingBender /types/which/ @vvakame @cspotcode /types/which-pm/ @jorgegonzalez +/types/whitelist-object/ @BendingBender /types/wicg-mediasession/ @jucrouzet /types/wif/ @danwbyrne /types/wiiu/ @mzsm +/types/wikidata-sdk/ @kamontat /types/window-or-global/ @vvakame /types/window-size/ @pmkary /types/windows-1251/ @RomanGolovanov /types/windows-script-host/ @zspitz /types/windows-service/ @rogierschouten -/types/winjs/v1/ @adamhewitt627 @craigktreasure @xirzec -/types/winjs/v2/ @adamhewitt627 @craigktreasure @xirzec /types/winjs/ @adamhewitt627 @craigktreasure @xirzec +/types/winjs/v2/ @adamhewitt627 @craigktreasure @xirzec +/types/winjs/v1/ @adamhewitt627 @craigktreasure @xirzec /types/wink-tokenizer/ @lal12 /types/winreg/ @RX14 @BobBuehler /types/winrt-uwp/ @saschanaz @taylor224 /types/winston-dynamodb/ @nickiannone /types/winston-mail/ @idono87 -/types/winston-syslog/v1/ @cjbarth /types/winston-syslog/ @cjbarth @felix-hoc +/types/winston-syslog/v1/ @cjbarth /types/wiring-pi/ @NoHomey /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 +/types/workbox-webpack-plugin/ @kgroat +/types/worker-threads-pool/ @BendingBender /types/workerpool/ @Alorel /types/wpapi/ @guoyunhe -/types/wrap-ansi/v2/ @kayahr /types/wrap-ansi/ @kayahr -/types/wreck/v7/ @marcinporebski +/types/wrap-ansi/v2/ @kayahr /types/wreck/ @marcinporebski @saboya +/types/wreck/v7/ @marcinporebski /types/wrench/ @soywiz /types/write-file-atomic/ @BendingBender /types/write-file-atomically/ @Aankhen @@ -4895,42 +5695,49 @@ /types/xmldoc/ @Xstoudi @ajsheehan @notlaforge /types/xmldom/ @tkqubo /types/xmlpoke/ @garthk +/types/xmlserializer/ @eoin-obrien /types/xmltojson/ @traviscrowe -/types/xmpp__jid/ @PJakcson +/types/xmpp__jid/ @PJakcson @BendingBender +/types/xmpp__xml/ @BendingBender /types/xregexp/ @Bartvds @jfahrenkrug @sigo -/types/xrm/v7/ @daryllabar -/types/xrm/v8/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @mariusagur /types/xrm/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @scottdurow +/types/xrm/v8/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @mariusagur +/types/xrm/v7/ @daryllabar /types/xsd-schema-validator/ @Goldsmith42 /types/xsockets/ @pushplay -/types/xxhashjs/ @mDibyo +/types/xxhashjs/ @mDibyo @Manc /types/yallist/ @BendingBender -/types/yandex-maps/ @Delagen +/types/yaml/ @ikatyang @ColinBradley +/types/yandex-maps/ @Delagen @gastwork13 /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/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC @steffenvv /types/yargs/v11/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC -/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney /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/year-days/ @BendingBender +/types/yeoman-assert/ @Toilal +/types/yeoman-generator/ @armorik83 @janslow @ikatyang @tasadar2 /types/yeoman-test/ @ikatyang /types/yesql/ @Sumolari +/types/yn/ @BendingBender /types/yoctodelay/ @seangenabe /types/yog-bigpipe/ @ssddi456 /types/yog-log/ @ssddi456 /types/yog2-kernel/ @ssddi456 /types/yoga-layout/ @tnobody /types/yosay/ @armorik83 -/types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 @terrymun -/types/youtube-dl/ @bsurai +/types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 @terrymun @paulhobbel +/types/youtube-dl/ @bsurai @moshfeu /types/yui/ @giabao -/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola +/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola @YashdalfTheGray @vincentjames501 @robertbullen @sat0yu @dancrumb /types/z-schema/ @pgonzal /types/zapier-platform-core/ @bradleyayers /types/zeit__next-typescript/ @icopp @@ -4938,11 +5745,12 @@ /types/zen-push/ @daprahamian /types/zenscroll/ @HamedFathi /types/zepto/ @jbaldwin -/types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu /types/zeroclipboard/ @ejsmith @niemyjski @balassy @leonyu +/types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu /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 @@ -4952,5 +5760,6 @@ /types/zmq/ @davemckeown /types/zookeeper/ @xialeistudio /types/zopflipng-bin/ @hikoma +/types/zrender/ @iRON5 /types/zui/ @yuanxu /types/zxcvbn/ @mtraynham 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/README.md b/README.md index 9a31d73da1..bbf2a6f16e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,23 @@ -# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) - -[![Join the chat at https://gitter.im/borisyankov/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +# DefinitelyTyped > The repository for *high quality* TypeScript type definitions. Also see the [definitelytyped.org](http://definitelytyped.org) website, although information in this README is more up-to-date. -*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) and [Korean!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md)* +*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md), [Korean](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md), and [Russian](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ru.md)!* + +## Current status + +This section tracks the health of the repository and publishing process. +It may be helpful for contributors experiencing any issues with their PRs and packages. + +* All packages are type-checking/linting cleanly: [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) +* All packages are being published to npm in under 10,000 seconds: [![Publish Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.types-publisher-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) +* [typescript-bot](https://github.com/typescript-bot) has been active on DefinitelyTyped [![Activity Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.typescript-bot-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) + +If anything here seems wrong, or any of the above are failing, please raise an issue in [the DefinitelyTyped Gitter channel](https://gitter.im/DefinitelyTyped/DefinitelyTyped). + +[![Join the chat at https://gitter.im/DefinitelyTyped/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/DefinitelyTyped/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ## What are declaration files? @@ -169,8 +180,14 @@ If a package was never on DefinitelyTyped, it does not need to be added to `notN #### Lint -To lint a package, just add a `tslint.json` to that package containing `{ "extends": "dtslint/dt.json" }`. All new packages must be linted. -If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example: +All new packages must be linted. To lint a package, add a `tslint.json` to that package containing +```js +{ + "extends": "dtslint/dt.json" +} +``` + +This should be the only content in a finished project's `tslint.json` file. If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example: ```js { @@ -238,17 +255,71 @@ Here are the [currently requested definitions](https://github.com/DefinitelyType If types are part of a web standard, they should be contributed to [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) so that they can become part of the default `lib.dom.d.ts`. +#### Should I add an empty namespace to a package that doesn't export a module to use ES6 style imports? + +Some packages, like [chai-http](https://github.com/chaijs/chai-http), export a function. + +Importing this module with an ES6 style import in the form `import * as foo from "foo";` leads to the error: + +> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct + +This error can be suppressed by merging the function declaration with an empty namespace of the same name, but this practice is discouraged. +This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) regarding this matter. + +It is more appropriate to import the module using the `import foo = require("foo");` syntax. +Nevertheless, if you want to use a default import like `import foo from "foo";` you have two options: +- you can use the [`--allowSyntheticDefaultImports` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#support-for-default-import-interop-with-systemjs) if your module runtime supports an interop scheme for non-ECMAScript modules, i.e. if default imports work in your environment (e.g. Webpack, SystemJS, esm). +- you can use the [`--esModuleInterop` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop) if you want TypeScript to take care of non-ECMAScript interop (since Typescript 2.7). + #### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`? -If you are using TypeScript 2.7 or later, use `--esModuleInterop` in your project. -Otherwise, if default imports work in your environment (e.g. Webpack, SystemJS, esm), consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option. +Like in the previous question, refer to using either the [`--allowSyntheticDefaultImports`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#support-for-default-import-interop-with-systemjs) +or [`--esModuleInterop`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop) +compiler options. + Do not change the type definition if it is accurate. -For an NPM package, `export =` is accurate if `node -p 'require("foo")'` is the export, and `export default` is accurate if `node -p 'require("foo").default'` is the export. +For an NPM package, `export =` is accurate if `node -p 'require("foo")'` works to import a module, and `export default` is accurate if `node -p 'require("foo").default'` works to import a module. #### I want to use features from TypeScript 2.1 or above. Then you will have to add a comment to the last line of your definition header (after `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`. +#### I want to use features from TypeScript 3.1 or above. + +You can use the same `// TypeScript Version: 3.1` comment as above. +However, if your project needs to maintain types that are compatible with 3.1 and above *at the same time as* types that are compatible with 3.0 or below, you will need to use the `typesVersions` feature, which is available in TypeScript 3.1 and above. +You can find a detailed explanation of this feature in the [official TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#version-selection-with-typesversions). + +Here's a short explanation to get you started: + +1. You'll have to add a `package.json` file to your package definition, with the following contents: + +```json +{ + "private": true, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { "*": ["ts3.1/*"] } + } +} +``` + +2. Create the sub-directory mentioned in the `typesVersions` field inside your types directory (`ts3.1/` in this example) +and add the types and tests specific for the new TypeScript version. You don't need the typical definition header +in any of the files from the `ts3.1/` directory. + +3. Set the `baseUrl` and `typeRoots` options in `ts3.1/tsconfig.json` to the correct paths, they should look something like this: +```json +{ + "compilerOptions": { + "baseUrl": "../../", + "typeRoots": ["../../"] + } +} +``` + +You can look [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/debounce-promise) and [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/create-html-element) for examples. + #### I want to add a DOM API not present in TypeScript by default. This may belong in [TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme). See the guidelines there. @@ -316,19 +387,6 @@ When `dts-gen` is used to scaffold a scoped package, the `paths` property has to GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) file history for renamed files. Use [`git log --follow`](https://www.git-scm.com/docs/git-log) instead. -#### Should I add an empty namespace to a package that doesn't export a module to use ES6 style imports? - -Some packages, like [chai-http](https://github.com/chaijs/chai-http), export a function. - -Importing this module with an ES6 style import in the form `import * as foo from "foo";` leads to the error: - -> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct - -This error can be suppressed by merging the function declaration with an empty namespace of the same name, but this practice is discouraged. -This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) regarding this matter. - -It is more appropriate to import the module using the `import foo = require("foo");` syntax, or to use a default import like `import foo from "foo";` if using the `--allowSyntheticDefaultImports` flag if your module runtime supports an interop scheme for non-ECMAScript modules as such. - ## License This project is licensed under the MIT license. diff --git a/README.ru.md b/README.ru.md new file mode 100644 index 0000000000..9186c2ddd5 --- /dev/null +++ b/README.ru.md @@ -0,0 +1,353 @@ + + +# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) + +[![Join the chat at https://gitter.im/borisyankov/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +> Репозиторий для *высококачественных* определений типов TypeScript. + +Также посетите веб-сайт [definitelytyped.org](http://definitelytyped.org), хотя информация в этом README более свежая. + +*Вы также можете прочитать этот README на [английском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md), [испанском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) и [корейском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md).* + +## Что такое файлы декларации (файлы описания/объявления типов)? + +Смотрите [руководство по TypeScript](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). + +## Как их получить? + +### npm + +Это предпочтительный метод. Это доступно только для пользователей TypeScript 2.0+. Например: + +```sh +npm install --save-dev @types/node +``` + +Затем типы должны автоматически включаться компилятором. +Подробнее смотрите в [справочнике](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). + +Для пакета NPM "foo", описания будут находиться в "@types/foo". +Если вы не можете найти свой пакет, ищите его в [TypeSearch](https://microsoft.github.io/TypeSearch/). + +Если вы все еще не можете найти его, проверьте [включает](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) ли пакет собственную типизацию. +Обычно это отражается в поле `"types"` или `"typings"` файла `package.json`, или просто ищите любые файлы ".d.ts" в пакете и вручную включайте их в `/// `. + + +### Другие методы + +Эти методы могут быть использованы TypeScript 1.0. + +* [Typings](https://github.com/typings/typings) +* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped)~~ (используйте предпочтительные альтернативы, публикация типа nuget DT отключена) +* Вручную загрузите из ветки `master` этого репозитория + +Возможно, вам придется добавить ручные [ссылки](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). + + +## Как я могу внести свой вклад? + +DefinitelyTyped работает только благодаря вкладу таких пользователей, как вы! + +### Тестирование + +Прежде чем поделиться своим улучшением с миром, используйте его сами. + +#### Тестирование редактирования существующего пакета + +Для добавления новых функций вы можете использовать [разрешение модулей](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation). +Вы также можете напрямую редактировать типы в `node_modules/@types/foo/index.d.ts`, или скопировать их оттуда и выполнить следующие шаги. + + +#### Тестирование ногово пакета + +Добавьте к вашему `tsconfig.json`: + +```json +"baseUrl": "types", +"typeRoots": ["types"], +``` + +(Вы также можете использовать `src/types`.) +Создайте `types/foo/index.d.ts` содержащие объявления для модуля "foo". +Теперь вы сможете импортировать из `"foo"` в свой код, и он будет направлен к новому определению типа. +Затем запустите сборку (build) *и* запустите код, чтобы убедиться, что ваше определение типа действительно соответствует тому, что происходит во время выполнения. +После того как вы проверили свои определения с реальным кодом, создайте [Запрос на принятие изменений (PR)](#make-a-pull-request) +и следуйте инструкциям [чтобы отредактировать существующий](#edit-an-existing-package) или +[создать новый пакет](#create-a-new-package). + + +### Запрос на принятие изменений (PR) + +После того, как вы проверили ваш пакет, вы можете поделиться им с DefinitelyTyped. + +Во-первых, [разветвите](https://guides.github.com/activities/forking/) этот репозиторий, установите [node](https://nodejs.org/), и запустите `npm install`. + + +#### Изменение существующего пакета + +* `cd types/my-package-to-edit` +* Внесите изменения. Не забудьте отредактировать тесты. + Если вы вносите критические изменения, не забудьте [обновить основную версию](#i-want-to-update-a-package-to-a-new-major-version). +* Вы также можете добавить себя в раздел "Definitions by" заголовка пакета. + * Это приведет к тому, что вы будете уведомлены (через ваше имя пользователя GitHub) о том, что кто-то делает запрос на принятие изменений (PR) или проблему с пакетом. + * Сделайте это, добавив свое имя в конец строки, например `// Definitions by: Alice , Bob `. + * Или, если есть больше людей, это может быть многострочным + + ```typescript + // Definitions by: Alice + // Bob + // Steve + // John + ``` + +* Если есть `tslint.json`, запустите `npm run lint package-name`. В противном случае запустите `tsc` в директории пакета. + +Когда вы создаете PR для редактирования существующего пакета, `dt-bot` должен @-уведомить +предыдущих авторов. Если этого не произойдет, вы можете сделать это самостоятельно в комментарии, связанном с PR. + + +#### Созданое нового пакета + +Если вы являетесь автором библиотеки и ваш пакет написан на TypeScript, [свяжите автоматически сгенерированные файлы объявлений](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) в вашем пакете, а не публикуйте в DefinitelyTyped. + +Если вы добавляете типизацию для пакета NPM, создайте директорию с тем же именем. +Если пакет, для которого вы добавляете типизацию, отсутствует в NPM, убедитесь, что выбранное вами имя не конфликтует с именем пакета в NPM. +(Вы можете использовать `npm info foo` чтобы проверить наличие пакета `foo`.) + +Ваш пакет должен иметь такую ​​структуру: + +| Файл | Назначение | +| ------------- | ---------------------------------------------------------------------------------------------------- | +| index.d.ts | Содержит типизацию для пакета. | +| foo-tests.ts | Содержит пример кода, который проверяет типизацию. Этот код *не* запускается, но он проверен на тип. | +| tsconfig.json | Позволяет вам запускать `tsc` внутри пакета. | +| tslint.json | Включает linting. | + +Создайте их, запустив `npx dts-gen --dt --name my-package-name --template module` если у вас npm ≥ 5.2.0, `npm install -g dts-gen` и `dts-gen --dt --name my-package-name --template module` в противном случае. +Посмотреть все варианты на [dts-gen](https://github.com/Microsoft/dts-gen). + +Вы можете отредактировать `tsconfig.json` чтобы добавить новые файлы, добавить `"target": "es6"` (необходимо для асинхронных функций), добавить в `"lib"`, или добавить опцию компилятора `"jsx"`. + +Члены группы DefinitelyTyped регулярно следят за новыми PR, но имейте в виду, что количество других PR может замедлить ход событий. + +Хороший пример пакета смотрите [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). + + +#### Распространенные ошибки + +* Сначала следуйте советам из справочника [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html). +* Форматирование: либо используйте все табы, либо всегда используйте 4 пробела. +* `function sum(nums: number[]): number`: используйте `ReadonlyArray` если функция не записывает свои параметры. +* `interface Foo { new(): Foo; }`: + Это определяет тип объектов, с методом `new`. Вы, вероятно, хотите объявить `declare class Foo { constructor(); }`. +* `const Class: { new(): IClass; }`: + Предпочитайте использовать объявление класса `class Class { constructor(); }` вместо `new`. +* `getMeAT(): T`: + Если параметр типа не отображается в типах каких-либо параметров, у вас нет универсальной функции, а просто замаскированное утверждение типа. + Предпочитайте использовать утверждение реального типа, например, `getMeAT() as number`. + Пример, где допустим параметр типа: `function id(value: T): T;`. + Пример, где это недопустимо: `function parseJson(json: string): T;`. + Исключение: `new Map()` все ОК. +* Использование типов `Function` and `Object` почти никогда не является хорошей идеей. В 99% случаев можно указать более конкретный тип. Примеры: `(x: number) => number` для [функций](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) and `{ x: number, y: number }` для объектов. Если нет никакой уверенности в типе, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) является правильным выбором, а не `Object`. Если единственным известным фактом о типе является то, что это какой-то объект, используйте тип [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), а не `Object` или `{ [key: string]: any }`. +* `var foo: string | any`: + когда `any` используется в типе объединения, результирующий тип все еще `any`. Таким образом, хотя `string` часть аннотации этого типа может _выглядеть_ полезной, на самом деле она не предлагает никакой дополнительной проверки типов по сравнению с простым использованием `any`. + В зависимости от намерения, приемлемыми альтернативами могут быть `any`, `string`, или `string | object`. + + +#### Удаление пакета + +Когда пакет [объединяет](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) свои собственные типы, типы должны быть удалены из DefinitelyTyped чтобы избежать путаницы. + +Вы можете удалить его, запустив `npm run not-needed -- typingsPackageName asOfVersion sourceRepoURL [libraryName]`. + +* `typingsPackageName`: название директории, который нужно удалить. +* `asOfVersion`: заглушка будет опубликована в `@types/foo` с этой версией. Должна быть выше, чем любая опубликованная на данный момент версия +* `sourceRepoURL`: Это должно указывать на репозиторий, который содержит типизации. +* `libraryName`: описательное имя библиотеки, например, "Angular 2" вместо "angular2". (Если опущено, будет идентично "typingsPackageName".) + +Любые другие пакеты в DefinitelyTyped которые ссылаются на удаленный пакет, должны быть обновлены для ссылки на связанные типы. Для этого добавьте в `package.json` ссыклу `"dependencies": { "foo": "x.y.z" }`. + +Если пакет никогда не был в DefinitelyTyped, его не нужно добавлять в `notNeededPackages.json`. + + +#### Lint + +Все новые пакеты должны быть проанализированы lint. Для этого добавьте `tslint.json` в этот пакет, содержащий + +```js +{ + "extends": "dtslint/dt.json" +} +``` + +Это должно быть единственным содержимым в файле `tslint.json` готового проекта. Если `tslint.json` отключает правила, это потому, что это еще не исправлено. Например: + +```js +{ + "extends": "dtslint/dt.json", + "rules": { + // This package uses the Function type, and it will take effort to fix. + "ban-types": false + } +} +``` + +(Чтобы указать, что правило lint действительно не применяется, используйте `// tslint:disable rule-name` или лучше, `//tslint:disable-next-line rule-name`.) + +Чтобы проверить, что выражение имеет заданный тип, используйте `$ExpectType`. Чтобы проверить, что выражение вызывает ошибку компиляции, используйте `$ExpectError`. + +```js +// $ExpectType void +f(1); + +// $ExpectError +f("one"); +``` + +Для получения дополнительной информации см. [dtslint](https://github.com/Microsoft/dtslint#write-tests) readme. + +Протестируйте, запустив `npm run lint package-name` где `package-name` - это имя вашего пакета. +Этот скрипт использует [dtslint](https://github.com/Microsoft/dtslint). + + +## Часто задаваемые вопросы + +#### Какая связь между этим репозиторием и пакетами `@types` в NPM? + +Ветвь `master` автоматически публикуется в область `@types` на NPM благодаря [types-publisher](https://github.com/Microsoft/types-publisher). + +#### Я отправил PR. Когда он сольется? + +Это зависит, но большинство запросов на получение данных будут объединены в течение недели. PR, утвержденные автором, указанным в заголовке определения, обычно объединяются быстрее; PR для новых определений займет больше времени, так как они требуют большего количества проверок от сопровождающих. Каждый PR проверяется членом команды TypeScript или DefinitelyTyped перед объединением, поэтому будьте терпеливы, так как человеческий фактор может вызвать задержки. Посмотрите на [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) чтобы увидеть, как сопровождающие работают через открытые PR. + +#### Мой PR слит; когда будет обновлен пакет `@types` NPM? + +Пакеты NPM должны обновиться в течение нескольких часов. Если прошло более 24 часов, пингуйте @RyanCavanaugh и @andy-ms в PR, чтобы расследовать. + +#### Я пишу определение, которое зависит от другого определения. Должен ли я использовать `` или import? + +Если модуль, на который вы ссылаетесь, является внешним модулем (использует `export`), используйте import. +Если модуль, на который вы ссылаетесь, является окружающим модулем (использует `declare module`, или просто объявляет глобальные переменные), используйте ``. + +#### Я заметил, что у некоторых пакетов есть `package.json`. + +Обычно вам это не нужно. При публикации пакета мы обычно автоматически создаем `package.json`. +`package.json` может быть включен для определения зависимостей. Вот [пример](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json). +Мы не разрешаем определять другие поля, такие как "description", вручную. +Кроме того, если вам нужно сослаться на более старую версию типизаций, вы должны сделать это, добавив в `package.json` строки `"dependencies": { "@types/foo": "x.y.z" }`. + +#### В некоторых пакетах отсутствует `tslint.json`, а в некоторых `tsconfig.json` отсутствует `"noImplicitAny": true`, `"noImplicitThis": true`, или `"strictNullChecks": true`. + +Тогда они не правы. Вы можете помочь, отправив PR, чтобы исправить их. + +#### Могу ли я запросить определение? + +Вот [текущие запрошенные определения](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest). + +#### Как насчет определений типов для DOM? + +Если типы являются частью веб-стандарта, они должны быть добавлены в [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) чтобы они могли стать частью `lib.dom.d.ts` по умолчанию. + +#### Пакет использует export `export =`, но я предпочитаю использовать импорт по умолчанию. Могу ли я изменить `export =` на `export default`? + +Если вы используете TypeScript 2.7 или более позднюю версию, используйте `--esModuleInterop` в вашем проекте. +В противном случае, если импорт по умолчанию работает в вашей среде (например, Webpack, SystemJS, esm), рассмотрите возможность включения опции компилятора [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html). +Не меняйте определение типа, если оно точное. +Для пакета NPM, `export =` является точным, если `node -p 'require("foo")'` является экспортом, а `export default` является точным, если `node -p 'require("foo").default'` является экспортом. + +#### Я хочу использовать функции из TypeScript 2.1 или выше. + +В таком случае вам нужно будет добавить комментарий к последней строке заголовка вашего определения (после `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`. + +#### Я хочу добавить DOM API, отсутствующий в TypeScript по умолчанию. + +Это может принадлежать [TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme). Смотрите инструкции там. +Если стандарт все еще является черновиком, добавляйте сюда. +Используйте имя, начинающееся с `dom-` и включите ссылку на стандарт в качестве ссылки "Project" в заголовке. +Когда он завершает черновой режим, мы можем удалить его из DefinitelyTyped и объявить устаревшим связанный пакет `@types`. + +#### Я хочу обновить пакет новой старшей версии + +Если вы намерены продолжить обновление старой версии пакета, вы можете создать новую подпапку с текущей версией, например, `v2` и скопируйте в него существующие файлы. Если это так, вам необходимо: + +1. Обновите относительные пути в `tsconfig.json` а также в `tslint.json`. +2. Добавьте правила сопоставления путей, чтобы убедиться, что тесты выполняются для предполагаемой версии. + +Например [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) looks like: + +```json +{ + "compilerOptions": { + "baseUrl": "../../", + "typeRoots": ["../../"], + "paths": { + "history": [ "history/v2" ] + } + }, + "files": [ + "index.d.ts", + "history-tests.ts" + ] +} +``` + +Если в DefinitelyTyped есть другие пакеты, несовместимые с новой версией, вам нужно будет добавить сопоставления путей к старой версии. Вам также нужно будет сделать это для пакетов в зависимости от пакетов в зависимости от старой версии. + +Например, `react-router` зависит от `history@2`, поэтому [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) есть сопоставление пути с `"history": [ "history/v2" ]`; +транзитивно `react-router-bootstrap` (который зависит от `react-router`) также добавляет отображение пути в свой [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json). + +Также, `/// ` не будет работать с отображением пути, поэтому зависимости должны использовать `import`. + +#### Как мне написать определения для пакетов, которые могут использоваться и глобально и в качестве модуля? + +Руководство TypeScript содержит отличную [общую информацию о написании определений](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html), а также [этот пример файла определения](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html) , в котором показано, как создать определение с использованием синтаксиса модуля в стиле ES6, а также указаны объекты, доступные для глобальной области. Этот метод демонстрируется практически в определении для [definition for big.js](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts), библиотекой, которую можно загружать глобально с помощью тега скрипта на веб-странице или импортировать с помощью импорта по требованию или в стиле ES6. + +Чтобы проверить, как ваше определение может использоваться как при глобальных ссылках, так и в качестве импортированного модуля, создайте тестовую папку `test`, и поместите туда два тестовых файла. Назовите один `YourLibraryName-global.test.ts` а другой `YourLibraryName-module.test.ts`. *Глобальный* тестовый файл должен использовать определение в соответствии с тем, как он будет использоваться в скрипте, загруженном на веб-страницу, где библиотека доступна в глобальной области видимости - в этом сценарии не следует указывать оператор импорта. Тестовый файл *модуля* должен использовать определение в соответствии с тем, как оно будет использоваться при импорте (включая оператор(ы) `import`). Если вы указали свойство `files` в файле `tsconfig.json`, обязательно включите оба тестовых файла. [Практический пример этого](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) также доступен в определении big.js. + +Обратите внимание, что не требуется полностью использовать определение в каждом тестовом файле - достаточно протестировать только глобально доступные элементы в глобальном тестовом файле и полностью выполнить определение в тестовом файле модуля, или наоборот. + +#### А как насчет областных пакетов? + +Типы для пакета с областью `@foo/bar` должны указываться в `types/foo__bar`. Обратите внимание на двойное подчеркивание. + +Когда `dts-gen` используется для компоновки пакета с областью действия, свойство `paths` должно быть вручную адаптировано в сгенерированном файле +`tsconfig.json` для правильной ссылки на пакет с областью действия: + +```json +{ + "paths":{ + "@foo/bar": ["foo__bar"] + } +} +``` + + +#### История файлов в GitHub выглядит неполной. + +GitHub не [поддерживает](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) историю файлов для переименованных файлов. Вместо этого используйте [`git log --follow`](https://www.git-scm.com/docs/git-log). + +#### Должен ли я добавить пустой namespace в пакет, который не экспортирует модуль для использования импорта в стиле ES6? + +Некоторые пакеты, такие как [chai-http](https://github.com/chaijs/chai-http), экспортируют функцию. + +Импорт этого модуля с импортом в стиле ES6 в форме `import * as foo from "foo";` приводит к ошибке: + +> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct + +Эту ошибку можно устранить, объединив объявление функции с пустым namespace'ом с тем же именем, но это не рекомендуется. +Это часто цитируемый [ответ с Stack Overflow](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) по этому вопросу. + +Более целесообразно импортировать модуль, используя `import foo = require("foo");` синтаксис или использовать импорт по умолчанию, такой как `import foo from "foo";` при использовании флага `--allowSyntheticDefaultImports`, если среда выполнения вашего модуля поддерживает схему взаимодействия для модулей не-ECMAScript как таковых. + +## Лицензия + +Этот проект лицензирован по лицензии MIT. + +Авторские права на файлы определений принадлежат каждому участнику, указанному в начале каждого файла определения. + +[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) + +[![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.types-publisher-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) В среднем пакеты публикуются на npm менее чем за 10000 секунд? + +[![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.typescript-bot-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) Был ли typescript-bot активным на DefinitelyTyped в последние два часа? diff --git a/notNeededPackages.json b/notNeededPackages.json index 968192123b..2a645f9c93 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", @@ -618,6 +636,18 @@ "sourceRepoURL": "https://github.com/mikedeboer/node-github", "asOfVersion": "7.1.0" }, + { + "libraryName": "gitlab", + "typingsPackageName": "gitlab", + "sourceRepoURL": "https://github.com/jdalrymple/node-gitlab", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "Google Cloud Storage", + "typingsPackageName": "google-cloud__storage", + "sourceRepoURL": "https://github.com/googleapis/nodejs-storage", + "asOfVersion": "2.3.0" + }, { "libraryName": "graphene-pk11", "typingsPackageName": "graphene-pk11", @@ -654,6 +684,12 @@ "sourceRepoURL": "https://handsontable.com/", "asOfVersion": "0.35.0" }, + { + "libraryName": "hibp", + "typingsPackageName": "hibp", + "sourceRepoURL": "https://github.com/wKovacs64/hibp", + "asOfVersion": "7.3.0" + }, { "libraryName": "homeworks", "typingsPackageName": "homeworks", @@ -924,12 +960,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 +1014,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", @@ -1014,6 +1068,12 @@ "sourceRepoURL": "https://github.com/paularmstrong/normalizr", "asOfVersion": "2.0.18" }, + { + "libraryName": "Nuka Carousel", + "typingsPackageName": "nuka-carousel", + "sourceRepoURL": "https://github.com/FormidableLabs/nuka-carousel/", + "asOfVersion": "4.4.6" + }, { "libraryName": "Numbro", "typingsPackageName": "numbro", @@ -1194,6 +1254,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", @@ -1428,6 +1494,12 @@ "sourceRepoURL": "https://github.com/zeh/simplesignal", "asOfVersion": "1.0.0" }, + { + "libraryName": "sip.js", + "typingsPackageName": "sip.js", + "sourceRepoURL": "https://github.com/onsip/SIP.js", + "asOfVersion": "0.12.0" + }, { "libraryName": "smooth-scrollbar", "typingsPackageName": "smooth-scrollbar", @@ -1458,6 +1530,12 @@ "sourceRepoURL": "https://github.com/mozilla/source-map", "asOfVersion": "0.5.7" }, + { + "libraryName": "Spectacle", + "typingsPackageName": "spectacle", + "sourceRepoURL": "http://github.com/FormidableLabs/spectacle/", + "asOfVersion": "5.2.3" + }, { "libraryName": "Spin.js", "typingsPackageName": "spin.js", @@ -1584,6 +1662,12 @@ "sourceRepoURL": "https://github.com/dpa99c/phonegap-launch-navigator", "asOfVersion": "4.0.0" }, + { + "libraryName": "Universal Router", + "typingsPackageName": "universal-router", + "sourceRepoURL": "https://github.com/kriasoft/universal-router", + "asOfVersion": "8.0.0" + }, { "libraryName": "upper-case", "typingsPackageName": "upper-case", @@ -1608,6 +1692,12 @@ "sourceRepoURL": "https://github.com/ansman/validate.js", "asOfVersion": "0.11.0" }, + { + "libraryName": "vega", + "typingsPackageName": "vega", + "sourceRepoURL": "https://github.com/vega/vega", + "asOfVersion": "3.2.0" + }, { "libraryName": "vso-node-api", "typingsPackageName": "vso-node-api", @@ -1638,6 +1728,12 @@ "sourceRepoURL": "https://github.com/tgdwyer/WebCola", "asOfVersion": "3.2.0" }, + { + "libraryName": "WebdriverIO", + "typingsPackageName": "webdriverio", + "sourceRepoURL": "git@github.com:webdriverio/webdriverio.git", + "asOfVersion": "5.0.0" + }, { "libraryName": "webgme", "typingsPackageName": "webgme", diff --git a/package.json b/package.json index 09fe064d48..7fc0358f27 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ }, "devDependencies": { "dtslint": "github:Microsoft/dtslint#production", - "types-publisher": "Microsoft/types-publisher#production" - } + "types-publisher": "github:Microsoft/types-publisher#production" + }, + "dependencies": {} } 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/nuka-carousel/tsconfig.json b/types/a11y-dialog/tsconfig.json similarity index 93% rename from types/nuka-carousel/tsconfig.json rename to types/a11y-dialog/tsconfig.json index 240c9965c5..a27d99d6bf 100644 --- a/types/nuka-carousel/tsconfig.json +++ b/types/a11y-dialog/tsconfig.json @@ -20,6 +20,6 @@ }, "files": [ "index.d.ts", - "nuka-carousel-tests.tsx" + "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/accept-language-parser/accept-language-parser-tests.ts b/types/accept-language-parser/accept-language-parser-tests.ts index 586a31cb93..6f308b5315 100644 --- a/types/accept-language-parser/accept-language-parser-tests.ts +++ b/types/accept-language-parser/accept-language-parser-tests.ts @@ -20,11 +20,17 @@ const l3: AcceptLanguageParser.Language = { quality: 0.9 }; +type Lang = "en-US" | "ko-KR"; +const enUs: Lang = "en-US"; +const koKr: Lang = "ko-KR"; + const parsed1: AcceptLanguageParser.Language[] = AcceptLanguageParser.parse(''); const pick1: string | null = AcceptLanguageParser.pick([''], ''); const pick2: string | null = AcceptLanguageParser.pick([''], [l1, l2, l3]); const pick3: string | null = AcceptLanguageParser.pick([''], '', {}); const pick4: string | null = AcceptLanguageParser.pick([''], '', { loose: true }); +const pick5: Lang | null = AcceptLanguageParser.pick([enUs, koKr], [l1, l2, l3]); +const pick6: Lang | null = AcceptLanguageParser.pick([enUs, koKr], [l1, l2, l3]); const pickOptions: AcceptLanguageParser.PickOptions = { loose: true diff --git a/types/accept-language-parser/index.d.ts b/types/accept-language-parser/index.d.ts index c47969c940..4bec11b89c 100644 --- a/types/accept-language-parser/index.d.ts +++ b/types/accept-language-parser/index.d.ts @@ -1,17 +1,18 @@ // Type definitions for accept-language-parser 1.5 // Project: https://github.com/opentable/accept-language-parser // Definitions by: Niklas Wulf +// Wooram Jun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -// https://github.com/opentable/accept-language-parser/blob/v1.4.1/index.js +// https://github.com/opentable/accept-language-parser/blob/v1.5.0/index.js export function parse(acceptLanguage: string): Language[]; -export function pick( - supportedLanguages: string[], +export function pick( + supportedLanguages: T[], acceptLanguage: string | Language[], options?: PickOptions -): string | null; +): T | null; export interface Language { code: string; diff --git a/types/accept/accept-tests.ts b/types/accept/accept-tests.ts new file mode 100644 index 0000000000..659d05c174 --- /dev/null +++ b/types/accept/accept-tests.ts @@ -0,0 +1,31 @@ +import * as accept from 'accept'; + +accept.charsets("iso-8859-5, unicode-1-1;q=0.8"); // charset === "iso-8859-5" +accept.charset("iso-8859-5, unicode-1-1;q=0.8", ["unicode-1-1"]); // charset === "unicode-1-1" + +accept.encoding("gzip, deflate, sdch"); // encoding === "gzip" +accept.encoding("gzip, deflate, sdch", ["deflate", "identity"]); + +const encodings = accept.encodings("compress;q=0.5, gzip;q=1.0"); // encodings === ["gzip", "compress", "identity"] +encodings.lastIndexOf(''); + +accept.language("en;q=0.7, en-GB;q=0.8"); +accept.language("en;q=0.7, en-GB;q=0.8", ["en-gb"]); // language === "en-GB" +const languages = accept.languages("da, en;q=0.7, en-GB;q=0.8"); // languages === ["da", "en-GB", "en"] +languages.lastIndexOf(''); + +accept.mediaType("text/plain, application/json;q=0.5, text/html, */*;q=0.1"); +accept.mediaType("text/plain, application/json;q=0.5, text/html, */*;q=0.1", ["application/json", "text/html"]); +const mediaTypes = accept.mediaTypes("text/plain, application/json;q=0.5, text/html, */*;q=0.1"); +// mediaTypes === ["text/plain", "text/html", "application/json", "*/*"] +mediaTypes.lastIndexOf(''); +const headers = { + accept: 'text/plain, application/json;q=0.5, text/html, */*;q=0.1', + 'accept-language': 'da, en;q=0.7, en-GB;q=0.8' +}; + +const all = accept.parseAll(headers); +all.charsets.length; +all.encodings.length; +all.languages.length; +all.mediaTypes.length; diff --git a/types/accept/index.d.ts b/types/accept/index.d.ts new file mode 100644 index 0000000000..886193a01e --- /dev/null +++ b/types/accept/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for accept 3.1 +// Project: https://github.com/hapijs/accept#readme +// Definitions by: feinoujc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export function charset(charsetHeader?: string, preferences?: string[]): string; +export function charsets(charsetHeader?: string): string[]; +export function encoding(encodingHeader?: string, preferences?: string[]): string; +export function encodings(encodingHeader?: string): string[]; +export function language(languageHeader?: string, preferences?: string[]): string; +export function languages(languageHeader?: string): string[]; +export function mediaType(mediaTypeHeader?: string, preferences?: string[]): string; +export function mediaTypes(mediaTypeHeader?: string): string[]; +export function parseAll( + headers: Record +): { + charsets: string[]; + encodings: string[]; + languages: string[]; + mediaTypes: string[]; +}; diff --git a/types/gitlab/tsconfig.json b/types/accept/tsconfig.json similarity index 94% rename from types/gitlab/tsconfig.json rename to types/accept/tsconfig.json index f1297faf67..cb192697d5 100644 --- a/types/gitlab/tsconfig.json +++ b/types/accept/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "gitlab-tests.ts" + "accept-tests.ts" ] } diff --git a/types/babel__parser/tslint.json b/types/accept/tslint.json similarity index 100% rename from types/babel__parser/tslint.json rename to types/accept/tslint.json diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index 7faa5da4f8..2588539c0c 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -549,6 +549,16 @@ declare namespace AceAjax { getFoldsInRange(range: Range): any; highlight(text: string): void; + + + /** + * Highlight lines from `startRow` to `EndRow`. + * @param startRow Define the start line of the highlight + * @param endRow Define the end line of the highlight + * @param clazz Set the CSS class for the marker + * @param inFront Set to `true` to establish a front marker + **/ + highlightLines(startRow:number, endRow: number, clazz: string, inFront: boolean): Range; /** * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. @@ -1223,7 +1233,7 @@ declare namespace AceAjax { /** * Returns `true` if the current `textInput` is in focus. **/ - isFocused(): void; + isFocused(): boolean; /** * Blurs the current `textInput`. diff --git a/types/acorn/index.d.ts b/types/acorn/index.d.ts index 5d02bd716c..e6a9291d1c 100644 --- a/types/acorn/index.d.ts +++ b/types/acorn/index.d.ts @@ -246,9 +246,7 @@ declare namespace acorn { let LooseParser: ILooseParserClass | undefined; let pluginsLoose: PluginsObject | undefined; - interface ILooseParserClass { - new (input: string, options?: Options): ILooseParser; - } + type ILooseParserClass = new (input: string, options?: Options) => ILooseParser; interface ILooseParser {} diff --git a/types/active-win/active-win-tests.ts b/types/active-win/active-win-tests.ts new file mode 100644 index 0000000000..034b03d85a --- /dev/null +++ b/types/active-win/active-win-tests.ts @@ -0,0 +1,17 @@ +import activeWin = require('active-win'); + +// $ExpectType Promise +activeWin(); +// $ExpectType Result +activeWin.sync(); + +let win = { + title: 'Unicorns - Google Search', + id: 5762, + owner: { + name: 'Google Chrome', + processId: 310, + }, +}; + +win = activeWin.sync(); diff --git a/types/active-win/index.d.ts b/types/active-win/index.d.ts new file mode 100644 index 0000000000..7ab1f1e123 --- /dev/null +++ b/types/active-win/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for active-win 4.0 +// Project: https://github.com/sindresorhus/active-win#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = activeWin; + +declare function activeWin(): Promise; + +declare namespace activeWin { + function sync(): Result; + + interface Result { + title: string; + id: number; + bounds?: { + x: number; + y: number; + width: number; + height: number; + }; + owner: { + name: string; + processId: number; + bundleId?: number; + path?: string; + }; + memoryUsage?: number; + } +} diff --git a/types/active-win/tsconfig.json b/types/active-win/tsconfig.json new file mode 100644 index 0000000000..fc292756af --- /dev/null +++ b/types/active-win/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", + "active-win-tests.ts" + ] +} diff --git a/types/deepmerge/tslint.json b/types/active-win/tslint.json similarity index 100% rename from types/deepmerge/tslint.json rename to types/active-win/tslint.json diff --git a/types/activestorage/activestorage-tests.ts b/types/activestorage/activestorage-tests.ts new file mode 100644 index 0000000000..ac9622e2d8 --- /dev/null +++ b/types/activestorage/activestorage-tests.ts @@ -0,0 +1,28 @@ +import * as ActiveStorage from 'activestorage'; + +ActiveStorage.start(); + +const delegate: ActiveStorage.DirectUploadDelegate = { + directUploadWillCreateBlobWithXHR(xhr) { + console.log(xhr.status); + }, + + directUploadWillStoreFileWithXHR(xhr) { + console.log(xhr.status); + }, +}; + +const d = new ActiveStorage.DirectUpload( + new File([], 'blank.txt'), + '/rails/active_storage/direct_uploads', + delegate +); + +d.create((error, blob) => { + if (error) { + console.log(error.message); + } else { + const { byte_size, checksum, content_type, filename, signed_id } = blob; + console.log({ byte_size, checksum, content_type, filename, signed_id }); + } +}); diff --git a/types/activestorage/index.d.ts b/types/activestorage/index.d.ts new file mode 100644 index 0000000000..2d749c84ec --- /dev/null +++ b/types/activestorage/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for ActiveStorage 5.2 +// Project: https://github.com/rails/rails/tree/master/activestorage/app/javascipt +// Definitions by: Cameron Bothner +// Definitions: https://github.com/cbothner/DefinitelyTyped +// TypeScript Version: 2.1 + +export as namespace ActiveStorage + +export function start(): void; + +export class DirectUpload { + id: number; + file: File; + url: string; + + constructor(file: File, url: string, delegate: DirectUploadDelegate) + + create(callback: (error: Error, blob: Blob) => void): void; +} + +export interface DirectUploadDelegate { + directUploadWillCreateBlobWithXHR?: (xhr: XMLHttpRequest) => void; + + directUploadWillStoreFileWithXHR?: (xhr: XMLHttpRequest) => void; +} + +export interface Blob { + byte_size: number; + checksum: string; + content_type: string; + filename: string; + signed_id: string; +} diff --git a/types/activestorage/tsconfig.json b/types/activestorage/tsconfig.json new file mode 100644 index 0000000000..326c2c7401 --- /dev/null +++ b/types/activestorage/tsconfig.json @@ -0,0 +1,16 @@ +{ + "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", "activestorage-tests.ts"] +} diff --git a/types/fast-diff/tslint.json b/types/activestorage/tslint.json similarity index 100% rename from types/fast-diff/tslint.json rename to types/activestorage/tslint.json diff --git a/types/adlib/adlib-tests.ts b/types/adlib/adlib-tests.ts new file mode 100644 index 0000000000..1f745d071a --- /dev/null +++ b/types/adlib/adlib-tests.ts @@ -0,0 +1,40 @@ +/* + | Copyright 2018 Esri + | + | Licensed under the Apache License, Version 2.0 (the "License"); + | you may not use this file except in compliance with the License. + | You may obtain a copy of the License at + | + | http://www.apache.org/licenses/LICENSE-2.0 + | + | Unless required by applicable law or agreed to in writing, software + | distributed under the License is distributed on an "AS IS" BASIS, + | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + | See the License for the specific language governing permissions and + | limitations under the License. + */ + +import * as adlib from "adlib"; + +const transform1: adlib.TransformFunction = + (key: string, value: any, settings: any, param?: any): any => { + return null; + }; + +const transformsList: adlib.TransformsList = { + firstXform: transform1 +}; + +const template = { + value: '{{ instance.color }}' +}; + +const settings = { + instance: { + color: 'red' + } +}; + +const interpolated = adlib.adlib(template, settings, transformsList); + +const list: string[] = adlib.listDependencies(template); diff --git a/types/adlib/index.d.ts b/types/adlib/index.d.ts new file mode 100644 index 0000000000..8866ab7809 --- /dev/null +++ b/types/adlib/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for adlib 3.0 +// Project: https://github.com/Esri/adlib +// Definitions by: Esri +// Mike Tschudi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/* + | Copyright 2018 Esri + | + | Licensed under the Apache License, Version 2.0 (the "License"); + | you may not use this file except in compliance with the License. + | You may obtain a copy of the License at + | + | http://www.apache.org/licenses/LICENSE-2.0 + | + | Unless required by applicable law or agreed to in writing, software + | distributed under the License is distributed on an "AS IS" BASIS, + | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + | See the License for the specific language governing permissions and + | limitations under the License. + */ + +/** + * Transform function to apply to interpolated value. + * + * @param key Path within a handlebar-style expression to attempt to replace; e.g., `s.animal.type` in + * https://github.com/Esri/adlib#transforms + * @param value Value to replace expression with + * @param settings Hash providing values to insert into template; see https://github.com/Esri/adlib#general-pattern + * @param param Parameter for transform function; e.g., the `optional` transform accepts a count of levels + * to delete if the value is not found (default is 0--just the current level); + * see https://github.com/Esri/adlib#optional-transform + */ +export interface TransformFunction { + ( + key: string, + value: any, + settings: any, + param?: any + ): any; +} + +/** + * Set of transformation functions keyed by the transform function's name. + */ +export interface TransformsList { + [ transformFnName: string ]: TransformFunction; +} + +/** + * A JavaScript library for interpolating property values in JSON Objects. + * + * @param template A template that possibly containing handlebar-style property values to replace; + * see https://github.com/Esri/adlib#general-pattern + * @param settings Hash providing values to insert into template; see https://github.com/Esri/adlib#general-pattern + * @param transforms Set of transformation functions + * @return Copy of template with replacements performed + */ +export function adlib( + template: any, + settings: any, + transforms?: TransformsList +): any; + +/** + * Reads a template and spits out unique handlebar-style property values. + * + * @param template A template that possibly containing handlebar-style property values to replace; + * see https://github.com/Esri/adlib#general-pattern + * @return List of unique property values in template + */ +export function listDependencies( + template: any +): string []; diff --git a/types/adlib/tsconfig.json b/types/adlib/tsconfig.json new file mode 100644 index 0000000000..570be96b8d --- /dev/null +++ b/types/adlib/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", + "adlib-tests.ts" + ] +} diff --git a/types/gitlab/tslint.json b/types/adlib/tslint.json similarity index 100% rename from types/gitlab/tslint.json rename to types/adlib/tslint.json diff --git a/types/aes-js/aes-js-tests.ts b/types/aes-js/aes-js-tests.ts new file mode 100644 index 0000000000..4f9d582630 --- /dev/null +++ b/types/aes-js/aes-js-tests.ts @@ -0,0 +1,10 @@ +import * as aesjs from 'aes-js'; + +const key = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + +const data: Uint8Array = aesjs.utils.utf8.toBytes('hello world'); + +const ecb = new aesjs.ModeOfOperation.ecb(key); +ecb.decrypt(ecb.encrypt(data)); + +const hex: string = aesjs.utils.hex.fromBytes(data); diff --git a/types/aes-js/index.d.ts b/types/aes-js/index.d.ts new file mode 100644 index 0000000000..142e03f7d9 --- /dev/null +++ b/types/aes-js/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for aes-js 3.1 +// Project: https://github.com/ricmoo/aes-js +// Definitions by: Federico Bond +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type ByteSource = ArrayBuffer | Uint8Array | number[]; + +export class AES { + /** + * Create a new AES block cipher. + * @param key The cipher key. + */ + constructor(key: ByteSource) + encrypt(v: ByteSource): ByteSource; +} + +/** + * Create a new Counter state for CTR cipher mode. + * @param initialValue The Counter initial value. + */ +export class Counter { + constructor(initialValue: number) + setValue(value: number): void; + setBytes(bytes: ByteSource): void; + increment(): void; +} + +export namespace ModeOfOperation { + class ModeOfOperationECB { + /** + * Create a new ECB stream cipher. + * @param key The cipher key. + */ + constructor(key: ByteSource) + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + class ModeOfOperationCBC { + /** + * Create a new CBC stream cipher. + * @param key The cipher key. + * @param iv The cipher initialization vector. + */ + constructor(key: ByteSource, iv: ByteSource); + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + class ModeOfOperationCFB { + /** + * Create a new CFB stream cipher. + * @param key The cipher key. + * @param iv The cipher initialization vector. + * @param segmentSize The cipher segment size. + */ + constructor(key: ByteSource, iv: ByteSource, segmentSize: number); + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + class ModeOfOperationOFB { + /** + * Create a new OFB stream cipher. + * @param key The cipher key. + * @param iv The cipher initialization vector. + */ + constructor(key: ByteSource, iv: ByteSource); + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + class ModeOfOperationCTR { + /** + * Create a new CTR stream cipher. + * @param key The cipher key. + * @param counter The cipher counter state. + */ + constructor(key: ByteSource, counter?: Counter) + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + const ecb: typeof ModeOfOperationECB; + const cbc: typeof ModeOfOperationCBC; + const cfb: typeof ModeOfOperationCFB; + const ofb: typeof ModeOfOperationOFB; + const ctr: typeof ModeOfOperationCTR; +} + +export namespace utils { + namespace utf8 { + /** + * Convert a UTF8 encoded string to a Uint8Array. + * @param data The input string. + */ + function toBytes(data: string): Uint8Array; + + /** + * Convert an array-like object containing UTF8 data to a string. + * @param data The input data. + */ + function fromBytes(data: ByteSource): string; + } + namespace hex { + /** + * Convert a hexadecimal string to a Uint8Array. + * @param data The input string. + */ + function toBytes(data: string): Uint8Array; + + /** + * Convert an array-like object to a hexadecimal string. + * @param data The input data. + */ + function fromBytes(data: ByteSource): string; + } +} + +export namespace padding { + namespace pkcs7 { + /** + * Add standard PKCS7 padding to an array. + * @param data The input data. + */ + function pad(data: ByteSource): Uint8Array; + + /** + * Remove standard PKCS7 padding from an array. + * @param data The input data. + */ + function strip(data: ByteSource): Uint8Array; + } +} diff --git a/types/aes-js/tsconfig.json b/types/aes-js/tsconfig.json new file mode 100644 index 0000000000..10f3720c1e --- /dev/null +++ b/types/aes-js/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", + "aes-js-tests.ts" + ] +} diff --git a/types/react-i18next/tslint.json b/types/aes-js/tslint.json similarity index 100% rename from types/react-i18next/tslint.json rename to types/aes-js/tslint.json diff --git a/types/aframe/index.d.ts b/types/aframe/index.d.ts index 075d063e5f..67257c6f65 100644 --- a/types/aframe/index.d.ts +++ b/types/aframe/index.d.ts @@ -319,6 +319,22 @@ export interface Utils { delimiter?: string ): void; }; + device: { + isWebXRAvailable: boolean; + getVRDisplay(): VRDisplay[]; + checkHeadsetConnected(): boolean; + checkHasPositionalTracking(): boolean; + isMobile(): boolean; + isTablet(): boolean; + isIOS(): boolean; + isGearVR(): boolean; + isOculusGo(): boolean; + isR7(): boolean; + isLandscape(): boolean; + isBrowserEnvironment(): boolean; + isNodeEnvironment(): boolean; + PolyfillControls(object3D: THREE.Object3D): void; + }; styleParser: { parse(value: string): object; stringify(data: object): string; @@ -342,7 +358,7 @@ export interface Utils { // Definitions // used as mixins to register functions to create classes (newable functions) in A-Frame -export type ComponentDefinition = T & Partial; +export type ComponentDefinition = T & Partial & ThisType; export type GeometryDefinition = T & Partial>; export type NodeDefinition = T & Partial; export interface PrimitiveDefinition { diff --git a/types/aframe/test/aframe-io-tests.ts b/types/aframe/test/aframe-io-tests.ts index 77fe716390..a846976b80 100644 --- a/types/aframe/test/aframe-io-tests.ts +++ b/types/aframe/test/aframe-io-tests.ts @@ -30,7 +30,7 @@ AFRAME.registerComponent('set-image', { init: function() { var data = this.data; - var el = this.el!; + var el = this.el; this.setupFadeAnimation(); @@ -133,14 +133,14 @@ AFRAME.registerComponent('arrow-key-rotation', { if (!this.data.enabled) { return; } - var rotation = this.el!.getAttribute('rotation'); + var rotation = this.el.getAttribute('rotation'); if (!rotation) { return; } if (this.directionX || this.directionY) { rotation.x += this.data.dx * this.directionY; rotation.y += this.data.dy * this.directionX; - this.el!.setAttribute('rotation', rotation); + this.el.setAttribute('rotation', rotation); } } }); @@ -164,10 +164,10 @@ AFRAME.registerComponent('hide-once-playing', { } }, onPlaying: function() { - this.el!.setAttribute('visible', false); + this.el.setAttribute('visible', false); }, onPause: function() { - this.el!.setAttribute('visible', true); + this.el.setAttribute('visible', true); } }); @@ -178,10 +178,10 @@ AFRAME.registerComponent('play-on-vrdisplayactivate-or-enter-vr', { }, play: function() { window.addEventListener('vrdisplayactivate', this.playVideo); - this.el!.sceneEl!.addEventListener('enter-vr', this.playVideoNextTick); + this.el.sceneEl!.addEventListener('enter-vr', this.playVideoNextTick); }, pause: function() { - this.el!.sceneEl!.removeEventListener('enter-vr', this.playVideoNextTick); + this.el.sceneEl!.removeEventListener('enter-vr', this.playVideoNextTick); window.removeEventListener('vrdisplayactivate', this.playVideo); }, playVideoNextTick: function() { @@ -189,7 +189,7 @@ AFRAME.registerComponent('play-on-vrdisplayactivate-or-enter-vr', { }, playVideo: function() { // TODO improve type - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -208,7 +208,7 @@ AFRAME.registerComponent('play-on-window-click', { window.removeEventListener('click', this.onClick); }, onClick: function() { - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -227,7 +227,7 @@ AFRAME.registerComponent('toggle-play-on-window-click', { window.removeEventListener('click', this.onClick); }, onClick: function() { - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -359,7 +359,7 @@ AFRAME.registerComponent('audioanalyser-levels-scale', { return; } - children = this.el!.children; + children = this.el.children; for (var i = 0; i < children.length; i++) { (children[i] as ANode).setAttribute('scale', { x: 1, @@ -382,7 +382,7 @@ AFRAME.registerComponent('audioanalyser-volume-bind', { tick: function() { var analyserComponent; var data = this.data; - var el = this.el!; + var el = this.el; var value; analyserComponent = data.analyserEl.components.audioanalyser; @@ -404,7 +404,7 @@ AFRAME.registerComponent('audioanalyser-volume-scale', { tick: function() { var analyserEl = this.data.analyserEl || this.el; var analyserComponent; - var el = this.el!; + var el = this.el; var volume; analyserComponent = analyserEl.components.audioanalyser; @@ -533,15 +533,16 @@ 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; }); }, remove: function() { - this.el!.removeObject3D('waveformContainer'); + this.el.removeObject3D('waveformContainer'); } }); @@ -873,7 +874,7 @@ AFRAME.registerComponent('color-on-beat', { init: function() { var analyserEl = this.data.analyserEl || this.el; - var el = this.el!; + var el = this.el; analyserEl.addEventListener('audioanalyser-beat', function() { el.setAttribute( @@ -908,12 +909,12 @@ AFRAME.registerComponent('remove-on-event', { removeEventListener: function() { var data = this.data; - var el = this.el!; + var el = this.el; el.removeEventListener(data.event, this._removeEntity); }, _removeEntity: function() { - var el = this.el!; + var el = this.el; if ((el as any).parentEl) { (el as any).parentEl.removeChild(el); } @@ -1015,7 +1016,7 @@ function rgbToHex(r: number, g: number, b: number) { AFRAME.registerComponent('random-material', { init: function() { - this.el!.setAttribute('material', { + this.el.setAttribute('material', { color: this.getRandomColor(), metalness: Math.random(), roughness: Math.random() @@ -1033,7 +1034,7 @@ AFRAME.registerComponent('random-material', { AFRAME.registerComponent('random-torus-knot', { init: function() { - this.el!.setAttribute('geometry', { + this.el.setAttribute('geometry', { primitive: 'torusKnot', radius: Math.random() * 10, radiusTubular: Math.random() * 0.75, diff --git a/types/aframe/test/aframe-tests.ts b/types/aframe/test/aframe-tests.ts index 2d6ff5bb7e..ac61f7f806 100644 --- a/types/aframe/test/aframe-tests.ts +++ b/types/aframe/test/aframe-tests.ts @@ -75,6 +75,7 @@ const Component = registerComponent('test-component', { }, init() { this.data.num = 0; + this.el.setAttribute('custom-attribute', 'custom-value'); }, update() {}, tick() {}, 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/airbnb-prop-types/airbnb-prop-types-tests.ts b/types/airbnb-prop-types/airbnb-prop-types-tests.ts new file mode 100644 index 0000000000..7b79086848 --- /dev/null +++ b/types/airbnb-prop-types/airbnb-prop-types-tests.ts @@ -0,0 +1,206 @@ +import * as React from 'react'; +import * as PropTypes from 'prop-types'; +import * as AirbnbPropTypes from 'airbnb-prop-types'; + +class ClassComp extends React.Component { + render() { + return null; + } +} + +function FuncComp() { + return null; +} + +// $ExpectType Requireable +AirbnbPropTypes.and([PropTypes.number]); +// $ExpectType Requireable +AirbnbPropTypes.and([PropTypes.number, AirbnbPropTypes.nonNegativeInteger]); +// $ExpectType Validator +AirbnbPropTypes.and([PropTypes.number, AirbnbPropTypes.integer()], 'foo').isRequired; + +// $ExpectType Requireable +AirbnbPropTypes.between({ lt: 1 }); +// $ExpectType Requireable +AirbnbPropTypes.between({ lte: 2 }); +// $ExpectType Requireable +AirbnbPropTypes.between({ gt: 3 }); +// $ExpectType Requireable +AirbnbPropTypes.between({ gte: 4 }); +// $ExpectType Requireable +AirbnbPropTypes.between({ lt: 1, gt: 0 }); + +// $ExpectType Requireable +AirbnbPropTypes.booleanSome('foo', 'bar', 'baz'); + +// $ExpectType Requireable +AirbnbPropTypes.childrenHavePropXorChildren('foo'); + +// $ExpectType Requireable +AirbnbPropTypes.childrenOf(PropTypes.string); + +// $ExpectType Requireable +AirbnbPropTypes.childrenOfType(ClassComp); +// $ExpectType Requireable +AirbnbPropTypes.childrenOfType(FuncComp); +// $ExpectType Requireable +AirbnbPropTypes.childrenOfType('div'); +// $ExpectType Requireable +AirbnbPropTypes.childrenOfType(ClassComp, FuncComp, 'div'); + +// $ExpectType Requireable +AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.number }); +// $ExpectType Requireable +AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.string, max: 100 }); +// $ExpectType Requireable +AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.bool, min: 0 }); + +// $ExpectType Requireable +AirbnbPropTypes.componentWithName('Foo'); +// $ExpectType Requireable +AirbnbPropTypes.componentWithName(/Foo/); +// $ExpectType Requireable +AirbnbPropTypes.componentWithName('Foo', { stripHOCs: ['connect'] }); + +// $ExpectType Requireable +AirbnbPropTypes.disallowedIf(PropTypes.number, 'foo', PropTypes.string); + +// $ExpectType Requireable +AirbnbPropTypes.elementType(ClassComp); +// $ExpectType Requireable +AirbnbPropTypes.elementType(FuncComp); +// $ExpectType Requireable +AirbnbPropTypes.elementType('div'); +// $ExpectType Requireable +AirbnbPropTypes.elementType('*'); +// $ExpectError +AirbnbPropTypes.elementType(ClassComp, FuncComp, 'div'); + +// $ExpectType Requireable +AirbnbPropTypes.explicitNull(); +// $ExpectType Validator +AirbnbPropTypes.explicitNull().isRequired; + +interface ForbidShape { + foo: string; + bar: number; + baz?: boolean | null; +} + +// $ExpectType ValidationMap<{ foo: string | null; bar: number; baz: boolean | null; }> +AirbnbPropTypes.forbidExtraProps({ + foo: PropTypes.string, + bar: PropTypes.number.isRequired, + baz: PropTypes.bool, +}); + +// $ExpectType ValidationMap +AirbnbPropTypes.forbidExtraProps({ + foo: PropTypes.string.isRequired, + bar: PropTypes.number.isRequired, + baz: PropTypes.bool, +}); + +// $ExpectType Requireable +AirbnbPropTypes.integer(); + +// $ExpectType Requireable<{}> +AirbnbPropTypes.keysOf(PropTypes.number); +// $ExpectType Requireable<{}> +AirbnbPropTypes.keysOf(PropTypes.number, 'foo'); +// $ExpectType Requireable<{}> +AirbnbPropTypes.keysOf(PropTypes.oneOf(['foo', 'bar'])); + +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number); +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number, 'foo'); +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.string, 'foo', 'bar'); + +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveTrueProps('foo'); +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveTrueProps('foo', 'bar'); + +// $ExpectType Requireable +AirbnbPropTypes.nChildren(1, PropTypes.number); +// $ExpectType Requireable +AirbnbPropTypes.nChildren(1, AirbnbPropTypes.childrenOfType('span')); + +// $ExpectType Requireable +AirbnbPropTypes.nonNegativeInteger; + +// $ExpectType Requireable +AirbnbPropTypes.nonNegativeNumber(); + +// $ExpectType Requireable +AirbnbPropTypes.numericString(); + +// $ExpectType Requireable<{}> +AirbnbPropTypes.object(); +// $ExpectType Requireable<{ foo: string; }> +AirbnbPropTypes.object<{ foo: string }>(); + +AirbnbPropTypes.or([PropTypes.bool.isRequired, AirbnbPropTypes.explicitNull().isRequired]); +AirbnbPropTypes.or([PropTypes.bool, PropTypes.number, PropTypes.arrayOf(PropTypes.string)]); +AirbnbPropTypes.or([PropTypes.number, PropTypes.string, PropTypes.bool], 'foo'); + +// $ExpectType Requireable +AirbnbPropTypes.range(0, 10); +// $ExpectType Requireable<5> +AirbnbPropTypes.range<5>(0, 10); + +// $ExpectType Requireable +AirbnbPropTypes.requiredBy('foo', PropTypes.string); +// $ExpectType Validator +AirbnbPropTypes.requiredBy('bar', PropTypes.number, 42).isRequired; + +// $ExpectType Requireable<{}> +AirbnbPropTypes.restrictedProp(); +// $ExpectType Requireable<{}> +AirbnbPropTypes.restrictedProp(() => 'Error'); +// $ExpectType Requireable<{}> +AirbnbPropTypes.restrictedProp(() => new Error('Error')); + +// $ExpectType Requireable<{}> +AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }); +// $ExpectType Requireable<{}> +AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }, { validator: PropTypes.string }); +// $ExpectType Requireable<{}> +AirbnbPropTypes.sequenceOf( + { validator: PropTypes.number, min: 0, max: 10 }, + { validator: PropTypes.string }, + { validator: PropTypes.bool }, +); + +interface ShapeShape { + foo: string; + bar?: number | null; +} + +// $ExpectType Requireable<{ foo: string | null; }> +AirbnbPropTypes.shape({ + foo: PropTypes.string, +}); +// $ExpectType Requireable<{ foo: string | null; bar: number | null; }> +AirbnbPropTypes.shape({ + foo: PropTypes.string, + bar: PropTypes.number, +}); +// $ExpectType Requireable +AirbnbPropTypes.shape({ + foo: PropTypes.string.isRequired, + bar: PropTypes.number, +}); + +// $ExpectType Requireable +AirbnbPropTypes.stringStartsWith('foo'); + +// $ExpectType Requireable +AirbnbPropTypes.uniqueArray(); +// $ExpectType Requireable +AirbnbPropTypes.uniqueArray(); + +// $ExpectType Requireable<{ [key: string]: number | null; }> +AirbnbPropTypes.valuesOf(PropTypes.number); diff --git a/types/airbnb-prop-types/index.d.ts b/types/airbnb-prop-types/index.d.ts new file mode 100644 index 0000000000..10c58556c7 --- /dev/null +++ b/types/airbnb-prop-types/index.d.ts @@ -0,0 +1,198 @@ +// Type definitions for airbnb-prop-types 2.11 +// Project: https://github.com/airbnb/prop-types +// Definitions by: Miles Johnson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +import * as PropTypes from 'prop-types'; + +export interface ReactComponentLike { + setState(...args: any[]): any; + forceUpdate(...args: any[]): any; + render(): PropTypes.ReactNodeLike; + props: any; + state: any; + context: any; + refs: any; +} + +export interface ReactClassComponentLike { + new (...args: any[]): ReactComponentLike; +} + +export type ReactFunctionComponentLike = (...args: any[]) => PropTypes.ReactNodeLike; + +export type ReactTypeLike = string | ReactClassComponentLike | ReactFunctionComponentLike; + +export interface Specifier { + max?: number; + min?: number; + validator: PropTypes.Validator; +} + +export function and( + propTypes: [PropTypes.Validator], + name?: string, +): PropTypes.Requireable; + +export function and( + propTypes: [PropTypes.Validator, PropTypes.Validator], + name?: string, +): PropTypes.Requireable; + +export function and( + propTypes: [PropTypes.Validator, PropTypes.Validator, PropTypes.Validator], + name?: string, +): PropTypes.Requireable; + +export function and( + propTypes: Array>, + name?: string, +): PropTypes.Requireable; + +export function between(options: { + lt?: number; + lte?: number; + gt?: number; + gte?: number; +}): PropTypes.Requireable; + +export function booleanSome(...props: string[]): PropTypes.Requireable; + +export function childrenHavePropXorChildren( + prop: string | symbol, +): PropTypes.Requireable; + +export function childrenOf( + propType: PropTypes.Validator

, +): PropTypes.Requireable; + +export function childrenOfType( + ...types: ReactTypeLike[] +): PropTypes.Requireable; + +export function childrenSequenceOf( + ...specifiers: Specifier[] +): PropTypes.Requireable; + +export function componentWithName( + name: string | RegExp, + options?: { stripHOCs: ReadonlyArray }, +): PropTypes.Requireable; + +export function disallowedIf( + propType: PropTypes.Requireable, + otherPropName: string, + otherPropType: PropTypes.Validator, +): PropTypes.Requireable; + +export function elementType( + type: ReactTypeLike, +): PropTypes.Requireable; + +export function explicitNull(): PropTypes.Requireable; + +export function forbidExtraProps( + propTypes: PropTypes.ValidationMap, +): PropTypes.ValidationMap; + +export function integer(): PropTypes.Requireable; + +export function keysOf( + propType: PropTypes.Validator

, + name?: string, +): PropTypes.Requireable; + +export function mutuallyExclusiveProps( + propType: PropTypes.Requireable, + ...propNames: string[] +): PropTypes.Requireable; + +export function mutuallyExclusiveProps( + // tslint:disable-next-line:unified-signatures + propType: PropTypes.Validator, + ...propNames: string[] +): PropTypes.Requireable; + +export function mutuallyExclusiveTrueProps(...propNames: string[]): PropTypes.Requireable; + +export function nChildren( + n: number, + propType?: PropTypes.Validator

, +): PropTypes.Requireable; + +export const nonNegativeInteger: PropTypes.Requireable; + +export function nonNegativeNumber(): PropTypes.Requireable; + +export function numericString(): PropTypes.Requireable; + +export function object(): PropTypes.Requireable; + +export function or(propTypes: [PropTypes.Validator], name?: string): PropTypes.Requireable; + +export function or( + propTypes: [PropTypes.Validator, PropTypes.Validator], + name?: string, +): PropTypes.Requireable; + +export function or( + propTypes: [PropTypes.Validator, PropTypes.Validator, PropTypes.Validator], + name?: string, +): PropTypes.Requireable; + +export function or( + propTypes: Array>, + name?: string, +): PropTypes.Requireable; + +export function or( + // tslint:disable-next-line:unified-signatures + propTypes: Array>, + name?: string, +): PropTypes.Requireable; + +export function range(min?: number, max?: number): PropTypes.Requireable; + +export function range(min?: number, max?: number): PropTypes.Requireable; + +export function requiredBy

( + requiredByPropName: string, + propType: PropTypes.Validator

, + defaultValue?: any, +): PropTypes.Requireable

; + +export function restrictedProp( + messageFunction?: ( + props: object, + propName: string, + componentName: string, + location: string, + propFullName: string, + ) => string | Error | undefined, +): PropTypes.Requireable; + +export function sequenceOf(...specifiers: Specifier[]): PropTypes.Requireable; + +export function shape( + propTypes: PropTypes.ValidationMap, +): PropTypes.Requireable; + +export function stringStartsWith(string: string): PropTypes.Requireable; + +export function uniqueArray(): PropTypes.Requireable; + +export function uniqueArrayOf( + propType: PropTypes.Validator

, + mapperOrName: ((value: any) => any) | string, + name?: string, +): PropTypes.Requireable; + +export function valuesOf( + propType: PropTypes.Validator, +): PropTypes.Requireable<{ [key: string]: T }>; + +export function withShape( + propType: PropTypes.Validator

, + propTypes: PropTypes.ValidationMap, +): PropTypes.Requireable; diff --git a/types/airbnb-prop-types/tsconfig.json b/types/airbnb-prop-types/tsconfig.json new file mode 100644 index 0000000000..ccefe4943c --- /dev/null +++ b/types/airbnb-prop-types/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", "airbnb-prop-types-tests.ts"] +} diff --git a/types/airbnb-prop-types/tslint.json b/types/airbnb-prop-types/tslint.json new file mode 100644 index 0000000000..71ee04c4e1 --- /dev/null +++ b/types/airbnb-prop-types/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-unnecessary-generics": false + } +} 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/react-i18next/v4/tslint.json b/types/ale-url-parser/tslint.json similarity index 100% rename from types/react-i18next/v4/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 b148e84599..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,7 @@ let _algoliaQueryParameters: QueryParameters = { filters: '', attributesToRetrieve: [''], restrictSearchableAttributes: [''], - facets: '', + facets: [''], facetingAfterDistinct: true, maxValuesPerFacet: 2, attributesToHighlight: [''], @@ -121,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, @@ -172,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 a0bb0e0e45..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,120 +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 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; /** @@ -1222,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[][]; /** @@ -1286,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[][]; /** @@ -1302,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[]; /** @@ -1322,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[]; /** @@ -1337,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; @@ -1464,7 +1498,7 @@ declare namespace algoliasearch { interface Task { taskID: number; createdAt: string; - objectID?: string; + objectID?: string; } interface TaskStatus { @@ -1747,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?: { @@ -1796,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/ali-oss/Cluster.d.ts b/types/ali-oss/Cluster.d.ts deleted file mode 100644 index 60886fca36..0000000000 --- a/types/ali-oss/Cluster.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { - ACLType, - CopyAndPutMetaResult, - CopyObjectOptions, - DeleteMultiOptions, - DeleteMultiResult, - GetObjectOptions, - GetObjectResult, - GetStreamOptions, - GetStreamResult, - HeadObjectOptions, - HeadObjectResult, - ListObjectResult, - ListObjectsQuery, - NormalSuccessResponse, - PutObjectOptions, - PutObjectResult, - PutStreamOptions, - RequestOptions, - SignatureUrlOptions, - UserMeta -} from "./index"; - -export interface ClusterType { - host: string; - accessKeyId: string; - accessKeySecret: string; -} - -export interface ClusterOptions { - clusters: ClusterType[]; - schedule?: string; -} - -export class Cluster { - constructor(options: ClusterOptions) - - list(query: ListObjectsQuery | null, options: RequestOptions): Promise; - - put(name: string, file: any, options?: PutObjectOptions): Promise; - - putStream(name: string, stream: any, options?: PutStreamOptions): Promise<{ name: string, res: NormalSuccessResponse }>; - - head(name: string, options?: HeadObjectOptions): Promise; - - get(name: string, file?: any, options?: GetObjectOptions): Promise; - - getStream(name?: string, options?: GetStreamOptions): Promise; - - delete(name: string, options?: RequestOptions): Promise; - - copy(name: string, sourceName: string, options?: CopyObjectOptions): Promise; - - putMeta(name: string, meta: UserMeta, options: RequestOptions): Promise; - - deleteMulti(names: string[], options?: DeleteMultiOptions): Promise; - - signatureUrl(name: string, options?: SignatureUrlOptions): string; - - putACL(name: string, acl: ACLType, options?: RequestOptions): Promise; - - restore(name: string, options?: RequestOptions): Promise; -} diff --git a/types/ali-oss/ImageClient.d.ts b/types/ali-oss/ImageClient.d.ts deleted file mode 100644 index 850213083c..0000000000 --- a/types/ali-oss/ImageClient.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { NormalSuccessResponse, RequestOptions } from "./index"; - -export interface ImageClientOptions { - imageHost: string; // your image service domain that binding to a OSS bucket - accessKeyId: string; // access key you create on aliyun console website - accessKeySecret: string; // access secret you create - bucket: string; // the default bucket you want to access If you don't have any bucket, please use putBucket() create one first. - region?: string; // the bucket data region location, please see Data Regions, default is oss-cn-hangzhou - internal?: boolean; // access OSS with aliyun internal network or not, default is false If your servers are running on aliyun too, you can set true to save lot of money. - timeout?: string | number; // instance level timeout for all operations, default is 60s -} - -export interface ImageGetOptions { - timeout?: number; - headers?: object; -} - -export interface StyleData { - Name: string; // style name - Content: string; // style content - CreateTime: string; // style create time - LastModifyTime: string; // style last modify time -} -export class ImageClient { - constructor(options: ImageClientOptions) - - /** - * Get an image from the image channel. - */ - get(name: string, file?: any, options?: ImageGetOptions): Promise<{ content: any, res: NormalSuccessResponse }>; - - /** - * Get an image read stream. - */ - getStream(name: string, options?: ImageGetOptions): Promise<{ stream: any, res: NormalSuccessResponse }>; - - /** - * Get a image exif info by image object name from the image channel. - */ - getExif(name: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; - - /** - * Get a image info and exif info by image object name from the image channel. - */ - getInfo(name: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; - - /** - * todo - */ - putStyle(name: string, style: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; - - /** - * Get a style by name from the image channel. - */ - getStyle(name: string, options?: RequestOptions): Promise<{ data: StyleData, res: NormalSuccessResponse}>; - - /** - * Get all styles from the image channel. - */ - listStyle(options?: RequestOptions): Promise; - - /** - * todo - */ - deleteStyle(styleName: string, options?: RequestOptions): Promise; - - /** - * Create a signature url for directly download. - */ - signatureUrl(name: string, options?: { expires?: string, timeout?: string }): string; -} diff --git a/types/ali-oss/ali-oss-tests.ts b/types/ali-oss/ali-oss-tests.ts index 96f817cca8..dc751b8d44 100644 --- a/types/ali-oss/ali-oss-tests.ts +++ b/types/ali-oss/ali-oss-tests.ts @@ -1,34 +1,25 @@ -import OSS from "ali-oss"; +import * as OSS from 'ali-oss'; -const client = new OSS({ +const ossOptions: OSS.Options = { accessKeyId: 'your access key', accessKeySecret: 'your access secret', bucket: 'your bucket name', region: 'oss-cn-hangzhou' -}); +}; -const ImageClient = OSS.ImageClient({ - imageHost: 'host', - accessKeySecret: "secret", - accessKeyId: 'id', - bucket: "", - internal: false, - region: "", - timeout: 2000 -}); +const client = new OSS(ossOptions); -const cluster = OSS.Cluster({ - clusters: [ - { - accessKeyId: 'id', - accessKeySecret: 'secret', - host: "" - }, - { - accessKeyId: 'id', - accessKeySecret: 'secret', - host: "" - }, - ], - schedule: 'masterSlave', -}); +const clusterOptions: OSS.ClusterOptions = { + clusters: [], +}; + +const clusterClient = new OSS.Cluster(clusterOptions); + +const imageOptions: OSS.ImageClientOptions = { + imageHost: 'xxxx', + accessKeyId: 'xxxx', + accessKeySecret: 'xxxx', + bucket: 'xxxx' +}; + +const imageClient = new OSS.ImageClient(imageOptions); diff --git a/types/ali-oss/index.d.ts b/types/ali-oss/index.d.ts index c3fa0dd10b..e4f9e09e7c 100644 --- a/types/ali-oss/index.d.ts +++ b/types/ali-oss/index.d.ts @@ -4,442 +4,558 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as ImageClientDefinition from './ImageClient'; -import * as ClusterDefinition from "./Cluster"; +export = OSS; -export * from './ImageClient'; -export * from './Cluster'; +// basic OSS +declare namespace OSS { + interface Options { + accessKeyId: string; // access secret you create + accessKeySecret: string; // access secret you create + stsToken?: string; // used by temporary authorization + bucket?: string; // the default bucket you want to access If you don't have any bucket, please use putBucket() create one first. + endpoint?: string; // oss region domain. It takes priority over region. + region?: string; // the bucket data region location, please see Data Regions, default is oss-cn-hangzhou. + internal?: boolean; // access OSS with aliyun internal network or not, default is false. If your servers are running on aliyun too, you can set true to save lot of money. + secure?: boolean; // instruct OSS client to use HTTPS (secure: true) or HTTP (secure: false) protocol. + timeout?: string | number; // instance level timeout for all operations, default is 60s + cname?: boolean; // use custom domain name + } -export interface Options { - accessKeyId: string; // access secret you create - accessKeySecret: string; // access secret you create - stsToken?: string; // used by temporary authorization - bucket?: string; // the default bucket you want to access If you don't have any bucket, please use putBucket() create one first. - endpoint?: string; // oss region domain. It takes priority over region. - region?: string; // the bucket data region location, please see Data Regions, default is oss-cn-hangzhou. - internal?: boolean; // access OSS with aliyun internal network or not, default is false. If your servers are running on aliyun too, you can set true to save lot of money. - secure?: boolean; // instruct OSS client to use HTTPS (secure: true) or HTTP (secure: false) protocol. - timeout?: string | number; // instance level timeout for all operations, default is 60s -} + interface Bucket { + name: string; + region: string; + creationDate: string; + StorageClass: StorageType; + } -export interface Bucket { - name: string; - region: string; - creationDate: string; - StorageClass: StorageType; -} + type StorageType = "Standard" | "IA" | "Archive"; -export type StorageType = "Standard" | "IA" | "Archive"; + type ACLType = "public-read-write" | "public-read" | "private"; -export type ACLType = "public-read-write" | "public-read" | "and private"; + type HTTPMethods = "GET" | "POST" | "DELETE" | "PUT"; -export type HTTPMethods = "GET" | "POST" | "DELETE" | "PUT"; + interface RequestOptions { + // the operation timeout + timeout?: number; + } -export interface RequestOptions { - // the operation timeout - timeout?: number; -} + type RuleStatusType = "Enabled" | "Disabled"; -export type RuleStatusType = "Enabled" | "Disabled"; + interface LifecycleRule { + id?: string; // rule id, if not set, OSS will auto create it with random string. + prefix: string; // store prefix + status: RuleStatusType; // rule status, allow values: Enabled or Disabled + days?: number | string; // expire after the days + date: string; // expire date, e.g.: 2022-10-11T00:00:00.000Z date and days only set one. + } -export interface LifecycleRule { - id?: string; // rule id, if not set, OSS will auto create it with random string. - prefix: string; // store prefix - status: RuleStatusType; // rule status, allow values: Enabled or Disabled - days?: number | string; // expire after the days - date: string; // expire date, e.g.: 2022-10-11T00:00:00.000Z date and days only set one. -} + interface CORSRule { + allowedOrigin: string | string[]; // configure for Access-Control-Allow-Origin header + allowedMethod: string | string[]; // configure for Access-Control-Allow-Methods header + allowedHeader?: string | string[]; // configure for Access-Control-Allow-Headers header + exposeHeader?: string | string[]; // configure for Access-Control-Expose-Headers header + maxAgeSeconds?: string | string[]; // configure for Access-Control-Max-Age header + } -export interface CORSRule { - allowedOrigin: string | string[]; // configure for Access-Control-Allow-Origin header - allowedMethod: string | string[]; // configure for Access-Control-Allow-Methods header - allowedHeader?: string | string[]; // configure for Access-Control-Allow-Headers header - exposeHeader?: string | string[]; // configure for Access-Control-Expose-Headers header - maxAgeSeconds?: string | string[]; // configure for Access-Control-Max-Age header -} + interface OwnerType { + id: string; + displayName: string; + } -export interface OwnerType { - id: string; - displayName: string; -} + interface ObjectMeta { + name: string; // object name on oss + lastModified: string; // object last modified GMT date, e.g.: 2015-02-19T08:39:44.000Z + etag: string; // object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" + type: string; // object type, e.g.: Normal + size: number; // object size, e.g.: 344606 + storageClass: StorageType; + owner: OwnerType; + } -export interface ObjectMeta { - name: string; // object name on oss - lastModified: string; // object last modified GMT date, e.g.: 2015-02-19T08:39:44.000Z - etag: string; // object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" - type: string; // object type, e.g.: Normal - size: number; // object size, e.g.: 344606 - storageClass: StorageType; - owner: OwnerType; -} + interface NormalSuccessResponse { + // response status + status: number; + // response headers + headers: object; // todo the object in detail + // response size + size: number; + // request total use time (ms) + rt: number; + } -export interface NormalSuccessResponse { - // response status - status: number; - // response headers - headers: object; // todo the object in detail - // response size - size: number; - // request total use time (ms) - rt: number; -} + interface UserMeta { + uid: number; + pid: number; + } -export interface UserMeta { - uid: number; - pid: number; -} + interface ObjectCallback { + url: string; // After a file is uploaded successfully, the OSS sends a callback request to this URL. + host?: string; // The host header value for initiating callback requests. + body: string; // The value of the request body when a callback is initiated, for example, key=$(key)&etag=$(etag)&my_var=$(x:my_var). + contentType?: string; // The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value. + customValue?: object; + headers?: object; // extra headers, detail see RFC 2616 + } -export interface ObjectCallback { - url: string; // After a file is uploaded successfully, the OSS sends a callback request to this URL. - host?: string; // The host header value for initiating callback requests. - body: string; // The value of the request body when a callback is initiated, for example, key=$(key)&etag=$(etag)&my_var=$(x:my_var). - contentType?: string; // The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value. - customValue?: object; - headers?: object; // extra headers, detail see RFC 2616 -} + interface ModifyData { + lastModified: string; // object last modified GMT string + etag: string; // object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" + } -export interface ModifyData { - lastModified: string; // object last modified GMT string - etag: string; // object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" -} + interface Checkpoint { + file: any; // The file object selected by the user, if the browser is restarted, it needs the user to manually trigger the settings + name: string; // object key + fileSize: number; + partSize: number; + uploadId: string; + doneParts: Array<{ number: number, etag: string }>; + } -export interface Checkpoint { - file: any; // The file object selected by the user, if the browser is restarted, it needs the user to manually trigger the settings - name: string; // object key - fileSize: number; - partSize: number; - uploadId: string; - doneParts: Array<{ number: number, etag: string }>; -} + interface ObjectPart { + PartNumber: number; + LastModified: any; // {Date} Time when a part is uploaded. + ETag: string; + size: number; + } -export interface ObjectPart { - PartNumber: number; - LastModified: any; // {Date} Time when a part is uploaded. - ETag: string; - size: number; -} + interface Upload { + name: string; + uploadId: string; + initiated: any; + } -export interface Upload { - name: string; - uploadId: string; - initiated: any; -} + interface Channel { + Name: string; + Description: string; + Status: string; + LastModified: string; + PublishUrls: string[]; + PlayUrls: string[]; + } -export interface Channel { - Name: string; - Description: string; - Status: string; - LastModified: string; - PublishUrls: string[]; - PlayUrls: string[]; -} - -export interface ChannelHistory { - StartTime: string; // - EndTime: string; - RemoteAddr: string; // the remote addr -} + interface ChannelHistory { + StartTime: string; // + EndTime: string; + RemoteAddr: string; // the remote addr + } // parameters type -export interface ListBucketsQueryType { - prefix?: string; // search buckets using prefix key - marker?: string; // search start from marker, including marker key - 'max-keys'?: string | number; // max buckets, default is 100, limit to 1000 + interface ListBucketsQueryType { + prefix?: string; // search buckets using prefix key + marker?: string; // search start from marker, including marker key + 'max-keys'?: string | number; // max buckets, default is 100, limit to 1000 + } + + interface PutBucketOptions { + timeout: number; + storageClass: StorageType; + } + + interface PutBucketWebsiteConfig { + index: string; // default page, e.g.: index.html + error?: string; // error page, e.g.: 'error.html' + } + + interface ListObjectsQuery { + prefix?: string; // search object using prefix key + marker?: string; // search start from marker, including marker key + delimiter?: string; // delimiter search scope e.g. / only search current dir, not including subdir + 'max-keys': string | number; // max objects, default is 100, limit to 1000 + } + + interface ListObjectResult { + objects: ObjectMeta[]; + prefixes: string[]; + isTruncated: boolean; + nextMarker: string; + res: NormalSuccessResponse; + } + + interface PutObjectOptions { + timeout?: number; // the operation timeout + mime?: string; // custom mime, will send with Content-Type entity header + meta?: UserMeta; // user meta, will send with x-oss-meta- prefix string e.g.: { uid: 123, pid: 110 } + callback: ObjectCallback; + headers?: object; + } + + interface PutObjectResult { + name: string; + data: object; + res: NormalSuccessResponse; + } + + interface PutStreamOptions { + contentLength?: number; // the stream length, chunked encoding will be used if absent + timeout: number; // the operation timeout + mime: string; // custom mime, will send with Content-Type entity header + meta: UserMeta; + callback: ObjectCallback; + headers?: object; + } + + interface AppendObjectOptions { + position?: string; // specify the position which is the content length of the latest object + timeout?: number; // the operation timeout + mime?: string; // custom mime, will send with Content-Type entity header + meta?: UserMeta; + headers?: object; + } + + interface AppendObjectResult { + name: string; + url: string; // the url of oss + res: NormalSuccessResponse; + nextAppendPosition: string; // the next position + } + + interface HeadObjectOptions { + timeout?: number; + headers?: object; + } + + interface HeadObjectResult { + status: number; // response status, maybe 200 or 304 + meta: UserMeta; + res: NormalSuccessResponse; + } + + interface GetObjectOptions { + timeout?: number; + process?: string; // image process params, will send with x-oss-process e.g.: {process: 'image/resize,w_200'} + headers?: object; + } + + interface GetObjectResult { + content?: any; // file content buffer if file parameter is null or ignore + res: NormalSuccessResponse; + } + + interface GetStreamOptions { + timeout?: number; + process?: string; // image process params, will send with x-oss-process e.g.: {process: 'image/resize,w_200'} + headers?: object; + } + + interface GetStreamResult { + stream?: any; // readable stream instance if response status is not 200, stream will be null. + res: NormalSuccessResponse; + } + + interface CopyObjectOptions { + timeout?: number; + meta?: UserMeta; + headers?: object; + } + + interface CopyAndPutMetaResult { + data: ModifyData; + res: NormalSuccessResponse; + } + + interface DeleteMultiOptions { + quite?: boolean; // quite mode or verbose mode, default is false + timeout?: number; + } + + interface DeleteMultiResult { + deleted?: string[]; // deleted object names list + res: NormalSuccessResponse; + } + + interface ResponseHeaderType { + 'content-type'?: string; + 'content-disposition'?: string; + 'cache-control'?: string; + } + + interface SignatureUrlOptions { + expires?: number; // after expires seconds, the url will become invalid, default is 1800 + method?: HTTPMethods; // the HTTP method, default is 'GET' + 'Content-Type'?: string; // set the request content type + process?: string; + response?: ResponseHeaderType; // set the response headers for download + callback?: ObjectCallback; + } + + interface GetACLResult { + acl: ACLType; + res: NormalSuccessResponse; + } + + interface InitMultipartUploadOptions { + timeout?: number; + mime?: string; // Mime file type + meta?: UserMeta; + headers?: object; + } + + interface InitMultipartUploadResult { + res: { status: number, headers: object, size: number, rt: number }; + bucket: string; // bucket name + name: string; // object name store on OSS + uploadId: string; // upload id, use for uploadPart, completeMultipart + } + + interface UploadPartResult { + name: string; + etag: string; + res: NormalSuccessResponse; + } + + interface CompleteMultipartUploadOptions { + timeout?: number; + callback?: ObjectCallback; + headers?: object; + } + + interface CompleteMultipartUploadResult { + bucket: string; + name: string; + etag: string; + data: object; + res: NormalSuccessResponse; + } + + interface MultipartUploadOptions { + parallel?: number; // the number of parts to be uploaded in parallel + partSize?: number; // the suggested size for each part + progress?: (...args: any[]) => any; // the progress callback called after each successful upload of one part + checkpoint?: Checkpoint; // the checkpoint to resume upload, if this is provided, it will continue the upload from where interrupted, otherwise a new multipart upload will be created. + meta?: UserMeta; + mime?: string; + callback?: ObjectCallback; + headers?: object; + timeout?: number; + copyheaders?: object; // {Object} only uploadPartCopy api used, detail + } + + interface MultipartUploadResult { + bucket: string; + name: string; + etag: string; + data: object; + res: NormalSuccessResponse; + } + + interface MultipartUploadCopyResult { + bucket: string; + name: string; + etag: string; + res: NormalSuccessResponse; + } + + interface MultipartUploadCopySourceData { + sourceKey: string; // the source object name + sourceBucketName: string; // sourceData. the source bucket name + startOffset: number; // data copy start byte offset, e.g: 0 + endOffset: number; // data copy end byte offset, e.g: 102400 + } + + interface ListPartsQuery { + 'max-parts': number; // The maximum part number in the response of the OSS. default value: 1000. + 'part-number-marker': number; // Starting position of a specific list. A part is listed only when the part number is greater than the value of this parameter. + 'encoding-type': string; // Specify the encoding of the returned content and the encoding type. Optional value: url + } + + interface ListPartsResult { + uploadId: string; + bucket: string; + name: string; + PartNumberMarker: number; + nextPartNumberMarker: number; + maxParts: number; + isTruncated: boolean; + parts: ObjectPart[]; + res: NormalSuccessResponse; + } + + interface ListUploadsQuery { + prefix?: string; + 'max-uploads'?: number; + 'key-marker'?: string; + 'upload-id-marker'?: string; + } + + interface ListUploadsResult { + res: NormalSuccessResponse; + bucket: string; + nextKeyMarker: any; + nextUploadIdMarker: any; + isTruncated: boolean; + uploads: Upload[]; + } + + interface PutChannelConf { + Description?: string; + Status?: string; + Target?: { + Type: string, + FragDuration: number, + FragCount: number, + PlaylistName: string + }; + } + + interface PutChannelResult { + publishUrls: string[]; + playUrls: string[]; + res: NormalSuccessResponse; + } + + interface GetChannelResult { + Status: string; + ConnectedTime?: string; + RemoteAddr?: string; + Video?: object; + Audio?: object; + res: NormalSuccessResponse; + } + + interface ListChannelsQuery { + prefix: string; // the channel id prefix (returns channels with this prefix) + marker: string; // the channel id marker (returns channels after this id) + 'max-keys ': number; // max number of channels to return + } + + interface ListChannelsResult { + channels: Channel[]; + nextMarker: string | null; + isTruncated: boolean; + res: NormalSuccessResponse; + } + + interface ChannelHistoryResult { + records: ChannelHistory; + res: NormalSuccessResponse; + } + + interface GetRtmpUrlOptions { + expires?: number; // the expire time in seconds of the url + params?: object; // the additional parameters for url, e.g.: {playlistName: 'play.m3u8'} + timeout?: number; // the operation timeout + } } -export interface PutBucketOptions { - timeout: number; - storageClass: StorageType; +/// cluster +declare namespace OSS { + interface ClusterType { + host: string; + accessKeyId: string; + accessKeySecret: string; + } + + interface ClusterOptions { + clusters: ClusterType[]; + schedule?: string; + } + + class Cluster { + constructor(options: ClusterOptions) + + list(query: ListObjectsQuery | null, options: RequestOptions): Promise; + + put(name: string, file: any, options?: PutObjectOptions): Promise; + + putStream(name: string, stream: any, options?: PutStreamOptions): Promise<{ name: string, res: NormalSuccessResponse }>; + + head(name: string, options?: HeadObjectOptions): Promise; + + get(name: string, file?: any, options?: GetObjectOptions): Promise; + + getStream(name?: string, options?: GetStreamOptions): Promise; + + delete(name: string, options?: RequestOptions): Promise; + + copy(name: string, sourceName: string, options?: CopyObjectOptions): Promise; + + putMeta(name: string, meta: UserMeta, options: RequestOptions): Promise; + + deleteMulti(names: string[], options?: DeleteMultiOptions): Promise; + + signatureUrl(name: string, options?: SignatureUrlOptions): string; + + putACL(name: string, acl: ACLType, options?: RequestOptions): Promise; + + restore(name: string, options?: RequestOptions): Promise; + } } -export interface PutBucketWebsiteConfig { - index: string; // default page, e.g.: index.html - error?: string; // error page, e.g.: 'error.html' +// image +declare namespace OSS { + interface ImageClientOptions { + imageHost: string; // your image service domain that binding to a OSS bucket + accessKeyId: string; // access key you create on aliyun console website + accessKeySecret: string; // access secret you create + bucket: string; // the default bucket you want to access If you don't have any bucket, please use putBucket() create one first. + region?: string; // the bucket data region location, please see Data Regions, default is oss-cn-hangzhou + internal?: boolean; // access OSS with aliyun internal network or not, default is false If your servers are running on aliyun too, you can set true to save lot of money. + timeout?: string | number; // instance level timeout for all operations, default is 60s + } + + interface ImageGetOptions { + timeout?: number; + headers?: object; + } + + interface StyleData { + Name: string; // style name + Content: string; // style content + CreateTime: string; // style create time + LastModifyTime: string; // style last modify time + } + + class ImageClient { + constructor(options: ImageClientOptions) + + /** + * Get an image from the image channel. + */ + get(name: string, file?: any, options?: ImageGetOptions): Promise<{ content: any, res: NormalSuccessResponse }>; + + /** + * Get an image read stream. + */ + getStream(name: string, options?: ImageGetOptions): Promise<{ stream: any, res: NormalSuccessResponse }>; + + /** + * Get a image exif info by image object name from the image channel. + */ + getExif(name: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; + + /** + * Get a image info and exif info by image object name from the image channel. + */ + getInfo(name: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; + + /** + * todo + */ + putStyle(name: string, style: string, options?: RequestOptions): Promise<{ data: object, res: NormalSuccessResponse }>; + + /** + * Get a style by name from the image channel. + */ + getStyle(name: string, options?: RequestOptions): Promise<{ data: StyleData, res: NormalSuccessResponse}>; + + /** + * Get all styles from the image channel. + */ + listStyle(options?: RequestOptions): Promise; + + /** + * todo + */ + deleteStyle(styleName: string, options?: RequestOptions): Promise; + + /** + * Create a signature url for directly download. + */ + signatureUrl(name: string, options?: { expires?: string, timeout?: string }): string; + } } -export interface ListObjectsQuery { - prefix?: string; // search object using prefix key - marker?: string; // search start from marker, including marker key - delimiter?: string; // delimiter search scope e.g. / only search current dir, not including subdir - 'max-keys': string | number; // max objects, default is 100, limit to 1000 -} - -export interface ListObjectResult { - objects: ObjectMeta[]; - prefixes: string[]; - isTruncated: boolean; - nextMarker: string; - res: NormalSuccessResponse; -} - -export interface PutObjectOptions { - timeout?: number; // the operation timeout - mime?: string; // custom mime, will send with Content-Type entity header - meta?: UserMeta; // user meta, will send with x-oss-meta- prefix string e.g.: { uid: 123, pid: 110 } - callback: ObjectCallback; -} - -export interface PutObjectResult { - name: string; - data: object; - res: NormalSuccessResponse; -} - -export interface PutStreamOptions { - contentLength?: number; // the stream length, chunked encoding will be used if absent - timeout: number; // the operation timeout - mime: string; // custom mime, will send with Content-Type entity header - meta: UserMeta; - callback: ObjectCallback; -} - -export interface AppendObjectOptions { - position?: string; // specify the position which is the content length of the latest object - timeout?: number; // the operation timeout - mime?: string; // custom mime, will send with Content-Type entity header - meta?: UserMeta; - headers?: object; -} - -export interface AppendObjectResult { - name: string; - url: string; // the url of oss - res: NormalSuccessResponse; - nextAppendPosition: string; // the next position -} - -export interface HeadObjectOptions { - timeout?: number; - headers?: object; -} - -export interface HeadObjectResult { - status: number; // response status, maybe 200 or 304 - meta: UserMeta; - res: NormalSuccessResponse; -} - -export interface GetObjectOptions { - timeout?: number; - process?: string; // image process params, will send with x-oss-process e.g.: {process: 'image/resize,w_200'} - headers?: object; -} - -export interface GetObjectResult { - content?: any; // file content buffer if file parameter is null or ignore - res: NormalSuccessResponse; -} - -export interface GetStreamOptions { - timeout?: number; - process?: string; // image process params, will send with x-oss-process e.g.: {process: 'image/resize,w_200'} - headers?: object; -} - -export interface GetStreamResult { - stream?: any; // readable stream instance if response status is not 200, stream will be null. - res: NormalSuccessResponse; -} - -export interface CopyObjectOptions { - timeout?: number; - meta?: UserMeta; - headers?: object; -} - -export interface CopyAndPutMetaResult { - data: ModifyData; - res: NormalSuccessResponse; -} - -export interface DeleteMultiOptions { - quite?: boolean; // quiet mode or verbose mode, default is false - timeout?: number; -} - -export interface DeleteMultiResult { - deleted?: string[]; // deleted object names list - res: NormalSuccessResponse; -} - -export interface ResponseHeaderType { - 'content-type'?: string; - 'content-disposition'?: string; - 'cache-control'?: string; -} - -export interface SignatureUrlOptions { - expires?: number; // after expires seconds, the url will become invalid, default is 1800 - method?: HTTPMethods; // the HTTP method, default is 'GET' - 'Content-Type'?: string; // set the request content type - process?: string; - response?: ResponseHeaderType; // set the response headers for download - callback?: ObjectCallback; -} - -export interface GetACLResult { - acl: ACLType; - res: NormalSuccessResponse; -} - -export interface InitMultipartUploadOptions { - timeout?: number; - mime?: string; // Mime file type - meta?: UserMeta; - headers?: object; -} - -export interface InitMultipartUploadResult { - res: { status: number, headers: object, size: number, rt: number }; - bucket: string; // bucket name - name: string; // object name store on OSS - uploadId: string; // upload id, use for uploadPart, completeMultipart -} - -export interface UploadPartResult { - name: string; - etag: string; - res: NormalSuccessResponse; -} - -export interface CompleteMultipartUploadOptions { - timeout?: number; - callback?: ObjectCallback; - headers?: object; -} - -export interface CompleteMultipartUploadResult { - bucket: string; - name: string; - etag: string; - data: object; - res: NormalSuccessResponse; -} - -export interface MultipartUploadOptions { - parallel?: number; // the number of parts to be uploaded in parallel - partSize?: number; // the suggested size for each part - progress?: (...args: any[]) => any; // the progress callback called after each successful upload of one part - checkpoint?: Checkpoint; // the checkpoint to resume upload, if this is provided, it will continue the upload from where interrupted, otherwise a new multipart upload will be created. - meta?: UserMeta; - mime?: string; - callback?: ObjectCallback; - headers?: object; - timeout?: number; - copyheaders?: object; // {Object} only uploadPartCopy api used, detail -} - -export interface MultipartUploadResult { - bucket: string; - name: string; - etag: string; - data: object; - res: NormalSuccessResponse; -} - -export interface MultipartUploadCopyResult { - bucket: string; - name: string; - etag: string; - res: NormalSuccessResponse; -} - -export interface MultipartUploadCopySourceData { - sourceKey: string; // the source object name - sourceBucketName: string; // sourceData. the source bucket name - startOffset: number; // data copy start byte offset, e.g: 0 - endOffset: number; // data copy end byte offset, e.g: 102400 -} - -export interface ListPartsQuery { - 'max-parts': number; // The maximum part number in the response of the OSS. default value: 1000. - 'part-number-marker': number; // Starting position of a specific list. A part is listed only when the part number is greater than the value of this parameter. - 'encoding-type': string; // Specify the encoding of the returned content and the encoding type. Optional value: url -} - -export interface ListPartsResult { - uploadId: string; - bucket: string; - name: string; - PartNumberMarker: number; - nextPartNumberMarker: number; - maxParts: number; - isTruncated: boolean; - parts: ObjectPart[]; - res: NormalSuccessResponse; -} - -export interface ListUploadsQuery { - prefix?: string; - 'max-uploads'?: number; - 'key-marker'?: string; - 'upload-id-marker'?: string; -} - -export interface ListUploadsResult { - res: NormalSuccessResponse; - bucket: string; - nextKeyMarker: any; - nextUploadIdMarker: any; - isTruncated: boolean; - uploads: Upload[]; -} - -export interface PutChannelConf { - Description?: string; - Status?: string; - Target?: { - Type: string, - FragDuration: number, - FragCount: number, - PlaylistName: string - }; -} - -export interface PutChannelResult { - publishUrls: string[]; - playUrls: string[]; - res: NormalSuccessResponse; -} - -export interface GetChannelResult { - Status: string; - ConnectedTime?: string; - RemoteAddr?: string; - Video?: object; - Audio?: object; - res: NormalSuccessResponse; -} - -export interface ListChannelsQuery { - prefix: string; // the channel id prefix (returns channels with this prefix) - marker: string; // the channel id marker (returns channels after this id) - 'max-keys ': number; // max number of channels to return -} - -export interface ListChannelsResult { - channels: Channel[]; - nextMarker: string | null; - isTruncated: boolean; - res: NormalSuccessResponse; -} - -export interface ChannelHistoryResult { - records: ChannelHistory; - res: NormalSuccessResponse; -} - -export interface GetRtmpUrlOptions { - expires?: number; // the expire time in seconds of the url - params?: object; // the additional parameters for url, e.g.: {playlistName: 'play.m3u8'} - timeout?: number; // the operation timeout -} - -export default class OSS { - // the image client - static ImageClient: (options: ImageClientDefinition.ImageClientOptions) => ImageClientDefinition.ImageClient; - static Cluster: (options: ClusterDefinition.ClusterOptions) => ClusterDefinition.Cluster; - - constructor(options: Options) +declare class OSS { + constructor(options: OSS.Options) /******************************************* the bucket operations *************************************************/ @@ -447,12 +563,12 @@ export default class OSS { /** * List buckets in this account. */ - listBuckets(query: ListBucketsQueryType | null, options?: RequestOptions): Promise; + listBuckets(query: OSS.ListBucketsQueryType | null, options?: OSS.RequestOptions): Promise; /** * Create a new bucket. */ - putBucket(name: string, options?: PutBucketOptions): Promise<{ bucket: string, res: NormalSuccessResponse }>; + putBucket(name: string, options?: OSS.PutBucketOptions): Promise<{ bucket: string, res: OSS.NormalSuccessResponse }>; /** * Use the bucket. @@ -462,7 +578,7 @@ export default class OSS { /** * Delete an empty bucket. */ - deleteBucket(name: string, options?: RequestOptions): Promise; + deleteBucket(name: string, options?: OSS.RequestOptions): Promise; /** * Get bucket information,include CreationDate、ExtranetEndpoint、IntranetEndpoint、Location、Name、StorageClass、 Owner、AccessControlList @@ -478,114 +594,114 @@ export default class OSS { /** * Update the bucket ACL. */ - putBucketACL(name: string, acl: ACLType, options?: RequestOptions): Promise; + putBucketACL(name: string, acl: OSS.ACLType, options?: OSS.RequestOptions): Promise; /** * Get the bucket ACL. * acl - acl settings string */ - getBucketACL(name: string, options?: RequestOptions): Promise<{ acl: string, res: NormalSuccessResponse }>; + getBucketACL(name: string, options?: OSS.RequestOptions): Promise<{ acl: string, res: OSS.NormalSuccessResponse }>; // logging operations /** * Update the bucket logging settings. Log file will create every one hour and name format: -YYYY-mm-DD-HH-MM-SS-UniqueString. */ - putBucketLogging(name: string, prefix?: string, options?: RequestOptions): Promise; + putBucketLogging(name: string, prefix?: string, options?: OSS.RequestOptions): Promise; /** * Get the bucket logging settings. */ - getBucketLogging(name: string, options?: RequestOptions): Promise<{ enable: boolean, prefix: string | null, res: NormalSuccessResponse }>; + getBucketLogging(name: string, options?: OSS.RequestOptions): Promise<{ enable: boolean, prefix: string | null, res: OSS.NormalSuccessResponse }>; /** * Delete the bucket logging settings. */ - deleteBucketLogging(name: string, options?: RequestOptions): Promise; + deleteBucketLogging(name: string, options?: OSS.RequestOptions): Promise; // Website operations /** * Set the bucket as a static website. */ - putBucketWebsite(name: string, config: PutBucketWebsiteConfig): Promise; + putBucketWebsite(name: string, config: OSS.PutBucketWebsiteConfig): Promise; /** * Get the bucket website config. */ - getBucketWebsite(name: string, options?: RequestOptions): Promise<{ index: string, error: string, res: NormalSuccessResponse }>; + getBucketWebsite(name: string, options?: OSS.RequestOptions): Promise<{ index: string, error: string, res: OSS.NormalSuccessResponse }>; /** * Delete the bucket website config. */ - deleteBucketWebsite(name: string, options?: RequestOptions): Promise; + deleteBucketWebsite(name: string, options?: OSS.RequestOptions): Promise; // referer operations /** * Set the bucket request Referer white list. */ - putBucketReferer(name: string, allowEmpty: boolean, referers: string[], options?: RequestOptions): Promise; + putBucketReferer(name: string, allowEmpty: boolean, referers: string[], options?: OSS.RequestOptions): Promise; /** * Get the bucket request Referer white list. */ - getBucketReferer(name: string, options?: RequestOptions): Promise<{ allowEmpty: boolean, referers: string[], res: NormalSuccessResponse }>; + getBucketReferer(name: string, options?: OSS.RequestOptions): Promise<{ allowEmpty: boolean, referers: string[], res: OSS.NormalSuccessResponse }>; /** * Delete the bucket request Referer white list. */ - deleteBucketReferer(name: string, options?: RequestOptions): Promise; + deleteBucketReferer(name: string, options?: OSS.RequestOptions): Promise; // lifecycle operations /** * Set the bucket object lifecycle. */ - putBucketLifecycle(name: string, rules: LifecycleRule[], options?: RequestOptions): Promise; + putBucketLifecycle(name: string, rules: OSS.LifecycleRule[], options?: OSS.RequestOptions): Promise; /** * Get the bucket object lifecycle. */ - getBucketLifecycle(name: string, options?: RequestOptions): Promise<{ rules: LifecycleRule[], res: NormalSuccessResponse }>; + getBucketLifecycle(name: string, options?: OSS.RequestOptions): Promise<{ rules: OSS.LifecycleRule[], res: OSS.NormalSuccessResponse }>; /** * Delete the bucket object lifecycle. */ - deleteBucketLifecycle(name: string, options?: RequestOptions): Promise; + deleteBucketLifecycle(name: string, options?: OSS.RequestOptions): Promise; // CORS operations /** * Set CORS rules of the bucket object */ - putBucketCORS(name: string, rules: CORSRule[], options?: RequestOptions): Promise; + putBucketCORS(name: string, rules: OSS.CORSRule[], options?: OSS.RequestOptions): Promise; /** * Get CORS rules of the bucket object. */ - getBucketCORS(name: string): Promise<{ rules: CORSRule[], res: NormalSuccessResponse }>; + getBucketCORS(name: string): Promise<{ rules: OSS.CORSRule[], res: OSS.NormalSuccessResponse }>; /** * Delete CORS rules of the bucket object. */ - deleteBucketCORS(name: string): Promise; + deleteBucketCORS(name: string): Promise; /********************************************************** Object operations ********************************************/ /** * List objects in the bucket. */ - list(query: ListObjectsQuery | null, options: RequestOptions): Promise; + list(query: OSS.ListObjectsQuery | null, options: OSS.RequestOptions): Promise; /** * Add an object to the bucket. */ - put(name: string, file: any, options?: PutObjectOptions): Promise; + put(name: string, file: any, options?: OSS.PutObjectOptions): Promise; /** * Add a stream object to the bucket. */ - putStream(name: string, stream: any, options?: PutStreamOptions): Promise<{ name: string, res: NormalSuccessResponse }>; + putStream(name: string, stream: any, options?: OSS.PutStreamOptions): Promise<{ name: string, res: OSS.NormalSuccessResponse }>; /** * Append an object to the bucket, it's almost same as put, but it can add content to existing object rather than override it. */ - append(name: string, file: any, options?: AppendObjectOptions): Promise; + append(name: string, file: any, options?: OSS.AppendObjectOptions): Promise; /** * Get the Object url. If provide baseUrl, will use baseUrl instead the default endpoint. @@ -600,67 +716,67 @@ export default class OSS { /** * Head an object and get the meta info. */ - head(name: string, options?: HeadObjectOptions): Promise; + head(name: string, options?: OSS.HeadObjectOptions): Promise; /** * Get an object from the bucket. */ - get(name: string, file?: any, options?: GetObjectOptions): Promise; + get(name: string, file?: any, options?: OSS.GetObjectOptions): Promise; /** * Get an object read stream. */ - getStream(name?: string, options?: GetStreamOptions): Promise; + getStream(name?: string, options?: OSS.GetStreamOptions): Promise; /** * Delete an object from the bucket. */ - delete(name: string, options?: RequestOptions): Promise; + delete(name: string, options?: OSS.RequestOptions): Promise; /** * Copy an object from sourceName to name. */ - copy(name: string, sourceName: string, options?: CopyObjectOptions): Promise; + copy(name: string, sourceName: string, options?: OSS.CopyObjectOptions): Promise; /** * Set an exists object meta. */ - putMeta(name: string, meta: UserMeta, options: RequestOptions): Promise; + putMeta(name: string, meta: OSS.UserMeta, options: OSS.RequestOptions): Promise; /** * Delete multi objects in one request. */ - deleteMulti(names: string[], options?: DeleteMultiOptions): Promise; + deleteMulti(names: string[], options?: OSS.DeleteMultiOptions): Promise; /** * Create a signature url for download or upload object. When you put object with signatureUrl ,you need to pass Content-Type.Please look at the example. */ - signatureUrl(name: string, options?: SignatureUrlOptions): string; + signatureUrl(name: string, options?: OSS.SignatureUrlOptions): string; /** * Set object's ACL. */ - putACL(name: string, acl: ACLType, options?: RequestOptions): Promise; + putACL(name: string, acl: OSS.ACLType, options?: OSS.RequestOptions): Promise; /** * Get object's ACL. */ - getACL(name: string, options?: RequestOptions): Promise; + getACL(name: string, options?: OSS.RequestOptions): Promise; /** * Restore Object. */ - restore(name: string, options?: RequestOptions): Promise; + restore(name: string, options?: OSS.RequestOptions): Promise; /** * multi upload */ - initMultipartUpload(name: string, options?: InitMultipartUploadOptions): Promise; + initMultipartUpload(name: string, options?: OSS.InitMultipartUploadOptions): Promise; /** * After initiating a Multipart Upload event, you can upload data in parts based on the specified object name and Upload ID. */ - uploadPart(name: string, uploadId: string, partNo: number, file: any, start: number, end: number, options?: RequestOptions): Promise; + uploadPart(name: string, uploadId: string, partNo: number, file: any, start: number, end: number, options?: OSS.RequestOptions): Promise; /** * Using Upload Part Copy, you can copy data from an existing object and upload a part of the data. @@ -673,7 +789,7 @@ export default class OSS { range: string, sourceData: { sourceKey: string, sourceBucketName: string }, options: { timeout?: number, headers?: object } - ): Promise; + ): Promise; /** * After uploading all data parts, you must call the Complete Multipart Upload API to complete Multipart Upload for the entire file. @@ -682,79 +798,79 @@ export default class OSS { name: string, uploadId: string, parts: Array<{ number: number, etag: string }>, - options?: CompleteMultipartUploadOptions - ): Promise; + options?: OSS.CompleteMultipartUploadOptions + ): Promise; /** * Upload file with OSS multipart. */ - multipartUpload(name: string, file: any, options: MultipartUploadOptions): Promise; + multipartUpload(name: string, file: any, options: OSS.MultipartUploadOptions): Promise; /** * Copy file with OSS multipart. * this function contains head, initMultipartUpload, uploadPartCopy, completeMultipartUpload. * When copying a file larger than 1 GB, you should use the Upload Part Copy method. If you want to copy a file smaller than 1 GB, see Copy Object. */ - multipartUploadCopy(name: string, sourceData: MultipartUploadCopySourceData, options?: MultipartUploadOptions): Promise; + multipartUploadCopy(name: string, sourceData: OSS.MultipartUploadCopySourceData, options?: OSS.MultipartUploadOptions): Promise; /** * The ListParts command can be used to list all successfully uploaded parts mapped to a specific upload ID, i.e.: those not completed and not aborted. */ - listParts(name: string, uploadId: string, query?: ListPartsQuery, options?: RequestOptions): Promise; + listParts(name: string, uploadId: string, query?: OSS.ListPartsQuery, options?: OSS.RequestOptions): Promise; /** * List on-going multipart uploads, i.e.: those not completed and not aborted. */ - listUploads(query: ListUploadsQuery, options?: RequestOptions): Promise; + listUploads(query: OSS.ListUploadsQuery, options?: OSS.RequestOptions): Promise; /** * Abort a multipart upload for object. */ - abortMultipartUpload(name: string, uploadId: string, options?: RequestOptions): Promise; + abortMultipartUpload(name: string, uploadId: string, options?: OSS.RequestOptions): Promise; /************************************************ RTMP Operations *************************************************************/ /** * Create a live channel. */ - putChannel(id: string, conf: PutChannelConf, options?: RequestOptions): Promise; + putChannel(id: string, conf: OSS.PutChannelConf, options?: OSS.RequestOptions): Promise; /** * Get live channel info. */ - getChannel(id: string, options?: RequestOptions): Promise<{ data: PutChannelConf, res: NormalSuccessResponse }>; + getChannel(id: string, options?: OSS.RequestOptions): Promise<{ data: OSS.PutChannelConf, res: OSS.NormalSuccessResponse }>; /** * Delete a live channel. */ - deleteChannel(id: string, options?: RequestOptions): Promise; + deleteChannel(id: string, options?: OSS.RequestOptions): Promise; /** * Change the live channel status. */ - putChannelStatus(id: string, status?: string, options?: RequestOptions): Promise; + putChannelStatus(id: string, status?: string, options?: OSS.RequestOptions): Promise; /** * Get the live channel status. */ - getChannelStatus(id: string, options?: RequestOptions): Promise; + getChannelStatus(id: string, options?: OSS.RequestOptions): Promise; /** * List channels. */ - listChannels(query: ListChannelsQuery, options?: RequestOptions): Promise; + listChannels(query: OSS.ListChannelsQuery, options?: OSS.RequestOptions): Promise; /** * Get the live channel history. */ - getChannelHistory(id: string, options?: RequestOptions): Promise; + getChannelHistory(id: string, options?: OSS.RequestOptions): Promise; /** * Create a VOD playlist for the channel. */ - createVod(id: string, name: string, time: { startTime: number, endTime: number }, options?: RequestOptions): Promise; + createVod(id: string, name: string, time: { startTime: number, endTime: number }, options?: OSS.RequestOptions): Promise; /** * Get signatured rtmp url for publishing. */ - getRtmpUrl(channelId?: string, options?: GetRtmpUrlOptions): string; + getRtmpUrl(channelId?: string, options?: OSS.GetRtmpUrlOptions): string; } diff --git a/types/ali-oss/tsconfig.json b/types/ali-oss/tsconfig.json index 62f030a4fd..6a0fb7441b 100644 --- a/types/ali-oss/tsconfig.json +++ b/types/ali-oss/tsconfig.json @@ -18,8 +18,6 @@ }, "files": [ "index.d.ts", - "ImageClient.d.ts", - "Cluster.d.ts", "ali-oss-tests.ts" ] } diff --git a/types/ali-oss/tslint.json b/types/ali-oss/tslint.json index f93cf8562a..8192d88dd1 100644 --- a/types/ali-oss/tslint.json +++ b/types/ali-oss/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-mergeable-namespace": false + } } diff --git a/types/all-keys/all-keys-tests.ts b/types/all-keys/all-keys-tests.ts new file mode 100644 index 0000000000..6bbb6021c7 --- /dev/null +++ b/types/all-keys/all-keys-tests.ts @@ -0,0 +1,5 @@ +import allKeys = require('all-keys'); + +allKeys(Symbol.prototype); // $ExpectType Set +allKeys(Symbol.prototype, { includeObjectPrototype: false }); // $ExpectType Set +allKeys(Symbol.prototype, { includeSymbols: false }); // $ExpectType Set diff --git a/types/all-keys/index.d.ts b/types/all-keys/index.d.ts new file mode 100644 index 0000000000..9301c8f929 --- /dev/null +++ b/types/all-keys/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for all-keys 2.0 +// Project: https://github.com/sindresorhus/all-keys#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = allKeys; + +/** + * Get all property keys of an object including non-enumerable and inherited ones. + * Like [Reflect.ownKeys()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/ownKeys) + * but traverses up the prototype-chain. + */ +declare function allKeys(obj: object, options?: allKeys.Options): Set; + +declare namespace allKeys { + interface Options { + /** + * Include `Object.prototype` properties like `isPrototypeOf`. + * @default true + */ + includeObjectPrototype?: boolean; + /** + * Include [Symbol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) keys. + * @default true + */ + includeSymbols?: boolean; + } +} diff --git a/types/all-keys/tsconfig.json b/types/all-keys/tsconfig.json new file mode 100644 index 0000000000..a6f20f786f --- /dev/null +++ b/types/all-keys/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", + "all-keys-tests.ts" + ] +} diff --git a/types/all-keys/tslint.json b/types/all-keys/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/all-keys/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/all-property-names/all-property-names-tests.ts b/types/all-property-names/all-property-names-tests.ts new file mode 100644 index 0000000000..b32daa59a3 --- /dev/null +++ b/types/all-property-names/all-property-names-tests.ts @@ -0,0 +1,4 @@ +import allPropertyNames = require('all-property-names'); + +// $ExpectType Set +allPropertyNames(Symbol.prototype); diff --git a/types/all-property-names/index.d.ts b/types/all-property-names/index.d.ts new file mode 100644 index 0000000000..0b396ec94d --- /dev/null +++ b/types/all-property-names/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for all-property-names 1.0 +// Project: https://github.com/sindresorhus/all-property-names#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = allPropertyNames; + +declare function allPropertyNames(input: object): Set; diff --git a/types/all-property-names/tsconfig.json b/types/all-property-names/tsconfig.json new file mode 100644 index 0000000000..394cd3bb53 --- /dev/null +++ b/types/all-property-names/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", + "all-property-names-tests.ts" + ] +} diff --git a/types/all-property-names/tslint.json b/types/all-property-names/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/all-property-names/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/alt/index.d.ts b/types/alt/index.d.ts index 9094642e70..515a67986a 100644 --- a/types/alt/index.d.ts +++ b/types/alt/index.d.ts @@ -54,12 +54,12 @@ declare namespace AltJS { export type Source = {[name:string]: () => SourceModel}; export interface SourceModel { - local(state:any, ...args: any[]):any; + local?(state:any, ...args: any[]):any; remote(state:any, ...args: any[]):Promise; shouldFetch?(fetchFn:(...args:Array) => boolean):void; loading?:(args:any) => void; - success?:(state:S) => void; - error?:(args:any) => void; + success:(state:S) => void; + error:(args:any) => void; interceptResponse?(response:any, action:Action, ...args:Array):any; } 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/amap-js-sdk/amap-js-sdk-tests.ts b/types/amap-js-sdk/amap-js-sdk-tests.ts new file mode 100644 index 0000000000..f09bca3760 --- /dev/null +++ b/types/amap-js-sdk/amap-js-sdk-tests.ts @@ -0,0 +1,22 @@ +const aMap = new AMap.Map('id', { + resizeEnable: true, + animateEnable: true +}); + +aMap.setCenter(new AMap.LngLat(0, 0)); + +AMap.plugin(['someplugin'], () => { + console.log('plugin loaded'); +}); + +AMap.convertFrom([116.3, 39.9], 'gps', (status, result) => { + if (result.info === 'ok') { + const _ = result.locations; + } +}); + +new AMap.Marker({ + map: aMap, + title: '', + position: new AMap.LngLat(0, 0), +}); diff --git a/types/amap-js-sdk/index.d.ts b/types/amap-js-sdk/index.d.ts new file mode 100644 index 0000000000..a1b93e6cb3 --- /dev/null +++ b/types/amap-js-sdk/index.d.ts @@ -0,0 +1,1392 @@ +// Type definitions for amap-js-sdk 1.4 +// Project: http://lbs.amap.com/api/javascript-api/summary/ +// Definitions by: Bian Zhongjie +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace AMap { + type EventCallback = (...args: any[]) => void; + type GenericEventCallback = (res: T) => void; + + /** + * 加载插件 + * @param pluginNames + * @param ready + */ + function plugin(pluginNames: string[], ready?: () => void): void; + + /** + * 加载服务 + * @param serviceName + * @param ready + */ + function service(serviceName: string, ready?: () => void): void; + + namespace event { + /** + * 注册DOM对象事件:给DOM对象注册事件,并返回eventListener。运行AMap.event.removeListener(eventListener)可以删除该事件的监听器。 + * @param instance:需注册事件的DOM对象(必填) + * @param eventName:事件名称(必填) + * @param handler:事件功能函数(必填) + * @param context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) + */ + const addDomListener: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 注册对象事件:给对象注册事件,并返回eventListener。运行AMap.event.removeListener(eventListener)可以删除该事件的监听器。 + * @param instance:需注册事件的对象(必填) + * @param eventName:事件名称(必填) + * @param handler:事件功能函数(必填) + * @param context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) + */ + const addListener: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 类似于addListener,但处理程序会在处理完第一个事件后将自已移除。 + */ + const addListenerOnce: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 删除由上述 event.addDomListener 和 event.addListener 传回的指定侦听器。 + */ + const removeListener: (listener: EventListener) => void; + + /** + * 触发非DOM事件:触发非DOM事件eventName,extArgs将扩展到事件监听函数(handler)接受到的event参数中。如:在extArgs内写入{m:10,p:2},eventName监听函数(handler)可以接收到包含m,p两个key值的event对象。 + */ + const trigger: (instance: any, eventName: string, extArgs: any) => void; + } + + /** + * 此对象用于表示地图、覆盖物、叠加层上的各种鼠标事件返回,包含以下字段: + */ + interface MapsEventOptions { + lnglat: LngLat; + pixel: Pixel; + type: string; + target: any; + } + + abstract class EventBindable { + on(eventName: string, callback: EventCallback): void; + off(eventName: string, callback: EventCallback): void; + } + + /* --------------------------- 基础类 --------------------------- */ + /* 参考地址:http://lbs.amap.com/api/javascript-api/reference/core */ + + /** + * 像素坐标,确定地图上的一个像素点。 + */ + class Pixel { + /** + * 构造一个像素坐标对象。 + */ + constructor(x: number, y: number); + /** + * 获得X方向像素坐标 + */ + getX(): number; + + /** + * 获得Y方向像素坐标 + */ + getY(): number; + + /** + * 当前像素坐标与传入像素坐标是否相等 + */ + equals(point: Pixel): boolean; + + /** + * 以字符串形式返回像素坐标对象 + */ + toString(): string; + } + + /** + * 地物对象的像素尺寸 + */ + class Size { + /** + * 构造尺寸对象 + * @param width 宽度,单位:像素 + * @param height 高度,单位:像素 + */ + constructor(width: number, height: number); + + /** + * 获得宽度 + */ + getWidth(): number; + + /** + * 获得高度 + */ + getHeight(): number; + + /** + * 以字符串形式返回尺寸大小对象 + */ + toString(): string; + } + + /** + * 经纬度坐标,确定地图上的一个点 + */ + class LngLat { + /** + * 构造一个地理坐标对象 + * @param lng 经度 + * @param lat 纬度 + */ + constructor(lng: number, lat: number); + + /** + * 当前经纬度坐标值经度移动w,纬度移动s,得到新的坐标。 + * + * @param w 经度,向右移为正值,单位:米 + * @param s 纬度,向上移为正值,单位:米 + */ + offset(w: number, s: number): LngLat; + + /** + * 计算当前经纬度和传入经纬度或者经纬度数组连线之间的地面距离,单位为米 + * + * @param lnglat 传入的经纬度 + */ + distance(lnglat: LngLat | [number, number]): number; + + /** + * 获取经度值 + */ + getLng(): number; + + /** + * 获取纬度值 + */ + getLat(): number; + + /** + * 判断当前坐标对象与传入坐标对象是否相等 + * + * @param lnglat 传入坐标对象 + */ + equals(lnglat: LngLat): boolean; + + /** + * LngLat对象以字符串的形式返回 + */ + toString(): string; + } + + /** + * 地物对象的经纬度矩形范围 + */ + class Bounds { + /** + * 构造一个矩形范围 + * @param southWest 西南角经纬度坐标 + * @param northEast 东北角经纬度坐标 + */ + constructor(southWest: LngLat, northEast: LngLat); + + /** + * 判断指定点坐标是否在矩形范围内 + * @param point 指定点 + */ + contains(point: LngLat): boolean; + + /** + * 获取当前Bounds的中心点经纬度坐标 + */ + getCenter(): LngLat; + + /** + * 获取西南角坐标 + */ + getSouthWest(): LngLat; + + /** + * 获取东北角坐标 + */ + getNorthEast(): LngLat; + + /** + * 以字符串形式返回地物对象的矩形范围 + */ + toString(): string; + } + + interface TileLayerOptions { + map: Map; + tileSize: number; + tileUrl: string; + errorUrl: string; + getTileUrl: (x: number, y: number, z: number) => string; + zIndex: number; + opacity: number; + zooms: number[]; + detectRetina: boolean; + } + + abstract class Layer extends EventBindable { + setOpacity(alpha: number): void; + show(): void; + hide(): void; + getTiles(): string[]; + reload(): void; + setTileUrl(): void; + getZooms(): number[]; + setzIndex(index: number): void; + setMap(map: Map): void; + } + + class TileLayer extends Layer { + constructor(tileOpt?: { + map: Map, + tileSize?: number, + tileUrl?: string, + errorUrl?: string, + getTileUrl?: (x: number, y: number, z: number) => string, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean + }); + } + + namespace TileLayer { + abstract class MapTypeLayer extends Layer { + constructor(options?: { + map: Map, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean + }); + } + + class Satellite extends MapTypeLayer { + } + + class RoadNet extends MapTypeLayer { + } + + class Traffic extends MapTypeLayer { + constructor(options?: { + map: Map, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean, + autoRefresh?: boolean, + interval?: number + }); + + interval: number; + autoRefresh: boolean; + } + } + + class IndoorMap { + constructor(opts: { + zIndex?: number, + opacity?: number, + cursor?: string, + hideFloorBar?: boolean, + alwaysShow?: boolean + }); + + showIndoorMap(indoorid: string, floor: number, shopid: string): void; + + showFloor(floor: number, noMove: boolean): void; + + setMap(map: Map): void; + + show(): void; + + hide(): void; + + setzIndex(): void; + + showFloorBar(): void; + + hideFloorBar(): void; + + setOpacity(alpha: number): void; + + getOpacity(): number; + + showLabels(): void; + + hideLabels(): void; + + getSelectedBuildingId(): string; + + getSelectedBuilding(): string; + } + + interface MapOptions { + view?: View2D; + layers?: TileLayer[]; + level?: number; + center?: LngLat; + labelzIndex?: number; + zooms?: number[]; + lang?: string; + cursor?: string; + crs?: string; + animateEnable?: boolean; + isHotspot?: boolean; + defaultLayer?: TileLayer; + rotateEnable?: boolean; + resizeEnable?: boolean; + showIndoorMap?: boolean; + indoorMap?: IndoorMap; + expandZoomRange?: boolean; + dragEnable?: boolean; + zoomEnable?: boolean; + doubleClickZoom?: boolean; + keyboardEnable?: boolean; + jogEnable?: boolean; + scrollWheel?: boolean; + touchZoom?: boolean; + mapStyle?: string; + features?: string[]; + } + + class View2D { + constructor(opt: { + center?: LngLat, + rotation?: number, + zoom?: number, + crs?: 'EPSG3857'|'EPSG3395'|'EPSG4326' + }); + + /** + * To silence lint error, this class has to be exists. + */ + toString(): string; + } + + class Map extends EventBindable { + constructor(mapDiv: string, opts?: MapOptions); + + getZoom(): number; + + getLayers(): TileLayer[]; + + getCenter(): LngLat; + + getCity(callback: (result: { + provice: string, + city: string, + citycode: string, + district: string + }) => void): void; + + getBounds(): Bounds; + getlabelzIndex(): number; + getLimitBounds(): Bounds; + getLang(): string; + getSize(): Size; + getRotation(): number; + getStatus(): any; + getDefaultCursor(): string; + getResolution(point: LngLat): number; + getScale(dpi: number): number; + setZoom(level: number): void; + setlabelzIndex(index: number): void; + setLayers(layers: TileLayer[]): void; + add(overlayers: any[]): void; + remove(overlayers: any[]): void; + getAllOverlays(type: string): Marker[] | Circle[] | Polygon[] | Polyline[]; + setCenter(position: LngLat): void; + setZoomAndCenter(zoomLevel: number, center: LngLat): void; + setCity(city: string, callback: () => void): void; + setBounds(bound: Bounds): void; + setLimitBounds(bound: Bounds): void; + clearLimitBounds(): void; + setLang(lang: string): void; + setRotation(rotation: number): void; + setStatus(status: any): void; + setDefaultCursor(cursor: string): void; + zoomIn(): void; + zoomOut(): void; + panTo(position: LngLat): void; + panBy(x: number, y: number): void; + setFitView(overlayList?: any[]): void; + clearMap(): void; + destroy(): void; + plugin(name: string| string[], callback: () => void): void; + addControl(obj: any): void; + removeControl(obj: any): void; + clearInfoWindow(): void; + pixelToLngLat(pixel: Pixel, level: number): LngLat; + lnglatToPixel(lnglat: LngLat, level: number): Pixel; + containerToLngLat(pixel: Pixel, level: number): LngLat; + lngLatToContainer(lnglat: LngLat, level: number): Pixel; + setMapStyle(style: string): void; + getMapStyle(): string; + setFeatures(features: string[]): void; + getFeatures(): string[]; + setDefaultLayer(layer: TileLayer): void; + } + + class Icon { + constructor(options?: { + size?: Size, + imageOffset?: Pixel, + image?: string, + imageSize?: Size + }); + + getImageSize(): Size; + setImageSize(size: Size): void; + } + + /** + * MarkerShape用于划定Marker的可点击区域范围。需要注意的是,在IE浏览器中图标透明区域默认为不触发事件,因此MarkerShape在IE中不起作用。 + */ + class MarkerShape { + constructor(options: { + /** + * + * 可点击区域组成元素数组,存放图形的像素坐标等信息,该数组元素由type决定: + * - circle:coords格式为 [x1, y1, r],x1,y1为圆心像素坐标,r为圆半径 + * - poly: coords格式为 [x1, y1, x2, y2 … xn, yn],各x,y表示多边形边界像素坐标 + * - rect: coords格式为 [x1, y1, x2, y2],x1,y1为矩形左上角像素坐标,x2,y2为矩形右下角像素坐标 + * Markshape的像素坐标是指相对于marker的左上角的像素坐标偏移量 + */ + coords?: number[], + + /** + * 可点击区域类型,可选值: + * - circle:圆形 + * - poly:多边形 + * - rect:矩形 + */ + type?: string + }); + + /** + * To silence lint error, this class has to be exists. + */ + toString(): string; + } + + interface MarkerOptions { + map?: Map; + position?: LngLat; + offset?: Pixel; + icon?: string|Icon; + content?: string| HTMLElement; + topWhenClick?: boolean; + topWhenMouseOver?: boolean; + draggable?: boolean; + raiseOnDrag?: boolean; + cursor?: string; + visible?: boolean; + zIndex?: number; + angle?: number; + autoRotation?: boolean; + animation?: string; + shadow?: Icon; + title?: string; + clickable?: boolean; + shape?: MarkerShape; + extData?: any; + label?: { content: string, offset: Pixel }; + } + + /** + * 点标记。 + */ + class Marker extends EventBindable { + constructor(options?: MarkerOptions); + + markOnAMAP(obj: { + name: string, + position: LngLat + }): void; + + getOffset(): Pixel; + setOffset(offset: Pixel): void; + + setAnimation(animate: string): void; + getAnimation(): string; + + setClickable(clickable: boolean): void; + getClickable(): boolean; + + getPosition(): LngLat; + setPosition(lnglat: LngLat): void; + + setAngle(angle: number): void; + getAngle(): number; + + setLabel(label: { + content?: string, + offset?: Pixel + }): void; + getLabel(): { + content?: string, + offset?: Pixel + }; + + setzIndex(index: number): void; + + getIcon(): string|Icon; + setIcon(content: string|Icon): void; + + setDraggable(draggable: boolean): void; + getDraggable(): boolean; + + hide(): void; + show(): void; + + setCursor(cursor: string): void; + + setContent(content: string| HTMLElement): void; + getContent(): string; + + moveAlong(lnglatlist: LngLat[], speed?: number, f?: (k: number) => number, circlable?: boolean): void; + moveTo(lnglat: LngLat, speed?: number, f?: (k: number) => number): void; + stopMove(): void; + setMap(map: Map): void; + getMap(): Map; + setTitle(title: string): void; + getTitle(): string; + setTop(isTop: boolean): void; + getTop(): boolean; + setShadow(icon: Icon): void; + getShadow(): Icon; + setShape(shape: MarkerShape): void; + getShape(): MarkerShape; + setExtData(ext: any): void; + getExtData(): any; + } + + interface MarkerClustererOptions { + gridSize?: number; + minClusterSize?: number; + maxZoom?: number; + averageCenter?: boolean; + styles?: any[]; + renderCluserMarker?: (obj: any) => void; + zoomOnClick?: boolean; + } + + /** + * 用于地图上加载大量点标记,提高地图的绘制和显示性能。 + */ + class MarkerClusterer extends EventBindable { + constructor(map: Map, markers: Marker[], opt?: MarkerClustererOptions); + + /** + * 添加一个需进行聚合的点标记 + * @param marker + */ + addMarker(marker: Marker): void; + + /** + * 删除一个聚合的点标记 + * @param marker 点标记 + */ + removeMarker(marker: Marker): void; + + /** + * 获取聚合点的总数量 + */ + getClustersCount(): number; + + /** + * 获取聚合网格的像素大小 + */ + getGridSize(): number; + + /** + * 获取地图中点标记的最大聚合级别 + */ + getMaxZoom(): number; + + /** + * 获取单个聚合的最小数量 + */ + getMinClusterSize(): number; + + /** + * 获取聚合的样式风格集合 + */ + getStyles(): any[]; + + /** + * 设置聚合网格的像素大小 + * @param size + */ + setGridSize(size: number): void; + + /** + * 设置地图中点标记的最大聚合级别 + * @param zoom + */ + setMaxZoom(zoom: number): void; + + /** + * 设置单个聚合的最小数量 + * @param size + */ + setMinClusterSize(size: number): void; + + /** + * 设置聚合的样式风格 + * @param styles + */ + setStyles(styles: any[]): void; + + /** + * 从地图上彻底清除所有聚合点标记 + */ + clearMarkers(): void; + + /** + * 设置将进行点聚合的地图对象 + * @param map + */ + setMap(map: Map): void; + + /** + * 设置将进行点聚合显示的点标记集合 + * @param markers + */ + setMarkers(markers: Marker[]): void; + + /** + * 获取该点聚合的地图对象 + */ + getMap(): Map; + + /** + * 获取该点聚合中的点标记集合 + */ + getMarkers(): Marker[]; + + /** + * 添加一组需进行聚合的点标记 + */ + addMarkers(markers: Marker[]): void; + + /** + * 删除一组聚合的点标记 + * @param markers + */ + removeMarkers(markers: Marker[]): void; + + /** + * 获取单个聚合点位置是否是聚合内所有标记的平均中心 + */ + isAverageCenter(): boolean; + + /** + * 设置单个聚合点位置是否是聚合内所有标记的平均中心 + * @param averageCenter + */ + setAverageCenter(averageCenter: boolean): void; + } + + interface CircleOptions { + map: Map; + zIndex?: number; + center: LngLat; + radius?: number; + strokeColor?: string; + strokeOpacity?: number; + fillColor?: string; + fillOpacity?: string; + strokeStyle?: string; + extData?: any; + strokeDasharray?: number[]; + } + + class Circle { + constructor(options?: CircleOptions); + setCenter(lnglat: LngLat): void; + getCenter(): LngLat; + getBounds(): Bounds; + setRadius(radius: number): void; + getRadius(): number; + setOptions(circleopt: CircleOptions): void; + getOptions(): CircleOptions; + hide(): void; + show(): void; + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + contains(point: LngLat): boolean; + } + + interface PolygonOptions { + map?: Map; + zIndex?: number; + path?: LngLat[]|LngLat[][]; + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + fillColor?: string; + fillOpacity?: number; + extData?: any; + strokeStyle?: string; + strokeDasharray?: number[]; + } + + class Polygon extends EventBindable { + constructor(options?: PolygonOptions); + + setPath(path: LngLat[]|LngLat[][]): void; + getPath(): LngLat[]|LngLat[][]; + setOptions(opt: PolygonOptions): void; + getOptions(): PolygonOptions; + getBounds(): Bounds; + getArea(): number; + hide(): void; + show(): void; + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + contains(point: LngLat): boolean; + } + + interface PolylineOptions { + map?: Map; + zIndex?: number; + geodesic?: boolean; + isOutline?: boolean; + outlineColor?: string; + path?: LngLat[]; + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + strokeStyle?: string; + strokeDasharray?: number[]; + extData?: any; + } + + class Polyline extends EventBindable { + constructor(options?: PolylineOptions); + + setPath(path: LngLat[]): void; + getPath(): LngLat[]; + + setOptions(opt: PolylineOptions): void; + getOptions(): PolylineOptions; + + getLength(): number; + getBounds(): Bounds; + hide(): void; + show(): void; + + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + } + + interface MapControl { + show(): void; + hide(): void; + } + + class MapType implements MapControl { + constructor(options?: { + defaultType?: number; + showTraffic?: boolean; + showRoad?: boolean; + }); + + show(): void; + hide(): void; + } + + class OverView extends EventBindable implements MapControl { + constructor(options?: { + tileLayer?: TileLayer[], + isOpen?: boolean, + visible?: boolean + }); + + open(): void; + close(): void; + setTileLayer(layer: TileLayer): void; + getTileLayer(): TileLayer; + show(): void; + hide(): void; + } + + class Scale extends EventBindable implements MapControl { + offset: Pixel; + position: string; + + show(): void; + hide(): void; + } + + class ToolBar extends EventBindable implements MapControl { + constructor(options?: { + offset?: Pixel, + position?: string, + ruler?: boolean, + noIpLocate?: boolean, + locate?: boolean, + liteStyle?: boolean, + direction?: boolean, + autoPosition?: boolean, + locationMarker?: Marker, + useNative?: boolean + }); + + getOffset(): Pixel; + setOffset(offset: Pixel): void; + hideRuler(): void; + showRuler(): void; + hideDirection(): void; + showDirection(): void; + hideLocation(): void; + showLocation(): void; + doLocation(): void; + getLocation(): { lng: number, lat: number }; + show(): void; + hide(): void; + } + + class InfoWindow extends EventBindable { + constructor(options?: { + isCustom?: boolean, + autoMove?: boolean, + closeWhenClickMap?: boolean, + content?: string | HTMLElement, + size?: Size, + offset?: Pixel, + position?: LngLat, + showShadow?: boolean + }); + + open(map: Map, pos: LngLat): void; + close(): void; + getIsOpen(): boolean; + setPosition(lnglat: LngLat): void; + getPosition(): LngLat; + setSize(size: Size): void; + getSize(): Size; + getContent(): string; + setContent(content: string|HTMLElement): void; + } + + class AdvancedInfoWindow extends EventBindable { + constructor(options?: { + autoMove?: boolean, + closeWhenClickMap?: boolean, + content?: string|HTMLElement, + offset?: Pixel, + position?: LngLat, + panel?: string|HTMLElement, + searchRadius?: number, + placeSearch?: boolean, + driving?: boolean, + walking?: boolean, + transit?: boolean, + asOrigin?: boolean, + asDestination?: boolean + }); + + open(map: Map, pos: LngLat): void; + close(): void; + getIsOpen(): boolean; + setPosition(lnglat: LngLat): void; + getPosition(): LngLat; + setContent(content: string|HTMLElement): void; + getContent(): string; + } + + class Geolocation extends EventBindable { + constructor(options: { + enableHighAccuracy?: boolean, + timeout?: number, + noIpLocate?: boolean, + maximumAge?: number, + convert?: boolean, + showButton?: boolean, + buttonDom?: string|HTMLElement, + buttonPosition?: string, + buttonOffset?: Pixel, + showMarker?: boolean, + markerOptions?: MarkerOptions, + showCircle?: boolean, + circleOptions?: CircleOptions, + panToLocation?: boolean, + zoomToAccuracy?: boolean, + useNative?: boolean + }); + + isSupported(): boolean; + getCurrentPosition(): void; + watchPosition(): number; + clearWatch(watchId: number): number; + } + + interface GeolocationResult { + position: LngLat; + accuracy: number; + isConverted: boolean; + info: string; + } + + interface GeolocationError { + info: string; + } + + interface BusinessArea { + id: string; + name: string; + location: string; + } + + interface Road { + id: string; + name: string; + distance: number; + location: LngLat; + direction: string; + } + + interface Cross { + distance: number; + direction: string; + location: LngLat; + first_id: string; + first_name: string; + second_id: string; + second_name: string; + } + + interface AddressComponent { + province: string; + city: string; + citycode: string; + district: string; + adcode: string; + township: string; + street: string; + streetNumber: string; + neighborhood: string; + neighborhoodType: string; + building: string; + buildingType: string; + businessAreas: BusinessArea[]; + } + + interface Geocode { + addressComponent: AddressComponent; + formattedAddress: string; + location: LngLat; + adcode: string; + level: string; + } + + interface ReGeocode { + addressComponent: AddressComponent; + formattedAddress: string; + roads: Road[]; + crosses: Cross[]; + pois: ReGeocodePoi[]; + } + + interface ReGeocodePoi { + id: string; + name: string; + type: string; + tel: string; + distance: number; + direction: string; + address: string; + location: LngLat; + businessArea: string; + } + + interface GeocodeResult { + info: string; + geocodes: LngLat[]; + resultNum: number; + } + + interface ReGeocodeResult { + info: string; + regeocode: ReGeocode; + } + + class Geocoder { + constructor(opts?: { + city?: string, + radius?: number, + batch?: boolean, + extensions?: string + }); + + getLocation(address: string, callback?: (status?: string, result?: string | GeocodeResult) => void): void; + + setCity(city: string): void; + + getAddress(location: LngLat|LngLat[], callback: (status?: string, result?: string | ReGeocodeResult) => void): void; + } + + /** + * 坐标转换结果 + */ + interface ConvertorResult { + info: string; + locations: LngLat[]; + } + + /** + * 坐标转换 + */ + function convertFrom(lnglat: LngLat | LngLat[] | [number, number], type: string, result: (status: string, result: ConvertorResult) => void): void; + + interface Poi { + id: string; + name: string; + type: string; + location: LngLat; + address: string; + distance: number; + tel: string; + + website: string; + pcode: string; + citycode: string; + adcode: string; + postcode: string; + pname: string; + cityname: string; + adname: string; + email: string; + entr_location: LngLat; + exit_location: LngLat; + groupbuy: boolean; + discount: boolean; + } + + interface CitySearchResult { + city: string; + bounds: Bounds; + } + + class CitySearch extends EventBindable { + getLocalCity(callback: (status: string, result: string | CitySearchResult) => void): void; + getCityByIp(ip: string, callback: (status: string, result: string | CitySearchResult) => void): void; + } + + enum DrivingPolicy { + LEAST_TIME, + LEAST_FEE, + LEAST_DISTANCE, + REAL_TRAFFIC + } + + interface ViaCity { + name: string; + citycode: string; + adcode: string; + districts: District[]; + } + + interface District { + name: string; + adcode: string; + } + + interface TMC { + lcode: string; + distance: number; + status: string; + } + + interface DriveStep { + start_location: LngLat; + end_location: LngLat; + instruction: string; + action: string; + assist_action: string; + orientation: string; + road: string; + distance: number; + tolls: number; + tolls_distance: number; + toll_road: string; + time: number; + path: LngLat[]; + cities?: ViaCity[]; + tmcs?: TMC[]; + } + + interface DriveRoute { + distance: number; + time: number; + policy: string; + tolls: number; + tolls_distance: number; + steps: DriveStep[]; + } + + interface DrivingResult { + info: string; + origin: LngLat; + destination: LngLat|Poi; + start: Poi; + waypoints: Poi; + taxi_cost: number; + routes: DriveRoute[]; + } + + class Driving extends EventBindable { + constructor(options?: { + policy?: DrivingPolicy, + extensions?: string, + map?: Map, + panel?: string|HTMLElement, + hideMarkers?: boolean, + showTraffic?: boolean + }); + + search(origin: LngLat, destination: LngLat, opts?: { + waypoints: LngLat[] + }, callback?: (status: string, result: string|DrivingResult) => void): void; + + search(point: Array<{ + keyword: string, + city: string + }>, callback: (status: string, result: string|DrivingResult) => void): void; + + setPolicy(policy: DrivingPolicy): void; + setAvoidPolygons(path: LngLat[][]): void; + setAvoidRoad(road: string): void; + clearAvoidRoad(): void; + clearAvoidPolygons(): void; + getAvlidPolygons(): LngLat[][]; + getAvoidRoad(): string; + clear(): void; + searchOnAMAP(obj: { + origin?: LngLat, + originName?: string, + destination?: LngLat, + destinationName?: string + }): void; + } + + // 天气插件 + + interface WeatherLiveResult { + info: string; + province: string; + city: string; + adcode: string; + weather: string; + temperature: number; + windDirection: string; + windPower: number; + humidity: string; + reportTime: string; + } + + interface Forecast { + date: string; + week: string; + dayWeather: string; + nightWeather: string; + dayTemp: number; + nightTemp: number; + dayWindDir: string; + nightWindDir: string; + dayWindPower: string; + nightWindPower: string; + } + + interface WeatherForecastResult { + info: string; + province: string; + city: string; + adcode: string; + reportTime: string; + forecasts: Forecast[]; + } + + class Weather { + /** + * 查询实时天气信息 + * @param district 支持城市名称/区域编码(如:“杭州市”/“330100”) + * @param callback 当请求成功时ErrorStatus为null,当请求不成功时ErrorStatus为Obj + */ + getLive(district: string, callback: (errorStatus: any, result: WeatherLiveResult) => void): void; + + /** + * 查询四天预报天气,包括查询当天天气信息 + * @param district 支持城市名称/区域编码(如:“杭州市”/“330100”) + * @param callback 当请求成功时ErrorStatus为null,当请求不成功时ErrorStatus为Obj + */ + getForecast(district: string, callback: (errorStatus: any, result: WeatherForecastResult) => void): void; + } + + interface Tip { + name: string; + district: string; + adcode: string; + } + + interface AutocompleteResult { + info: string; + count: number; + tips: Tip[]; + } + + class Autocomplete { + constructor(opts: { + type?: string, + city?: string, + datatype?: string, + citylimit?: boolean, + input?: string + }); + + search(keyword: string, callback: (status: string, result: string | AutocompleteResult) => void): void; + } + + interface SelectChangeEvent { + type: string; + id: string; + marker: Marker; + listElement: HTMLLIElement; + data: Poi; + } + + interface PoiList { + pois: Poi[]; + pageIndex: number; + pageSize: number; + count: number; + } + + interface CityInfo { + name: string; + citycode: string; + adcode: string; + count: number; + } + + interface SearchResult { + info: string; + poiList: PoiList; + keywordList: string[]; + cityList: CityInfo[]; + } + + interface Photo { + title: string; + url: string; + } + + interface Content { + id: string; + name: string; + } + + interface Discount { + title: string; + detail: string; + start_time: string; + end_time: string; + sold_num: string; + photos: Photo[]; + url: string; + provider: string; + } + + interface Groupbuy { + title: string; + type_code: string; + type: string; + detail: string; + stime: string; + etime: string; + count: number; + sold_num: number; + original_price: number; + groupbuy_price: number; + discount: number; + ticket_address: string; + ticket_tel: string; + photos: Photo[]; + url: string; + provider: string; + } + + class PlaceSearch { + constructor(opts: { + city?: string, + citylimit?: boolean, + children?: number, + type?: string, + lang?: string, + pageSize?: number, + pageIndex?: number, + extensions?: string, + map?: Map, + panel?: string|HTMLElement, + showCover?: boolean, + renderStyle?: string, + autoFitView?: boolean + }); + + search(keyword: string, callback: (status: string, result: string | SearchResult) => void): void; + searchNearBy(keyword: string, center: LngLat, radius: number, callback: (status: string, result: string|SearchResult) => void): void; + searchInBounds(keyword: string, bounds: Bounds|Polygon, callback: (status: string, result: string|SearchResult) => void): void; + getDetails(POIID: string, callback: (status: string, result: string|SearchResult) => void): void; + setType(type: string): void; + setCityLimit(p: boolean): void; + setPageIndex(pageIndex: number): void; + setPageSize(setPageSize: number): void; + setCity(city: string): void; + setLang(lang: string): string; + getLang(): string; + clear(): void; + poiOnAMAP(obj: any): void; + detailOnAMAP(obj: any): void; + } + + interface DistrictSearchOptions { + level: string; + showbiz?: boolean; + extensions?: string; + subdistrict?: number; + } + + interface DistrictSearchResult { + info: string; + districtList: District[]; + } + + interface District { + name: string; + center: LngLat; + citycode: string; + adcode: string; + level: string; + boundaries: LngLat[]; + districtList: District[]; + } + + class DistrictSearch { + constructor(opts: DistrictSearchOptions); + + search(keywords: string, callback?: (status: string, result: string| DistrictSearchResult) => void, opts?: DistrictSearchOptions): void; + setLevel(level: string): void; + setSubdistrict(district: number): void; + } + } diff --git a/types/amap-js-sdk/tsconfig.json b/types/amap-js-sdk/tsconfig.json new file mode 100644 index 0000000000..ba4581a859 --- /dev/null +++ b/types/amap-js-sdk/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", + "amap-js-sdk-tests.ts" + ] +} diff --git a/types/amap-js-sdk/tslint.json b/types/amap-js-sdk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amap-js-sdk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/amplitude-js/amplitude-js-tests.ts b/types/amplitude-js/amplitude-js-tests.ts index 4f3c2ea307..0b6bb49751 100644 --- a/types/amplitude-js/amplitude-js-tests.ts +++ b/types/amplitude-js/amplitude-js-tests.ts @@ -1,85 +1,112 @@ // Tests for Amplitude SDK TypeScript definitions +import amplitude = require('amplitude-js'); + 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..10465f6647 100644 --- a/types/amplitude-js/index.d.ts +++ b/types/amplitude-js/index.d.ts @@ -1,61 +1,145 @@ -// 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 { - interface Config { - batchEvents?: boolean; - cookieExpiration?: number; - cookieName?: string; - deviceId?: string; - domain?: string; - eventUploadPeriodMillis?: number; - eventUploadThreshold?: number; - includeReferrer?: boolean; - includeUtm?: boolean; - language?: string; - optOut?: boolean; - platform?: string; - saveEvents?: boolean; - savedMaxCount?: number; - sessionTimeout?: number; - uploadBatchSize?: number; - } +export as namespace amplitude; - export class Identify { - set(key: string, value: any): Identify; - setOnce(key: string, value: any): Identify; - add(key: string, value: number): Identify; - append(key: string, value: any): Identify; - prepend(key: string, value: any): Identify; +type Callback = (responseCode: number, responseBody: string, details?: { reason: string; }) => void; +type LogReturn = number | void; - 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 function setVersionName(version: 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 setUserProperties(properties: Object): 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 var options: Config; +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 | string): Identify; + append(key: string, value: any): Identify; + prepend(key: string, value: any): Identify; + + unset(key: string): Identify; +} + +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, callback?: Callback): 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, 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/amqp-connection-manager/index.d.ts b/types/amqp-connection-manager/index.d.ts index ab69aadeb1..e2907b67ee 100644 --- a/types/amqp-connection-manager/index.d.ts +++ b/types/amqp-connection-manager/index.d.ts @@ -136,7 +136,16 @@ export interface ChannelWrapper extends EventEmitter { * Setup functions should, ideally, not throw errors, but if they do then the ChannelWrapper will emit an 'error' event. * @param func */ - addSetup(func: SetupFunc): Promise; + addSetup(func: SetupFunc): Promise; + + /** + * Remove a setup function added with `addSetup`. If there is currently a + * connection, `teardown(channel, [cb])` will be run immediately, and the + * returned Promise will not resolve until it completes. + * @param func + * @param [tearDown] + */ + removeSetup(func: SetupFunc, tearDown?: SetupFunc): Promise; /** * @see amqplib 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/analytics-node/analytics-node-tests.ts b/types/analytics-node/analytics-node-tests.ts index 6740aaccff..a7dc5336ec 100644 --- a/types/analytics-node/analytics-node-tests.ts +++ b/types/analytics-node/analytics-node-tests.ts @@ -1,10 +1,10 @@ import Analytics = require("analytics-node"); -var analytics: Analytics; +let analytics: Analytics; function testConfig(): void { analytics = new Analytics('YOUR_WRITE_KEY', { flushAt: 20, - flushAfter: 10000, + flushInterval: 10000, host: "http://example.com", enable: true }); @@ -33,7 +33,7 @@ function testIdentify(): void { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } @@ -59,7 +59,7 @@ function testTrack(): void { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } @@ -91,20 +91,20 @@ function testPage(): void { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } function testAlias(): void { // the anonymous user does actions ... - analytics.track({ userId: 'anonymous_user', event: 'Anonymous Event' }) + analytics.track({ userId: 'anonymous_user', event: 'Anonymous Event' }); // the anonymous user signs up and is aliased - analytics.alias({ previousId: 'anonymous_user', userId: 'identified@gmail.com' }) + analytics.alias({ previousId: 'anonymous_user', userId: 'identified@gmail.com' }); // the identified user is identified - analytics.identify({ userId: 'identified@gmail.com', traits: { plan: 'Free' } }) + analytics.identify({ userId: 'identified@gmail.com', traits: { plan: 'Free' } }); // the identified user does actions ... - analytics.track({ userId: 'identified@gmail.com', event: 'Identified Action' }) + analytics.track({ userId: 'identified@gmail.com', event: 'Identified Action' }); } function testGroup(): void { @@ -128,35 +128,41 @@ function testGroup(): void { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } function testIntegrations(): void { analytics.track({ - event: 'Upgraded Membershipt', + event: 'Upgraded Membership', userId: '97234974', integrations: { - 'All': false, - 'Vero': true, - 'Google Analytics': false + All: false, + Vero: true, + 'Google Analytics': false, + AppsFlyer: { + appsflyer_id: 'example-id' + } } }); analytics.track({ - event: 'Upgraded Membershipt', + event: 'Upgraded Membership', userId: '97234974', integrations: { - 'All': false, - 'Vero': true, - 'Google Analytics': false + All: false, + Vero: true, + 'Google Analytics': false, + AppsFlyer: { + appsflyer_id: 'example-id' + } } }, (err, data) => { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } @@ -164,8 +170,10 @@ function testIntegrations(): void { function testFlush(): void { analytics.flush(); analytics.flush((err, batch) => { - if (err) { alert("Oh nos!"); } - else { console.log(batch.batch[0].type); } + if (err) { + alert("Oh nos!"); + } else { + console.log(batch.batch[0].type); + } }); } - diff --git a/types/analytics-node/index.d.ts b/types/analytics-node/index.d.ts index 6834087ff7..168e0f17ea 100644 --- a/types/analytics-node/index.d.ts +++ b/types/analytics-node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Segment's analytics.js for Node.js +// Type definitions for analytics-node 3.1 // Project: https://segment.com/docs/libraries/node/ // Definitions by: Andrew Fong // Thomas Thiebaud @@ -19,27 +19,29 @@ declare namespace AnalyticsNode { _metadata: { nodeVersion: string; [key: string]: any; - }, + }; timestamp?: Date; messageId?: string; - anonymousId: string | number; - userId: string | number; + anonymousId?: string | number; + userId?: string | number; } interface Data { - batch: Message[], + batch: Message[]; timestamp: Date; sentAt: Date; } interface Integrations { - [index: string]: boolean; + [integration_name: string]: IntegrationValue; } - export class Analytics { + type IntegrationValue = boolean | { [integration_key: string]: any }; + + class Analytics { constructor(writeKey: string, opts?: { flushAt?: number, - flushAfter?: number, + flushInterval?: number, host?: string, enable?: boolean }); @@ -47,51 +49,55 @@ declare namespace AnalyticsNode { /* The identify method lets you tie a user to their actions and record traits about them. */ identify(message: { - userId: string | number; - traits?: Object; + userId?: string | number; + anonymousId?: string | number; + traits?: any; timestamp?: Date; - context?: Object; + context?: any; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; /* The track method lets you record the actions your users perform. */ track(message: { - userId: string | number; + userId?: string | number; + anonymousId?: string | number; event: string; - properties?: Object; + properties?: any; timestamp?: Date; - context?: Object; + context?: any; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; /* The page method lets you record page views on your website, along with optional extra information about the page being viewed. */ page(message: { - userId: string | number; + userId?: string | number; + anonymousId?: string | number; category?: string; name?: string; - properties?: Object; + properties?: any; timestamp?: Date; - context?: Object; + context?: any; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; /* alias is how you associate one identity with another. */ alias(message: { previousId: string | number; - userId: string | number; + userId?: string | number; + anonymousId?: string | number; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; /* Group calls can be used to associate individual users with shared accounts or companies. */ group(message: { - userId: string | number; + userId?: string | number; + anonymousId?: string | number; groupId: string | number; - traits?: Object; - context?: Object; + traits?: any; + context?: any; timestamp?: Date; - anonymous_id?: string | number; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; diff --git a/types/analytics-node/tslint.json b/types/analytics-node/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/analytics-node/tslint.json +++ b/types/analytics-node/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/angular-agility/tslint.json b/types/angular-agility/tslint.json index a41bf5d19a..67293bd146 100644 --- a/types/angular-agility/tslint.json +++ b/types/angular-agility/tslint.json @@ -74,6 +74,7 @@ "typedef-whitespace": false, "unified-signatures": false, "void-return": false, - "whitespace": false + "whitespace": false, + "no-angle-bracket-type-assertion": 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-locker/tslint.json b/types/angular-locker/tslint.json index a41bf5d19a..67293bd146 100644 --- a/types/angular-locker/tslint.json +++ b/types/angular-locker/tslint.json @@ -74,6 +74,7 @@ "typedef-whitespace": false, "unified-signatures": false, "void-return": false, - "whitespace": false + "whitespace": false, + "no-angle-bracket-type-assertion": false } } diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index 6885916e8a..19c6dcc9e5 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 { @@ -152,6 +153,10 @@ declare module 'angular' { defaultFontSet(name: string): IIconProvider; } + interface IInkRippleProvider { + disableInkRipple(): void; + } + type IMedia = (media: string) => boolean; interface ISidenavObject { @@ -339,7 +344,9 @@ declare module 'angular' { } interface IMenuService { + close(): void; 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-odata-resources/tslint.json b/types/angular-odata-resources/tslint.json index a41bf5d19a..67293bd146 100644 --- a/types/angular-odata-resources/tslint.json +++ b/types/angular-odata-resources/tslint.json @@ -74,6 +74,7 @@ "typedef-whitespace": false, "unified-signatures": false, "void-return": false, - "whitespace": false + "whitespace": false, + "no-angle-bracket-type-assertion": 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-resource/angular-resource-tests.ts b/types/angular-resource/angular-resource-tests.ts index c35f27a98d..f7b8db579c 100644 --- a/types/angular-resource/angular-resource-tests.ts +++ b/types/angular-resource/angular-resource-tests.ts @@ -90,6 +90,7 @@ angular.injector(['ng']).invoke(function ($cacheFactory: angular.ICacheFactorySe responseError() {} }; actionDescriptor.cancellable = true; + actionDescriptor.hasBody = true; }); /////////////////////////////////////// diff --git a/types/angular-resource/index.d.ts b/types/angular-resource/index.d.ts index 1ebd198b82..c298001533 100644 --- a/types/angular-resource/index.d.ts +++ b/types/angular-resource/index.d.ts @@ -88,6 +88,7 @@ declare module 'angular' { withCredentials?: boolean; responseType?: string; interceptor?: IResourceInterceptor; + hasBody?: boolean; } // Allow specify more resource methods 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-ui-tree/tslint.json b/types/angular-ui-tree/tslint.json index a41bf5d19a..67293bd146 100644 --- a/types/angular-ui-tree/tslint.json +++ b/types/angular-ui-tree/tslint.json @@ -74,6 +74,7 @@ "typedef-whitespace": false, "unified-signatures": false, "void-return": false, - "whitespace": false + "whitespace": false, + "no-angle-bracket-type-assertion": false } } 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/angular/angular-tests.ts b/types/angular/angular-tests.ts index 44f8539af2..b83a41a6df 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -1502,16 +1502,28 @@ interface MyScope extends ng.IScope { foo: string; } -const directiveCompileFnWithGeneric: ng.IDirectiveCompileFn = ( - templateElement: JQLite, - templateAttributes: ng.IAttributes, - transclude: ng.ITranscludeFunction - ): ng.IDirectiveLinkFn => { - return ( - scope: MyScope, - instanceElement: JQLite, - instanceAttributes: ng.IAttributes - ) => { - return null; - }; -}; +interface MyElement extends JQLite { + foo: string; +} + +interface MyAttributes extends ng.IAttributes { + foo: string; +} +interface MyController extends ng.INgModelController { + foo: string; +} + +angular.module('WithGenerics', []) + .directive('directiveUsingGenerics', () => { + return { + restrict: 'E', + link(scope: MyScope, element: MyElement, templateAttributes: MyAttributes, controller: MyController) { + scope['name'] = 'Jeff'; + } + }; + }) + .directive('linkFunctionUsingGenerics', () => { + return (scope: MyScope, element: MyElement, templateAttributes: MyAttributes, controller: MyController) => { + scope['name'] = 'Jeff'; + }; + }); diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index fe90fa15b8..4a8b26fba9 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -240,8 +240,9 @@ declare namespace angular { * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) * @param directiveFactory An injectable directive factory function. */ - directive(name: string, directiveFactory: Injectable>): IModule; - directive(object: {[directiveName: string]: Injectable>}): IModule; + directive(name: string, directiveFactory: Injectable>): IModule; + directive(object: {[directiveName: string]: Injectable>}): IModule; + /** * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. * @@ -1346,8 +1347,8 @@ declare namespace angular { } interface ICompileProvider extends IServiceProvider { - directive(name: string, directiveFactory: Injectable>): ICompileProvider; - directive(object: {[directiveName: string]: Injectable>}): ICompileProvider; + directive(name: string, directiveFactory: Injectable>): ICompileProvider; + directive(object: {[directiveName: string]: Injectable>}): ICompileProvider; component(name: string, options: IComponentOptions): ICompileProvider; component(object: {[componentName: string]: IComponentOptions}): ICompileProvider; @@ -2066,29 +2067,31 @@ declare namespace angular { // and http://docs.angularjs.org/guide/directive /////////////////////////////////////////////////////////////////////////// - interface IDirectiveFactory { - (...args: any[]): IDirective | IDirectiveLinkFn; + type IDirectiveController = IController | IController[] | {[key: string]: IController}; + + interface IDirectiveFactory { + (...args: any[]): IDirective | IDirectiveLinkFn; } - interface IDirectiveLinkFn { + interface IDirectiveLinkFn { ( scope: TScope, - instanceElement: JQLite, - instanceAttributes: IAttributes, - controller?: IController | IController[] | {[key: string]: IController}, + instanceElement: TElement, + instanceAttributes: TAttributes, + controller?: TController, transclude?: ITranscludeFunction ): void; } - interface IDirectivePrePost { - pre?: IDirectiveLinkFn; - post?: IDirectiveLinkFn; + interface IDirectivePrePost { + pre?: IDirectiveLinkFn; + post?: IDirectiveLinkFn; } - interface IDirectiveCompileFn { + interface IDirectiveCompileFn { ( - templateElement: JQLite, - templateAttributes: IAttributes, + templateElement: TElement, + templateAttributes: TAttributes, /** * @deprecated * Note: The transclude function that is passed to the compile function is deprecated, @@ -2096,11 +2099,11 @@ declare namespace angular { * that is passed to the link function instead. */ transclude: ITranscludeFunction - ): void | IDirectiveLinkFn | IDirectivePrePost; + ): void | IDirectiveLinkFn | IDirectivePrePost; } - interface IDirective { - compile?: IDirectiveCompileFn; + interface IDirective { + compile?: IDirectiveCompileFn; controller?: string | Injectable; controllerAs?: string; /** @@ -2109,7 +2112,7 @@ declare namespace angular { * relies upon bindings inside a $onInit method on the controller, instead. */ bindToController?: boolean | {[boundProperty: string]: string}; - link?: IDirectiveLinkFn | IDirectivePrePost; + link?: IDirectiveLinkFn | IDirectivePrePost; multiElement?: boolean; priority?: number; /** @@ -2119,9 +2122,9 @@ declare namespace angular { require?: string | string[] | {[controller: string]: string}; restrict?: string; scope?: boolean | {[boundProperty: string]: string}; - template?: string | ((tElement: JQLite, tAttrs: IAttributes) => string); + template?: string | ((tElement: TElement, tAttrs: TAttributes) => string); templateNamespace?: string; - templateUrl?: string | ((tElement: JQLite, tAttrs: IAttributes) => string); + templateUrl?: string | ((tElement: TElement, tAttrs: TAttributes) => string); terminal?: boolean; transclude?: boolean | 'element' | {[slot: string]: string}; } diff --git a/types/angular/jqlite.d.ts b/types/angular/jqlite.d.ts index a9da89cf65..ac4f8ec10c 100644 --- a/types/angular/jqlite.d.ts +++ b/types/angular/jqlite.d.ts @@ -774,6 +774,7 @@ interface BaseJQueryEventObject extends Event { pageY: number; /** * For key or mouse events, this property indicates the specific key or button that was pressed. + * @deprecated Use `key` for KeyEvents or `button` for MouseEvents instead. * @see {@link https://api.jquery.com/event.which/} */ which: number; @@ -804,9 +805,12 @@ interface JQueryMouseEventObject extends JQueryInputEventObject { } interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; + /** @deprecated */ + char: string; + /** @deprecated */ charCode: number; - key: any; + key: string; + /** @deprecated */ keyCode: number; } diff --git a/types/angular/test/jquery3-merging-tests.ts b/types/angular/test/jquery3-merging-tests.ts index 507c58b67e..da61a6f0bc 100644 --- a/types/angular/test/jquery3-merging-tests.ts +++ b/types/angular/test/jquery3-merging-tests.ts @@ -94,8 +94,6 @@ function JQuery() { } function bind() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').bind('myEvent', 'myData', function(event) { // TODO: $ExpectType HTMLElement @@ -104,14 +102,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('p').bind('myEvent', 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('p').bind('myEvent', function(event) { // TODO: $ExpectType HTMLElement @@ -120,14 +110,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('p').bind('myEvent', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('p').bind('myEvent', false); @@ -139,12 +121,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }); @@ -164,27 +140,15 @@ function JQuery() { } function off() { - function defaultContext_defaultData(this: HTMLElement, event: JQueryEventObject) { } + function defaultData(this: HTMLElement, event: JQueryEventObject) { } - function defaultContext_customData(this: HTMLElement, event: JQueryEventObject) { } - - function customContext_defaultData(this: I1, event: JQueryEventObject) { } - - function customContext_customData(this: I1, event: JQueryEventObject) { } - - interface I1 { kind: 'I1'; } + function customData(this: HTMLElement, event: JQueryEventObject) { } // $ExpectType JQuery - $('table').off('myEvent', 'td', defaultContext_defaultData); + $('table').off('myEvent', 'td', defaultData); // $ExpectType JQuery - $('table').off('myEvent', 'td', defaultContext_customData); - - // $ExpectType JQuery - $('table').off('myEvent', 'td', customContext_defaultData); - - // $ExpectType JQuery - $('table').off('myEvent', 'td', customContext_customData); + $('table').off('myEvent', 'td', customData); // $ExpectType JQuery $('table').off('myEvent', 'td', false); @@ -193,16 +157,10 @@ function JQuery() { $('table').off('myEvent', 'td'); // $ExpectType JQuery - $('table').off('myEvent', defaultContext_defaultData); + $('table').off('myEvent', defaultData); // $ExpectType JQuery - $('table').off('myEvent', defaultContext_customData); - - // $ExpectType JQuery - $('table').off('myEvent', customContext_defaultData); - - // $ExpectType JQuery - $('table').off('myEvent', customContext_customData); + $('table').off('myEvent', customData); // $ExpectType JQuery $('table').off('myEvent', false); @@ -213,19 +171,15 @@ function JQuery() { // $ExpectType JQuery $('table').off({ myEvent1: false, - defaultContext_defaultData, - defaultContext_customData, - customContext_defaultData, - customContext_customData + defaultData, + customData }, 'td'); // $ExpectType JQuery $('table').off({ myEvent1: false, - defaultContext_defaultData, - defaultContext_customData, - customContext_defaultData, - customContext_customData + defaultData, + customData }); // $ExpectType JQuery @@ -236,8 +190,6 @@ function JQuery() { } function on() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('table').on('myEvent', 'td', 'myData', function(event) { // TODO: $ExpectType HTMLElement @@ -246,14 +198,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').on('myEvent', 'td', 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').on('myEvent', null, 'myData', function(event) { // TODO: $ExpectType HTMLElement @@ -262,14 +206,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').on('myEvent', null, 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').on('myEvent', 'td', function(event) { // TODO: $ExpectType HTMLElement @@ -278,14 +214,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').on('myEvent', 'td', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').on('myEvent', 'td', false); @@ -297,14 +225,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').on('myEvent', 3, function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').on('myEvent', function(event) { // TODO: $ExpectType HTMLElement @@ -313,14 +233,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').on('myEvent', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').on('myEvent', false); @@ -332,12 +244,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }, 'td', 'myData'); @@ -349,12 +255,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }, null, 'myData'); @@ -366,12 +266,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }, 'td'); @@ -383,12 +277,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }, 3); @@ -400,19 +288,11 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }); } function one() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('table').one('myEvent', 'td', 'myData', function(event) { // TODO: $ExpectType HTMLElement @@ -421,14 +301,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').one('myEvent', 'td', 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').one('myEvent', null, 'myData', function(event) { // TODO: $ExpectType HTMLElement @@ -437,14 +309,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').one('myEvent', null, 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').one('myEvent', 'td', function(event) { // TODO: $ExpectType HTMLElement @@ -453,14 +317,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').one('myEvent', 'td', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').one('myEvent', 'td', false); @@ -472,14 +328,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').one('myEvent', 3, function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').one('myEvent', function(event) { // TODO: $ExpectType HTMLElement @@ -488,14 +336,6 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').one('myEvent', function(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; - }); - // $ExpectType JQuery $('table').one('myEvent', false); @@ -507,12 +347,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }, 'td', 'myData'); @@ -524,12 +358,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }, null, 'myData'); @@ -541,12 +369,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }, 'td'); @@ -558,12 +380,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }, 3); @@ -575,12 +391,6 @@ function JQuery() { this; // TODO: $ExpectType Event event; - }, - myEvent3(this: I1, event) { - // $ExpectType I1 - this; - // TODO: $ExpectType Event - event; } }); } diff --git a/types/angularfire/tslint.json b/types/angularfire/tslint.json index a41bf5d19a..67293bd146 100644 --- a/types/angularfire/tslint.json +++ b/types/angularfire/tslint.json @@ -74,6 +74,7 @@ "typedef-whitespace": false, "unified-signatures": false, "void-return": false, - "whitespace": false + "whitespace": false, + "no-angle-bracket-type-assertion": 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-colors/ansi-colors-tests.ts b/types/ansi-colors/ansi-colors-tests.ts index 9a9afc43f4..c267e879eb 100644 --- a/types/ansi-colors/ansi-colors-tests.ts +++ b/types/ansi-colors/ansi-colors-tests.ts @@ -1,30 +1,35 @@ -import * as colors from 'ansi-colors'; +import colors = require('ansi-colors'); -let s: string; +colors.red('This is a red string!'); // $ExpectType string +colors.green('This is a red string!'); // $ExpectType string +colors.cyan('This is a cyan string!'); // $ExpectType string +colors.yellow('This is a yellow string!'); // $ExpectType string -s = colors.bgblack("hello"); -s = colors.bgblue("hello"); -s = colors.bgcyan("hello"); -s = colors.bggreen("hello"); -s = colors.bgmagenta("hello"); -s = colors.bgred("hello"); -s = colors.bgwhite("hello"); -s = colors.bgyellow("hello"); -s = colors.black("hello"); -s = colors.blue("hello"); -s = colors.bold("hello"); -s = colors.cyan("hello"); -s = colors.dim("hello"); -s = colors.gray("hello"); -s = colors.green("hello"); -s = colors.grey("hello"); -s = colors.hidden("hello"); -s = colors.inverse("hello"); -s = colors.italic("hello"); -s = colors.magenta("hello"); -s = colors.red("hello"); -s = colors.reset("hello"); -s = colors.strikethrough("hello"); -s = colors.underline("hello"); -s = colors.white("hello"); -s = colors.yellow("hello"); +colors.bold.red('this is a bold red message'); // $ExpectType string +colors.bold.yellow.italic('this is a bold yellow italicized message'); // $ExpectType string +colors.green.bold.underline('this is a bold green underlined message'); // $ExpectType string + +colors.yellow(`foo ${colors.red.bold('red')} bar ${colors.cyan('cyan')} baz`); // $ExpectType string +colors.bold(`foo ${colors.red.dim('bar')} baz`); // $ExpectType string + +colors.enabled = false; +colors.visible = false; + +colors.hasAnsi(colors.blue('foo')); // $ExpectType boolean +colors.hasColor(colors.blue('foo')); // $ExpectType boolean + +colors.unstyle(colors.blue.bold('foo bar baz')); // $ExpectType string +colors.stripColor(colors.blue.bold('foo bar baz')); // $ExpectType string + +colors.none('foo'); // $ExpectType string +colors.clear('foo'); // $ExpectType string +colors.noop('foo'); // $ExpectType string + +colors.define('reset', [0, 0], 'modifier'); + +colors.symbols.ballotCross; // $ExpectType string | undefined +colors.symbols.windows.ballotCross; // $ExpectError +colors.symbols.other.ballotCross; // $ExpectType string +colors.symbols.cross; // $ExpectType string +colors.symbols.windows.cross; // $ExpectType string +colors.symbols.other.cross; // $ExpectType string diff --git a/types/ansi-colors/index.d.ts b/types/ansi-colors/index.d.ts index 092c4c1f2b..0cf9cd0d9f 100644 --- a/types/ansi-colors/index.d.ts +++ b/types/ansi-colors/index.d.ts @@ -1,31 +1,111 @@ -// Type definitions for ansi-colors 1.0 +// Type definitions for ansi-colors 3.2 // Project: https://github.com/doowb/ansi-colors // Definitions by: Rogier Schouten +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -export function bgblack(s: string): string; -export function bgblue(s: string): string; -export function bgcyan(s: string): string; -export function bggreen(s: string): string; -export function bgmagenta(s: string): string; -export function bgred(s: string): string; -export function bgwhite(s: string): string; -export function bgyellow(s: string): string; -export function black(s: string): string; -export function blue(s: string): string; -export function bold(s: string): string; -export function cyan(s: string): string; -export function dim(s: string): string; -export function gray(s: string): string; -export function green(s: string): string; -export function grey(s: string): string; -export function hidden(s: string): string; -export function inverse(s: string): string; -export function italic(s: string): string; -export function magenta(s: string): string; -export function red(s: string): string; -export function reset(s: string): string; -export function strikethrough(s: string): string; -export function underline(s: string): string; -export function white(s: string): string; -export function yellow(s: string): string; +export = colors; + +declare const colors: colors.Colors; + +declare namespace colors { + type ColorFn = ((text: string) => string) & Colors; + + interface Colors { + enabled: boolean; + visible: boolean; + + reset: ColorFn; + bold: ColorFn; + dim: ColorFn; + italic: ColorFn; + underline: ColorFn; + inverse: ColorFn; + hidden: ColorFn; + strikethrough: ColorFn; + + black: ColorFn; + red: ColorFn; + green: ColorFn; + yellow: ColorFn; + blue: ColorFn; + magenta: ColorFn; + cyan: ColorFn; + white: ColorFn; + gray: ColorFn; + grey: ColorFn; + + bgBlack: ColorFn; + bgRed: ColorFn; + bgGreen: ColorFn; + bgYellow: ColorFn; + bgBlue: ColorFn; + bgMagenta: ColorFn; + bgCyan: ColorFn; + bgWhite: ColorFn; + + blackBright: ColorFn; + redBright: ColorFn; + greenBright: ColorFn; + yellowBright: ColorFn; + blueBright: ColorFn; + magentaBright: ColorFn; + cyanBright: ColorFn; + whiteBright: ColorFn; + + bgBlackBright: ColorFn; + bgRedBright: ColorFn; + bgGreenBright: ColorFn; + bgYellowBright: ColorFn; + bgBlueBright: ColorFn; + bgMagentaBright: ColorFn; + bgCyanBright: ColorFn; + bgWhiteBright: ColorFn; + + hasColor(text: string): boolean; + hasAnsi(text: string): boolean; + unstyle(text: string): string; + stripColor(text: string): string; + none(text: string): string; + clear(text: string): string; + noop(text: string): string; + + symbols: Symbols & { + windows: WindowsSymbols; + other: OtherPlatformsSymbols; + }; + + define( + name: string, + codes: [number, number], + type: 'modifier' | 'color' | 'bg' | 'bright' | 'bgBright' + ): void; + } + + interface WindowsSymbols { + bullet: string; + check: string; + cross: string; + ellipsis: string; + heart: string; + info: string; + line: string; + middot: string; + minus: string; + plus: string; + question: string; + questionSmall: string; + pointer: string; + pointerSmall: string; + warning: string; + } + + interface ExtendedSymbols { + ballotCross: string; + questionFull: string; + } + + type Symbols = WindowsSymbols & Partial; + type OtherPlatformsSymbols = WindowsSymbols & ExtendedSymbols; +} diff --git a/types/ansi-colors/tsconfig.json b/types/ansi-colors/tsconfig.json index ebd56021f9..8a0f980cbc 100644 --- a/types/ansi-colors/tsconfig.json +++ b/types/ansi-colors/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "ansi-colors-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ansi-colors/v1/ansi-colors-tests.ts b/types/ansi-colors/v1/ansi-colors-tests.ts new file mode 100644 index 0000000000..9a9afc43f4 --- /dev/null +++ b/types/ansi-colors/v1/ansi-colors-tests.ts @@ -0,0 +1,30 @@ +import * as colors from 'ansi-colors'; + +let s: string; + +s = colors.bgblack("hello"); +s = colors.bgblue("hello"); +s = colors.bgcyan("hello"); +s = colors.bggreen("hello"); +s = colors.bgmagenta("hello"); +s = colors.bgred("hello"); +s = colors.bgwhite("hello"); +s = colors.bgyellow("hello"); +s = colors.black("hello"); +s = colors.blue("hello"); +s = colors.bold("hello"); +s = colors.cyan("hello"); +s = colors.dim("hello"); +s = colors.gray("hello"); +s = colors.green("hello"); +s = colors.grey("hello"); +s = colors.hidden("hello"); +s = colors.inverse("hello"); +s = colors.italic("hello"); +s = colors.magenta("hello"); +s = colors.red("hello"); +s = colors.reset("hello"); +s = colors.strikethrough("hello"); +s = colors.underline("hello"); +s = colors.white("hello"); +s = colors.yellow("hello"); diff --git a/types/ansi-colors/v1/index.d.ts b/types/ansi-colors/v1/index.d.ts new file mode 100644 index 0000000000..092c4c1f2b --- /dev/null +++ b/types/ansi-colors/v1/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for ansi-colors 1.0 +// Project: https://github.com/doowb/ansi-colors +// Definitions by: Rogier Schouten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function bgblack(s: string): string; +export function bgblue(s: string): string; +export function bgcyan(s: string): string; +export function bggreen(s: string): string; +export function bgmagenta(s: string): string; +export function bgred(s: string): string; +export function bgwhite(s: string): string; +export function bgyellow(s: string): string; +export function black(s: string): string; +export function blue(s: string): string; +export function bold(s: string): string; +export function cyan(s: string): string; +export function dim(s: string): string; +export function gray(s: string): string; +export function green(s: string): string; +export function grey(s: string): string; +export function hidden(s: string): string; +export function inverse(s: string): string; +export function italic(s: string): string; +export function magenta(s: string): string; +export function red(s: string): string; +export function reset(s: string): string; +export function strikethrough(s: string): string; +export function underline(s: string): string; +export function white(s: string): string; +export function yellow(s: string): string; diff --git a/types/ansi-colors/v1/tsconfig.json b/types/ansi-colors/v1/tsconfig.json new file mode 100644 index 0000000000..8321162c90 --- /dev/null +++ b/types/ansi-colors/v1/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ansi-colors": [ + "ansi-colors/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ansi-colors-tests.ts" + ] +} diff --git a/types/ansi-colors/v1/tslint.json b/types/ansi-colors/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ansi-colors/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ansi-regex/ansi-regex-tests.ts b/types/ansi-regex/ansi-regex-tests.ts index a5787902f0..d4217e9608 100644 --- a/types/ansi-regex/ansi-regex-tests.ts +++ b/types/ansi-regex/ansi-regex-tests.ts @@ -9,5 +9,8 @@ ansiRegex().test('\u001B[4mcake\u001B[0m'); // $ExpectType boolean ansiRegex().test('cake'); // $ExpectType boolean // => false +ansiRegex({onlyFirst: true}).test('cake'); // $ExpectType boolean +// => false + '\u001B[4mcake\u001B[0m'.match(ansiRegex()); // $ExpectType RegExpMatchArray | null // => ['\u001B[4m', '\u001B[0m'] diff --git a/types/ansi-regex/index.d.ts b/types/ansi-regex/index.d.ts index 34890912dc..52979125f7 100644 --- a/types/ansi-regex/index.d.ts +++ b/types/ansi-regex/index.d.ts @@ -1,7 +1,16 @@ -// Type definitions for ansi-regex 3.0 +// Type definitions for ansi-regex 4.0 // Project: https://github.com/chalk/ansi-regex#readme // Definitions by: Manish Vachharajani +// Florian Keller // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function r(): RegExp; -export = r; +declare namespace ansiRegex { + interface Options { + /** Match only the first ANSI escape. */ + onlyFirst?: boolean; + } +} + +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; 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..0c033c6839 --- /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()}`); + + ((cursor[color] as (...anything: any[]) => ansi.Cursor)() + .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/ansicolors/index.d.ts b/types/ansicolors/index.d.ts index 6750283895..dd1a872e57 100644 --- a/types/ansicolors/index.d.ts +++ b/types/ansicolors/index.d.ts @@ -1,8 +1,45 @@ // Type definitions for ansicolors // Project: https://github.com/thlorenz/ansicolors -// Definitions by: rogierschouten +// Definitions by: Benjamin Arthur Lupton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare var colors: { [index: string]: (s: string) => string; }; -export = colors; +interface Colors extends String { + (value: string): string + white: this + black: this + blue: this + cyan: this + green: this + magenta: this + red: this + yellow: this + brightBlack: this + brightRed: this + brightGreen: this + brightYellow: this + brightBlue: this + brightMagenta: this + brightCyan: this + brightWhite: this + bgBlack: this + bgRed: this + bgGreen: this + bgYellow: this + bgBlue: this + bgMagenta: this + bgCyan: this + bgWhite: this + bgBrightBlack: this + bgBrightRed: this + bgBrightGreen: this + bgBrightYellow: this + bgBrightBlue: this + bgBrightMagenta: this + bgBrightCyan: this + bgBrightWhite: this + open: this + close: this + colors: this +} +declare const colors: Colors +export default colors 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/index.d.ts b/types/apostrophe/index.d.ts index 7083405e8e..9c415a3931 100644 --- a/types/apostrophe/index.d.ts +++ b/types/apostrophe/index.d.ts @@ -7,7 +7,10 @@ export = apostrophe; export as namespace apos; -declare function apostrophe(options: any, ...args: any[]): any; +declare function apostrophe( + options: apostrophe.AposConstructor, + ...args: any[] +): any; declare namespace apostrophe { const moogBundle: { @@ -15,6 +18,20 @@ declare namespace apostrophe { 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: ( @@ -128,6 +145,9 @@ declare namespace apostrophe { required?: boolean; options?: AposObject; choices?: SelectChoice[]; + widgetType?: string; + titleField?: string; + schema?: Field[]; } interface SelectChoice { @@ -297,6 +317,7 @@ declare namespace apostrophe { label: string; fields: string[]; }[]; + beforeConstruct?: (self: any, options: any) => any; defer?: boolean; filters?: { projection?: { 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/universal-router/tslint.json b/types/app-module-path/tslint.json similarity index 100% rename from types/universal-router/tslint.json rename to types/app-module-path/tslint.json diff --git a/types/applicationinsights-js/applicationinsights-js-tests.ts b/types/applicationinsights-js/applicationinsights-js-tests.ts index c2adb63a30..de6de9a2c6 100644 --- a/types/applicationinsights-js/applicationinsights-js-tests.ts +++ b/types/applicationinsights-js/applicationinsights-js-tests.ts @@ -47,7 +47,8 @@ appInsights = { startTrackEvent(name: string) { return null; }, stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, - trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) { return null; }, + trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, + resultCode: number, properties?: { [name: string]: string }, measurements?: { [name: string]: number }) { return null; }, trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null; }, trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null; }, trackTrace(message: string, properties?: { [name: string]: string; }, severityLevel?: AI.SeverityLevel) { return null; }, @@ -86,7 +87,7 @@ appInsights.trackTrace("message", null); appInsights.trackTrace("message", { a: '1', b: '2' }, AI.SeverityLevel.Error); // trackDependency -appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null); +appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null, {prop1: 'abc'}, {meas1: 4.5}); // flush appInsights.flush(); diff --git a/types/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts index 5fbbc3a0f5..002a950637 100644 --- a/types/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -670,14 +670,16 @@ declare module Microsoft.ApplicationInsights { context: ITelemetryContext; queue: Array<() => void>; /** - * Starts timing how long the user views a page or other item. Call this when the page opens. - * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. + * Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops, + * but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view + * and send the event. * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ startTrackPage(name?: string): any; /** - * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. - * @param name The string you used as the name in startTrackPage. Defaults to the document title. + * Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements. + * The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`. + * @param name The string you used as the name in `startTrackPage`. Defaults to the document title. * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. @@ -689,7 +691,7 @@ declare module Microsoft.ApplicationInsights { measurements?: { [name: string]: number }): any; /** * Logs that a page or other item was viewed. - * @param name The string you used as the name in startTrackPage. Defaults to the document title. + * @param name The string you used as the name in `startTrackPage`. Defaults to the document title. * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. @@ -701,13 +703,13 @@ declare module Microsoft.ApplicationInsights { properties?: { [name: string]: string }, measurements?: { [name: string]: number }, duration?: number): any; /** - * Start timing an extended event. Call {@link stopTrackEvent} to log the event when it ends. + * Start timing an extended event. Call `stopTrackEvent` to log the event when it ends. * @param name A string that identifies this event uniquely within the document. */ startTrackEvent(name: string): any; /** - * Log an extended event that you started timing with {@link startTrackEvent}. - * @param name The string you used to identify this event in startTrackEvent. + * Log an extended event that you started timing with `startTrackEvent`. + * @param name The string you used to identify this event in `startTrackEvent`. * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. */ @@ -734,8 +736,11 @@ declare module Microsoft.ApplicationInsights { * @param totalTime total request time * @param success indicates if the request was sessessful * @param resultCode response code returned by the dependency request + * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. + * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. */ - trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number): any; + trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, + properties?: { [name: string]: string }, measurements?: { [name: string]: number }): any; /** * Log an exception you have caught. * @param exception An Error from a catch clause, or the string error message. diff --git a/types/arangodb/arangodb-tests.ts b/types/arangodb/arangodb-tests.ts index e049a2374d..c2ade4d0bb 100644 --- a/types/arangodb/arangodb-tests.ts +++ b/types/arangodb/arangodb-tests.ts @@ -16,6 +16,9 @@ coll.save({ username: "user" }); const doc = coll.any(); console.log(doc.username); +const coll2 = db._collection(coll.name()); +console.log(coll2 === coll); + const users = coll as ArangoDB.Collection; const admin = users.firstExample({ username: "admin" })!; users.update(admin, { password: md5("hunter2") }); diff --git a/types/arangodb/index.d.ts b/types/arangodb/index.d.ts index 32ad04210b..c5e83a1cfc 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 /// @@ -619,6 +619,7 @@ declare namespace ArangoDB { interface Collection { // Collection + name(): string; checksum( withRevisions?: boolean, withData?: boolean @@ -1440,6 +1441,72 @@ 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 +1765,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 28e51384c9..4e43778473 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,48 +1,55 @@ -// Type definitions for ArcGIS API for JavaScript 4.9 +// Type definitions for ArcGIS API for JavaScript 4.10 // Project: http://js.arcgis.com // Definitions by: Esri // Bjorn Svensson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 - interface HashMap { [index: string]: T; } interface IPromiseLike { - then(onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null): IPromiseLike; + then( + onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, + onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null + ): IPromiseLike; } interface IPromise { - always(callback?: ((valueOrError: T | any) => TResult1 | IPromiseLike) | undefined | null): IPromise; + always( + callback?: ((valueOrError: T | any) => TResult1 | IPromiseLike) | undefined | null + ): IPromise; cancel?(reason?: U, strict?: boolean): U; - catch(onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null): IPromise; + catch( + onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null + ): IPromise; isCanceled?(): boolean; isFulfilled(): boolean; isRejected(): boolean; isResolved(): boolean; - otherwise(onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null): IPromise; - then(onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null): IPromise; + otherwise( + onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null + ): IPromise; + then( + onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, + onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null + ): IPromise; } interface IHandle { remove(): void; } - - declare namespace JSX { interface IntrinsicElements { [elementName: string]: any; } - interface Element { - } + interface Element {} } declare namespace __esri { - export class Accessor { constructor(obj?: any); @@ -70,8 +77,6 @@ declare namespace __esri { set?(props: HashMap): this; watch?(path: string | string[], callback: WatchCallback, sync?: boolean): WatchHandle; } - - export type ItemCallback = (item: T, index: number) => void; @@ -134,16 +139,15 @@ declare namespace __esri { static isCollection(value: any | Collection): value is Collection; - static ofType(type: Constructor | Types): new (items?: (T[] | Collection) | { items?: T[] | Collection }) => Collection; + static ofType( + type: Constructor | Types + ): new (items?: (T[] | Collection) | { items?: T[] | Collection }) => Collection; } type CollectionProperties = T[] | Collection; - - type DateProperties = number | string | Date; - export type BaseDynamicLayerLayerviewCreateEventHandler = (event: BaseDynamicLayerLayerviewCreateEvent) => void; export type BaseDynamicLayerLayerviewDestroyEventHandler = (event: BaseDynamicLayerLayerviewDestroyEvent) => void; @@ -160,6 +164,14 @@ declare namespace __esri { export type BingMapsLayerLayerviewDestroyEventHandler = (event: BingMapsLayerLayerviewDestroyEvent) => void; + export type BuildingSceneLayerLayerviewCreateEventHandler = (event: BuildingSceneLayerLayerviewCreateEvent) => void; + + export type BuildingSceneLayerLayerviewDestroyEventHandler = (event: BuildingSceneLayerLayerviewDestroyEvent) => void; + + export type CredentialDestroyEventHandler = (event: CredentialDestroyEvent) => void; + + export type CredentialTokenChangeEventHandler = (event: CredentialTokenChangeEvent) => void; + export type CSVLayerLayerviewCreateEventHandler = (event: CSVLayerLayerviewCreateEvent) => void; export type CSVLayerLayerviewDestroyEventHandler = (event: CSVLayerLayerviewDestroyEvent) => void; @@ -186,17 +198,15 @@ declare namespace __esri { export type GroupLayerLayerviewDestroyEventHandler = (event: GroupLayerLayerviewDestroyEvent) => void; - export type IdentityManagerCredentialCreateEventHandler = (event: IdentityManagerCredentialCreateEvent) => void; - - export type IdentityManagerCredentialsDestroyEventHandler = (event: IdentityManagerCredentialsDestroyEvent) => void; - export type ImageryLayerLayerviewCreateEventHandler = (event: ImageryLayerLayerviewCreateEvent) => void; export type ImageryLayerLayerviewDestroyEventHandler = (event: ImageryLayerLayerviewDestroyEvent) => void; export type IntegratedMeshLayerLayerviewCreateEventHandler = (event: IntegratedMeshLayerLayerviewCreateEvent) => void; - export type IntegratedMeshLayerLayerviewDestroyEventHandler = (event: IntegratedMeshLayerLayerviewDestroyEvent) => void; + export type IntegratedMeshLayerLayerviewDestroyEventHandler = ( + event: IntegratedMeshLayerLayerviewDestroyEvent + ) => void; export type KMLLayerLayerviewCreateEventHandler = (event: KMLLayerLayerviewCreateEvent) => void; @@ -249,63 +259,63 @@ declare namespace __esri { interface Basemap extends Accessor, Loadable, JSONSupport { /** * A collection of tile layers that make up the basemap's features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) */ baseLayers: Collection; /** * An identifier used to refer to the basemap when referencing it elsewhere. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#id) */ id: string; /** * Indicates whether the basemap instance has loaded. When `true`, all the properties of the object can be accessed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#portalItem) */ portalItem: PortalItem; /** * A collection of tiled reference layers for displaying labels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) */ referenceLayers: Collection; /** * The URL pointing to an image that represents the basemap. When using a custom basemap in the [BasemapToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) widget, the image specified here will display in the widget. When the user clicks the image, the map's basemap will update to the basemap associated with the image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#thumbnailUrl) */ thumbnailUrl: string; /** * The title of the basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#title) */ title: string; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#clone) - * - * + * + * */ 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; } @@ -313,20 +323,19 @@ declare namespace __esri { interface BasemapConstructor { /** * Creates a new basemap object. Basemaps can be created from a [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html), from a well known [basemap ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#fromId), or can be used for creating custom basemaps. These basemaps may be created from tiled services you publish to your own server, or from tiled services published by third parties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) */ - new(properties?: BasemapProperties): Basemap; - + new (properties?: BasemapProperties): Basemap; /** * Creates a new basemap instance from a [well known basemap ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). See [Map.basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) for a list of possible values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#fromId) - * + * * @param id The basemap ID. - * + * */ fromId(id: string): Basemap; @@ -338,37 +347,37 @@ declare namespace __esri { interface BasemapProperties extends LoadableProperties { /** * A collection of tile layers that make up the basemap's features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) */ baseLayers?: CollectionProperties; /** * An identifier used to refer to the basemap when referencing it elsewhere. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#id) */ id?: string; /** * The portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#portalItem) */ portalItem?: PortalItemProperties; /** * A collection of tiled reference layers for displaying labels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) */ referenceLayers?: CollectionProperties; /** * The URL pointing to an image that represents the basemap. When using a custom basemap in the [BasemapToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) widget, the image specified here will display in the widget. When the user clicks the image, the map's basemap will update to the basemap associated with the image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#thumbnailUrl) */ thumbnailUrl?: string; /** * The title of the basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#title) */ title?: string; @@ -377,42 +386,42 @@ declare namespace __esri { interface Camera extends Accessor, JSONSupport { /** * The field of view of the camera in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#fov) - * + * * @default 55 */ fov: number; /** * The compass heading of the camera in degrees. Heading is zero when north is the top of the screen. It increases as the view rotates clockwise. The angles are always normalized between 0 and 360 degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) - * + * * @default 0 */ heading: number; /** - * The position of the camera defined by a map point. + * The position of the camera defined by a map point. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) */ position: Point; /** * The tilt of the camera in degrees with respect to the surface as projected down from the camera position. Tilt is zero when looking straight down at the surface and 90 degrees when the camera is looking parallel to the surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt) - * + * * @default 0 */ tilt: number; /** * Creates a deep clone of the camera object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone) - * - * + * + * */ clone(): Camera; } @@ -420,11 +429,11 @@ declare namespace __esri { interface CameraConstructor { /** * The camera defines the [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position), [tilt](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt), and [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) of the point from which the [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) visible extent is observed. It is not associated with device hardware. This class only applies to 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-Camera.html) */ - new(properties?: CameraProperties): Camera; + new (properties?: CameraProperties): Camera; fromJSON(json: any): Camera; } @@ -434,32 +443,32 @@ declare namespace __esri { interface CameraProperties { /** * The field of view of the camera in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#fov) - * + * * @default 55 */ fov?: number; /** * The compass heading of the camera in degrees. Heading is zero when north is the top of the screen. It increases as the view rotates clockwise. The angles are always normalized between 0 and 360 degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) - * + * * @default 0 */ heading?: number; /** - * The position of the camera defined by a map point. + * The position of the camera defined by a map point. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) */ position?: PointProperties; /** * The tilt of the camera in degrees with respect to the surface as projected down from the camera position. Tilt is zero when looking straight down at the surface and 90 degrees when the camera is looking parallel to the surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt) - * + * * @default 0 */ tilt?: number; @@ -468,158 +477,157 @@ declare namespace __esri { interface Color { /** * The alpha value. This value can be any number between `0` and `1` and represents the opacity of the Color. `0` indicates the color is fully transparent and `1` indicates it is fully opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#a) */ a: number; /** * The blue value. This value can range between `0` and `255`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#b) */ b: number; /** * The green value. This value can range between `0` and `255`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#g) */ g: number; /** * The red value. This value can range between `0` and `255`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#r) */ r: number; /** * Creates a deep clone of the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#clone) - * - * + * + * */ clone(): Color; /** * Takes a named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object and sets this color instance to the input value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#setColor) - * + * * @param color The new color value. This parameter can be a string representing a named color or a hex value; an array of three or four numbers representing r, g, b, a values; or an object with r, g, b, a properties. - * + * */ setColor(color: string | number[] | any): Color; /** * Returns a CSS color string in rgba form representing the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toCss) - * + * * @param includeAlpha If `true`, the alpha value will be included in the result. - * + * */ toCss(includeAlpha?: boolean): string; /** * Returns a CSS color string in hexadecimal form that represents the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toHex) - * - * + * + * */ toHex(): string; /** * Returns a JSON object with all the values from a Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toJSON) - * - * + * + * */ toJSON(): any; /** * Returns a 3-component array of rgb values that represent the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toRgb) - * - * + * + * */ toRgb(): number[]; /** * Returns a 4-component array of rgba values that represent the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toRgba) - * - * + * + * */ toRgba(): number[]; } interface ColorConstructor { /** - * Creates a new color object by passing either a hex, rgba, or named color value. This class inherits all attributes from **dojo/_base/Color** to provide functions for setting colors. - * + * Creates a new color object by passing either a hex, rgba, or named color value. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) */ - /** * Creates a Color instance by blending two colors using a weight factor. Optionally accepts a Color object to update and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#blendColors) - * + * * @param start The start color. * @param end The end color. * @param weight The weight value is a number from 0 to 1, with 0.5 being a 50/50 blend. - * @param obj A previously allocated Color object to reuse for the result. - * + * @param out A previously allocated Color object to reuse for the result. + * */ - blendColors(start: Color, end: Color, weight: number, obj?: Color): Color; + blendColors(start: Color, end: Color, weight: number, out?: Color): Color; - new(color: string | number[] | any): Color; + new (color: string | number[] | any): Color; /** * Creates a Color instance using a 3 or 4 element array, mapping each element in sequence to the rgb(a) values of the color. Optionally accepts a Color object to update with the color value and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromArray) - * + * * @param a The input array. * @param obj A previously allocated Color object to reuse for the result. - * + * */ fromArray(a: number[], obj?: Color): Color; /** * Creates a Color instance from a hex string with a '#' prefix. Supports 12-bit #rgb shorthand. Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromHex) - * + * * @param color The input color in a hex string. * @param obj A previously allocated Color object to reuse for the result. - * + * */ fromHex(color: string, obj?: Color): Color; /** * Creates a new Color instance, and initializes it with values from a JSON object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromJSON) - * + * * @param json A JSON representation of the instance. - * + * */ fromJSON(json: any): Color; /** * Creates a Color instance from a string of the form "rgb()" or "rgba()". Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromRgb) - * + * * @param color The input color in a string of the form "rgb()" or "rgba()". - * @param obj A previously allocated Color object to reuse for the result. - * + * @param out A previously allocated Color object to reuse for the result. + * */ - fromRgb(color: string, obj?: Color): Color; + fromRgb(color: string, out?: Color): Color; /** * Creates a Color instance by parsing a generic string. Accepts hex, rgb, and rgba style color values. Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromString) - * + * * @param str The input value. * @param obj A previously allocated Color object to reuse for the result. - * + * */ fromString(str: string, obj?: Color): Color; } @@ -628,59 +636,59 @@ declare namespace __esri { /** * Configure global properties of the library. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html) */ 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 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"). - * + * 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, the font files need to be in `.pbf` format, and 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) - * + * * @default "https://static.arcgis.com/fonts" */ fontsUrl: string; /** * The default [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html) used by widgets and other operations, such as on-the-fly projections. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geometryServiceUrl) - * + * * @default "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer" */ geometryServiceUrl: string; /** * The URL for the utility service used by [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html) to convert GeoRSS documents. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geoRSSServiceUrl) - * + * * @default "https://utility.arcgis.com/sharing/rss" */ geoRSSServiceUrl: string; /** * The URL for the utility service used by [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to convert KML documents. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#kmlServiceUrl) - * + * * @default "https://utility.arcgis.com/sharing/kml" */ kmlServiceUrl: string; /** * The URL of the portal instance. If using an on-premise portal, this value should be set to the portal instance, for example: `https://www.example.com/arcgis` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) - * + * * @default "https://www.arcgis.com" */ portalUrl: string; /** * An object with properties that control various aspects of communication between the library and web servers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ request: configRequest; /** * The AMD loader's configuration object, which is loaded with each worker. Modify the configuration to specify locations of packages to be loaded with [the workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html) or to define a feature detection. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ workers: configWorkers; @@ -692,21 +700,20 @@ declare namespace __esri { export type BeforeInterceptorCallback = (params: any) => any; - export interface configRequest extends Object { /** * 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` * * `arcgisonline.com` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ httpsDomains?: string[]; /** - * Allows developers to modify requests before or after they are sent. The first interceptor that matches the request URL will be used. Example: + * **Since:** 4.8 Allows developers to modify requests before or after they are sent. The first interceptor that matches the request URL will be used. Example: * ```js * const featureLayerUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0"; - * + * * esriConfig.request.interceptors.push({ * // set the `urls` property to the URL of the FeatureLayer so that this * // interceptor only applies to requests made to the FeatureLayer URL @@ -729,125 +736,122 @@ declare namespace __esri { * } * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ interceptors?: RequestInterceptor[]; /** * Maximum number of characters allowed in the URL for HTTP GET requests made by [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html). If this limit is exceeded, HTTP POST method will be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * + * * @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). + * 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 * require(["esri/config"], function(esriConfig) { * esriConfig.request.proxyUrl = "/resource-proxy/Java/proxy.jsp"; * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ proxyUrl?: string; /** * Number of milliseconds [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html) will wait for response from a server. If a server fails to respond before this time expires, then the request is considered to have encountered an error. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * + * * @default 60000 */ timeout?: number; /** - * **Since:** 4.9 Indicates whether cross origin requests made to the associated server should include credentials such as cookies and authorization headers. + * **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) */ trustedServers?: string[]; /** * **Since:** 4.5 Indicates whether `esri/request` will request a credential from `IdentityManager`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * + * * @default true */ useIdentity?: boolean; } - export interface configRequestProxyRules extends Object { /** * The URL of the proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ proxyUrl?: string; /** * URL prefix for resources that need to be accessed through a specific proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ urlPrefix?: string; } - export interface configWorkers extends Object { /** * The absolute url to the AMD loader used in the worker. The default url points to the AMD loader used by the API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ loaderUrl?: any; /** * The configuration parameters for [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-config.html#workers) */ loaderConfig?: configWorkersLoaderConfig; } - export interface configWorkersLoaderConfig extends Object { /** * The AMD loader loads all code relative to the baseUrl. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ baseUrl?: string; /** * Determines if the specified feature capabilities are supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ has?: any; /** * Map of module id fragments to file paths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ paths?: any; /** * Map paths in module identifiers to different paths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ map?: any; /** * An array of objects which provide the package name and its location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ packages?: any[]; @@ -855,112 +859,109 @@ declare namespace __esri { /** * Specifies the object used for intercepting and modifying requests made via [esriRequest](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ export interface RequestInterceptor extends Object { /** * Makes changes to the response after the request is sent, but before it's returned to the caller. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ after?: AfterInterceptorCallback; /** * 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) */ before?: BeforeInterceptorCallback; /** * Sets or adds headers into `requestOptions.headers`. 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) */ headers?: any; /** * 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](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) */ responseData?: any; /** * Specifies the URL(s) to apply to the interceptors. If the value is type `String`, then it matches if the request URL starts with that string. If null or undefined, the interceptor will apply to all relevant requests. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ urls?: string | RegExp | (string | RegExp)[]; } - - export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; /** * Represents a watch created when an object invokes [watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#WatchHandle) */ export interface WatchHandle extends Object { /** * Removes the watch handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#WatchHandle) - * - * + * + * */ remove(): void; } - interface decorators { /** * A property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#aliasOf) - * + * * @param propertyName The aliased property name. - * + * */ aliasOf(propertyName: string): Function; /** * This method decorator is used to define the method that will cast a property from a class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#cast) - * + * * @param propertyName The property name the function will cast. - * + * */ cast(propertyName: string): Function; /** * This parameter decorator is used to define the function or class for a parameter of a method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#cast) - * + * * @param classFunction The function or class to cast the parameter - * + * */ cast(classFunction: Function): Function; /** * A function that can be used as a class. It extends [expression](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-6.html#extending-expressions) and is used in conjunction with the `@subclass` decorator to create a class compatible to [dojo.declare](https://dojotoolkit.org/reference-guide/1.10/dojo/declare.html). Please refer to the `subclass` documentation for further information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#declared) - * + * * @param baseClass The class to extend. * @param mixinClasses The mixin classes used to extend the base class. - * + * */ 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#renderable) decorator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) - * + * * @param propertyMetadata An object describing the property. * @param propertyMetadata.dependsOn Property names of dependencies. * @param propertyMetadata.type The constructor used to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. @@ -969,101 +970,87 @@ declare namespace __esri { * @param propertyMetadata.constructOnly Indicates whether the property can be set during construction but is otherwise read-only. * @param propertyMetadata.aliasOf The property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. * @param propertyMetadata.value The default value for the property. - * + * */ property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; /** * A class decorator that must be used together with the `declared` function to create a class compatible to [dojo.declare](https://dojotoolkit.org/reference-guide/1.10/dojo/declare.html). It supports both single and multiple inheritance and can be considered the underlying functionality needed when creating 4.x classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#subclass) - * + * * @param declaredClass The subclass name. - * + * */ subclass(declaredClass?: string): Function; } export const decorators: decorators; - export interface decoratorsPropertyPropertyMetadata extends Object { /** * Property names of dependencies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ dependsOn?: string[]; /** * The constructor used to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ type?: Function; /** * The function to use to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. Alternative to define the `type`. The function is called with the value set by the user and should return the cast value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ cast?: Function; /** * Indicates whether the property is read-only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) - * + * * @default false */ readOnly?: boolean; /** * Indicates whether the property can be set during construction but is otherwise read-only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) - * + * * @default false */ constructOnly?: boolean; /** * The property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ aliasOf?: string; /** * The default value for the property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ value?: any; } - - - - - - - - - - - - - interface Error { /** * The details object provides additional details specific to the error, giving more information about why the error was raised. For example, the details object for esriRequest includes additional information to help the developer diagnose issues with a problematic request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#details) */ details: any; /** * A message describing the details of the error. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#message) */ message: string; /** * A unique error name. This can be used to map to a localized error message to present to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#name) */ name: string; @@ -1074,39 +1061,37 @@ declare namespace __esri { interface Evented { /** * Emits an event on the instance. This method should only be used when creating subclasses of this class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#emit) - * + * * @param type The name of the event. * @param event The event payload. - * + * */ - emit(type: string, event: any): void; + emit(type: string, event?: any): void; /** * Indicates whether there is an event listener on the instance that matches the provided event name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#hasEventListener) - * + * * @param type The name of the event. - * + * */ hasEventListener(type: string): boolean; /** * Registers an event handler on the instance. Call this method to hook an event with a listener. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#on) - * + * * @param type The name of event to listen for. * @param listener The function to call when the event is fired. - * + * */ on(type: string, listener: EventHandler): IHandle; } interface EventedConstructor { - - - new(): Evented; + new (): Evented; } export const Evented: EventedConstructor; @@ -1116,16 +1101,14 @@ declare namespace __esri { interface HandleOwner extends Accessor { /** * Handle registry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-HandleOwner.html#handles) */ handles: void; } interface HandleOwnerConstructor { - - - new(properties?: HandleOwnerProperties): HandleOwner; + new (properties?: HandleOwnerProperties): HandleOwner; } export const HandleOwner: HandleOwnerConstructor; @@ -1133,7 +1116,7 @@ declare namespace __esri { interface HandleOwnerProperties { /** * Handle registry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-HandleOwner.html#handles) */ handles?: void; @@ -1142,93 +1125,85 @@ declare namespace __esri { interface Handles extends Accessor { /** * Adds a group of handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#add) - * + * * @param handles An array or collection handles to group. * @param key group handle key - * + * */ add(handles: WatchHandle | WatchHandle[] | Collection, key?: any): void; /** * Returns true if a group exists for the provided key, false otherwise. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#has) - * + * * @param key group handle key - * + * */ has(key: any): boolean; /** * Removes a group of handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#remove) - * + * * @param key A group key or an array or collection of group keys to remove. - * + * */ remove(key?: any): void; /** * Removes all handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#removeAll) - * - * + * + * */ removeAll(): void; } interface HandlesConstructor { - - - new(properties?: HandlesProperties): Handles; + new (properties?: HandlesProperties): Handles; } export const Handles: HandlesConstructor; - interface HandlesProperties { - - } + interface HandlesProperties {} interface JSONSupport { /** * Converts an instance of [this class]() to its [ArcGIS portal JSON](https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm) representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-JSONSupport.html#toJSON) - * - * + * + * */ toJSON(): any; } interface JSONSupportConstructor { - - - new(): JSONSupport; - + new (): JSONSupport; /** * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-JSONSupport.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/overview-of-common-data-types.htm) for examples of the structure of various input JSON objects. - * + * */ fromJSON(json: any): any; } export const JSONSupport: JSONSupportConstructor; - interface lang { /** * Use this method to deeply clone objects with properties that are computed or have their own `clone()` method. For example, if you are creating an object that stores an initial extent and a spatial reference for your application, you can use `esriLang.clone(initialProps)` to clone this object so that the `extent` and `spatialReference` are properly cloned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-lang.html#clone) - * + * * @param elem The object to be cloned. - * + * */ clone(elem: any): any; } @@ -1238,181 +1213,183 @@ declare namespace __esri { interface Loadable { /** * The Error object returned if an error occurred while loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadError) - * + * * @default null */ readonly loadError: Error; /** - * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation. - * + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation. + * * Value | Description * ------|------------ * not-loaded | The object's resources have not loaded. * loading | The object's resources are currently loading. * loaded | The object's resources have loaded without errors. * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadError) for more details. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadStatus) - * + * * @default not-loaded */ readonly loadStatus: string; /** * A list of warnings which occurred while loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadWarnings) */ readonly loadWarnings: any[]; /** * Cancels a [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation if it is already in progress. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#cancelLoad) - * - * + * + * */ cancelLoad(): void; /** * `isFulfilled()` may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isFulfilled) - * - * + * + * */ isFulfilled(): boolean; /** * `isRejected()` may be used to verify if creating an instance of the class is rejected. If it is rejected, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isRejected) - * - * + * + * */ isRejected(): boolean; /** * `isResolved()` may be used to verify if creating an instance of the class is resolved. If it is resolved, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isResolved) - * - * + * + * */ isResolved(): boolean; /** * Loads the resources referenced by this class. This method automatically executes for a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) and all of the resources it references in [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) if the view is constructed with a map instance. This method must be called by the developer when accessing a resource that will not be loaded in a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) - * - * + * + * */ load(): IPromise; /** * `when()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the instance of the class loads. The `errback` executes if the instance of the class fails to load. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#when) - * + * * @param callback The function to call when the promise resolves. * @param errback The function to execute when the promise fails. - * + * */ when(callback?: Function, errback?: Function): IPromise; } interface LoadableConstructor { - - - new(): Loadable; + new (): Loadable; } export const Loadable: LoadableConstructor; - interface LoadableProperties { - - } + interface LoadableProperties {} interface corePromise { /** * `isFulfilled()` may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isFulfilled) - * - * + * + * */ isFulfilled(): boolean; /** * `isRejected()` may be used to verify if creating an instance of the class is rejected. If it is rejected, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isRejected) - * - * + * + * */ isRejected(): boolean; /** * `isResolved()` may be used to verify if creating an instance of the class is resolved. If it is resolved, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isResolved) - * - * + * + * */ isResolved(): boolean; /** * `when()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the instance of the class loads. The `errback` executes if the instance of the class fails to load. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#when) - * + * * @param callback The function to call when the promise resolves. * @param errback The function to execute when the promise fails. - * + * */ when(callback?: Function, errback?: Function): IPromise; } interface corePromiseConstructor { - - - new(): corePromise; + new (): corePromise; } export const corePromise: corePromiseConstructor; - interface promiseUtils { + /** + * Convenience utility method for creating and resolving a promise. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#create) + * + * @param executor A function that will be called with two methods, `resolve` and `reject`. + * + */ + create(executor: Executor): IPromise; /** * Convenience utility method to wait for a number of promises to either resolve or reject. The resulting promise resolves to an array of result objects containing the promise and either a value if the promise resolved, or an error if the promise rejected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#eachAlways) - * + * * @param promises Array of promises, or object where each property is a promise. - * + * */ eachAlways(promises: IPromise[] | any): IPromise | any; /** * A convenience utility method for filtering an array of values using an asynchronous predicate function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#filter) - * + * * @param input The array of input values to filter. * @param predicate A predicate function returning a promise. Only array entries for which the returned promise contains `true` are kept. - * + * */ filter(input: T[], predicate: FilterPredicateCallback): IPromise; /** * Convenience utility method to create a promise that has been rejected with a provided error value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#reject) - * + * * @param error The error to reject the resulting promise with. - * + * */ reject(error?: any): IPromise; /** * Convenience utility method to create a promise that will be resolved with a provided value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#resolve) - * + * * @param value The value to resolve the resulting promise with. - * + * */ resolve(value?: T): IPromise; } @@ -1421,42 +1398,71 @@ declare namespace __esri { /** * The result object for a promise passed to [promiseUtils.eachAlways](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#eachAlways). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) */ export interface EachAlwaysResult extends Object { /** * The promise that has been fulfilled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) */ promise: IPromise; /** * The value with which the promise resolved. Defined only if the promise resolved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) */ value?: any; /** * The error with which the promise rejected. Defined only if the promise rejected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) */ error?: any; } + export type Executor = () => void; + export type FilterPredicateCallback = (value: any, index: number) => IPromise; + /** + * A function that will reject the promise created in [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#create). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#RejectCallback) + */ + export interface RejectCallback extends Object { + /** + * The error with which the promise rejected. Defined only if the promise is rejected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#RejectCallback) + */ + error?: any; + } + + /** + * A function that will resolve the promise created in [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#create). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#ResolveCallback) + */ + export interface ResolveCallback extends Object { + /** + * The value with which the promise resolved. Defined only if the promise is fulfilled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#ResolveCallback) + */ + value?: any | IPromise; + } interface requireUtils { /** - * Dynamically requires one or more modules and returns a promise that resolves when all the specified modules have loaded. - * + * **Deprecated in favor of [promiseUtils.create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#create).** Dynamically requires one or more modules and returns a promise that resolves when all the specified modules have loaded. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-requireUtils.html#when) - * + * * @param moduleRequire The `require` function used to load the modules. This is the AMD alias (e.g. the `moduleRequire` reference in the snippets below) used to reference the `require` module. * @param moduleNames The names of the modules to load. - * + * */ when(moduleRequire: any, moduleNames: string[] | string): IPromise; } @@ -1465,26 +1471,26 @@ declare namespace __esri { /** * Various utilities and convenience functions for executing code at various phases of browser frames. The scheduling module allows you to register tasks that are executed in every animation frame. This can be used to synchronize updates with ongoing animations of the view, or to animate the view manually by adjusting the extent or camera in every frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html) */ interface scheduling { /** * Registers a frame task. An animation frame is composed of different phases to let various actors execute code before, after, or during the rendering of [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-core-scheduling.html#addFrameTask) - * + * * @param phases The callbacks for each phase of the frame. - * + * */ addFrameTask(phases: PhaseCallbacks): FrameTaskHandle; /** * Schedules the execution of a `callback` function at the next web browser tick. Unlike [addFrameTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#addFrameTask), a scheduled `callback` will only run once. Scheduling a task for the next execution tick can be useful when you want to throttle/accumulate functionality over a single javascript execution context. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#schedule) - * + * * @param callback The function to call at the next tick. - * + * */ schedule(callback: Function): any; } @@ -1493,32 +1499,32 @@ declare namespace __esri { /** * An object to remove or pause a frame task registered with [addFrameTask()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#addFrameTask). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#FrameTaskHandle) */ export interface FrameTaskHandle extends Object { /** * Pause the execution the frame task at every frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#FrameTaskHandle) - * - * + * + * */ pause(): void; /** * Resumes the execution the frame task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#FrameTaskHandle) - * - * + * + * */ resume(): void; /** * Removes the frame task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#FrameTaskHandle) - * - * + * + * */ remove(): void; } @@ -1527,25 +1533,25 @@ declare namespace __esri { /** * A set of [callbacks](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallback) that will be called at specific phases of the animation frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallbacks) */ export interface PhaseCallbacks extends Object { /** * A callback called before rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallbacks) */ prepare?: PhaseCallback; /** * A callback to execute rendering logic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallbacks) */ render?: PhaseCallback; /** * A callback to execute state update logic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallbacks) */ update?: PhaseCallback; @@ -1553,271 +1559,275 @@ declare namespace __esri { /** * An object with timing information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseEvent) */ export interface PhaseEvent extends Object { /** * The absolute time at the start of the current animation frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseEvent) */ time: number; /** * The elapsed time since the last animation frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseEvent) */ deltaTime: number; /** * The amount of time spent within the current animation frame. This can be used for budgeting (e.g. some tasks may already have run). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseEvent) */ elapsedFrameTime: number; } - interface urlUtils { /** * Adds the given proxy rule to the proxy rules list: `esriConfig.request.proxyRules`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) - * + * * @param rule An object specifying a URL that should use the proxy. See the object specification table below for the required properties of this object. * @param rule.proxyUrl The URL of the proxy. * @param rule.urlPrefix The URL prefix of the resources that should be accessed through the given proxy. - * + * */ addProxyRule(rule: urlUtilsAddProxyRuleRule): number; /** * Returns the proxy rule that matches the given URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#getProxyRule) - * + * * @param url The URL of the resources accessed via proxy. - * + * */ getProxyRule(url: string): any; /** * Converts the URL arguments to an object representation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#urlToObject) - * + * * @param url The input URL. - * + * */ urlToObject(url: string): any; } export const urlUtils: urlUtils; - export interface urlUtilsAddProxyRuleRule extends Object { /** * The URL of the proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) */ proxyUrl: string; /** * The URL prefix of the resources that should be accessed through the given proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) */ urlPrefix: string; } - interface watchUtils { /** * Watches a property for changes and calls the callback with the initial value of the property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#init) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call with the initial value of the property when the property changes. - * + * */ init(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for changes and automatically attaches and detaches an event handler for a given event to the property value as needed. The attachedHandler and detachedHandler are optional and if provided will be called whenever the event handler is attached and detached respectively. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#on) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param eventName The name of the event to attach the event handler for. * @param eventHandler The event handler callback function. * @param attachedHandler Callback called each time the event handler is attached. * @param detachedHandler Callback called each time the event handler is detached. - * + * */ - on(obj: Accessor, propertyName: string | string[], eventName: string, eventHandler: Function, attachedHandler?: EventAttachedCallback, detachedHandler?: EventAttachedCallback): WatchHandle; + on( + obj: Accessor, + propertyName: string | string[], + eventName: string, + eventHandler: Function, + attachedHandler?: EventAttachedCallback, + detachedHandler?: EventAttachedCallback + ): WatchHandle; /** * Watches a property for changes once. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming truthy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#once) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ once(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for changes. The returned handle can be paused (and resumed) to temporarily prevent the callback from being called on property changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#pausable) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ pausable(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PausableWatchHandle; /** * Watches a property for changes. This is an alias for [Accessor.watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch), provided for completeness. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#watch) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ watch(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming truthy. As with module:esri/core/watchUtils#init, the callback is called initially if the property is initially truthy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#when) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ when(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `defined`. As with init(), the callback is called if the property is initially defined. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenDefined) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenDefined(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `defined` once. As with init(), the callback is called if the property is initially `defined`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming defined. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenDefinedOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenDefinedOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming `false`. As with init(), the callback is called if the property is initially `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenFalse) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenFalse(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `false` once. As with init(), the callback is called if the property is initially `false`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming false. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenFalseOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenFalseOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming falsy. As with module:esri/core/watchUtils#init, the callback is called initially if the property is initially falsy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenNot) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenNot(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming falsy once. As with init(), the callback is called if the property is initially falsy. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming falsy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenNotOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenNotOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming truthy once. As with init(), the callback is called if the property is initially truthy. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming truthy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming `true`. As with init(), the callback is called if the property is initially `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenTrue) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenTrue(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `true` once. As with init(), the callback is called if the property is initially `true`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming true. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenTrueOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenTrueOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming `undefined`. As with init(), the callback is called if the property is initially `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenUndefined) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenUndefined(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `undefined` once. As with init(), the callback is called if the property is initially `undefined`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming undefined. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenUndefinedOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenUndefinedOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; } @@ -1828,64 +1838,63 @@ declare namespace __esri { /** * Represents a watch created when an object invokes [watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) */ export interface PausableWatchHandle extends Object { /** * Removes the watch handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) - * - * + * + * */ remove(): void; /** * Pauses the handle preventing changes to invoke the associated callback. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) - * - * + * + * */ pause(): void; /** * Resumes a paused the handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) - * - * + * + * */ resume(): void; } export interface PromisedWatchHandle extends IPromise { - remove(): void; } /** * This module is a utility framework that simplifies the use of [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) in the ArcGIS API for JavaScript. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html) */ interface workers { /** * Opens a connection to workers and loads a script with the workers framework. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html#open) - * + * * @param modulePath A fully qualified URL to a script to execute with the workers framework. * @param options Worker options. See properties below for object specifications. * @param options.client The objects defining the API accessible from the module. - * @param options.strategy - * Indicates how to load the module. See the table below for a list of possible values. - * + * @param options.strategy + * Indicates how to load the module. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * distributed | The module is loaded in each available worker. Each call to [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) will be targeting an available worker. Use this strategy if the module doesn't maintain information between invocations (stateless). * dedicated | The module is loaded in one worker. Each call to [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) will be targeting a same worker. Use this strategy if the module maintains information from previous invocations or communication between main and worker threads needs to be stateful. * local | The module is loaded in the main thread. Use this strategy if when using the worker framework API while disabling the use of workers. - * + * */ open(modulePath: string, options?: workersOpenOptions): IPromise; } @@ -1895,68 +1904,94 @@ declare namespace __esri { interface Connection { /** * 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 remote method to invoke on all workers. * @param data The unique parameter passed as argument of the remote method. - * + * @param options An object specifying additional options. See the object specification table below for the required properties of this object. + * @param options.signal A signal to abort the executions of the remote method. + * */ - broadcast(methodName: string, data?: any): IPromise[]; + broadcast(methodName: string, data?: any, options?: ConnectionBroadcastOptions): IPromise[]; /** * 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) - * - * + * + * */ close(): void; /** * 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 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. - * + * @param options An object specifying additional options. See the object specification table below for the required properties of this object. + * @param options.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. + * @param options.signal A signal to abort the execution of the remote method. + * */ - invoke(methodName: string, data?: any, transferList?: any[]): IPromise; + invoke(methodName: string, data?: any, options?: ConnectionInvokeOptions): IPromise; } 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; + new (): Connection; } export const Connection: ConnectionConstructor; + export interface ConnectionBroadcastOptions extends Object { + /** + * A signal to abort the executions of the remote method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#broadcast) + */ + signal?: AbortSignal; + } + + export interface ConnectionInvokeOptions extends Object { + /** + * 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) + */ + transferList?: any[]; + /** + * A signal to abort the execution of the remote method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) + */ + signal?: AbortSignal; + } export interface workersOpenOptions extends Object { /** * The objects defining the API accessible from the module. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html#open) */ client?: any; /** - * Indicates how to load the module. See the table below for a list of possible values. - * + * Indicates how to load the module. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * distributed | The module is loaded in each available worker. Each call to [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) will be targeting an available worker. Use this strategy if the module doesn't maintain information between invocations (stateless). * dedicated | The module is loaded in one worker. Each call to [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) will be targeting a same worker. Use this strategy if the module maintains information from previous invocations or communication between main and worker threads needs to be stateful. * local | The module is loaded in the main thread. Use this strategy if when using the worker framework API while disabling the use of workers. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html#open) - * + * * @default distributed */ strategy?: any; @@ -1964,68 +1999,124 @@ declare namespace __esri { /** * A convenience module for importing [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing geometries one at a time like this: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html) */ - interface geometry { - } + namespace geometry { + /** + * Geometry types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Geometry) + */ + export type Geometry = + | __esri.Extent + | __esri.Multipoint + | __esri.Point + | __esri.Polygon + | __esri.Polyline + | __esri.Mesh; - export const geometry: geometry; + /** + * Extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Extent) + */ + export type Extent = __esri.Extent; + export const Extent: typeof __esri.Extent; + + /** + * Multipoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Multipoint) + */ + export type Multipoint = __esri.Multipoint; + export const Multipoint: typeof __esri.Multipoint; + + /** + * Point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Point) + */ + export type Point = __esri.Point; + export const Point: typeof __esri.Point; + + /** + * Polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Polygon) + */ + export type Polygon = __esri.Polygon; + export const Polygon: typeof __esri.Polygon; + + /** + * Polyline. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Polyline) + */ + export type Polyline = __esri.Polyline; + export const Polyline: typeof __esri.Polyline; + + /** + * Mesh. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Mesh) + */ + export type Mesh = __esri.Mesh; + export const Mesh: typeof __esri.Mesh; + } interface Circle extends Polygon { /** * The center point of the circle. The center must be specified either as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of longitude/latitude coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#center) */ center: Point; /** * Applicable when the spatial reference of the center point is either set to Web Mercator (wkid: 3857) or geographic/geodesic (wkid: 4326). When either of those spatial references is used, set geodesic to `true` to minimize distortion. Other coordinate systems will not create geodesic circles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#geodesic) - * + * * @default false */ geodesic: boolean; /** * This value defines the number of points along the curve of the circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#numberOfPoints) - * + * * @default 60 */ numberOfPoints: number; /** * The radius of the circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radius) - * + * * @default 1000 */ radius: number; /** * Unit of the radius. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radiusUnit) - * + * * @default meters */ radiusUnit: string; /** * Creates a deep clone of Circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#clone) - * - * + * + * */ clone(): Circle; } interface CircleConstructor { - - - new(properties?: CircleProperties): Circle; + new (properties?: CircleProperties): Circle; fromJSON(json: any): Circle; } @@ -2035,39 +2126,39 @@ declare namespace __esri { interface CircleProperties extends PolygonProperties { /** * The center point of the circle. The center must be specified either as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of longitude/latitude coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#center) */ center?: PointProperties; /** * Applicable when the spatial reference of the center point is either set to Web Mercator (wkid: 3857) or geographic/geodesic (wkid: 4326). When either of those spatial references is used, set geodesic to `true` to minimize distortion. Other coordinate systems will not create geodesic circles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#geodesic) - * + * * @default false */ geodesic?: boolean; /** * This value defines the number of points along the curve of the circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#numberOfPoints) - * + * * @default 60 */ numberOfPoints?: number; /** * The radius of the circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radius) - * + * * @default 1000 */ radius?: number; /** * Unit of the radius. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radiusUnit) - * + * * @default meters */ radiusUnit?: string; @@ -2079,13 +2170,13 @@ declare namespace __esri { * * degrees, minutes, and seconds * * U.S. National Grid (USNG) * * Military Grid Reference System (MGRS). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html) */ interface coordinateFormatter { /** * Parses coordinates in latitude/longitude notation, and returns a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) representing that location. The coordinates may use decimal degrees, degrees and decimal minutes, or degrees, minutes, and seconds format. The spatial reference provided must have an ellipsoid and datum matching those used by the source of the latitude/longitude string. If no spatial reference is provided, it is assumed the latitude/longitude coordinates are in WGS84. **Supported characters** - * + * * | Symbol | Character | Name | Unicode number | HTML code | * | --- | --- | --- | --- | --- | * | Degree | * | Asterisk | U+002A | &#42; | @@ -2095,43 +2186,43 @@ declare namespace __esri { * | Minute | ' | Apostrophe | U+0027 | &#39; | * | | ′ | Prime | U+2032 | &#8242; | * | Second | " | Quotation Mark | U+0022 | &#34; | - * + * * The latitude/longitude string may contain leading and trailing whitespace, and may also contain a space, comma, or vertical bar symbol to separate the latitude from the longitude. It may also contain the characters 'N', 'S', 'E' and 'W', or use a minus (-) symbol to indicate the hemisphere of each value. Latitude/longitude notation examples: * * 55 56 39.123N 003 09 43.034W * * 55°56′39″N 3°09′43″W * * 55~56.65205', -003~09.71723' * * 55.9442008* | -3.1619539* - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#fromLatitudeLongitude) - * + * * @param coordinates The latitude/longitude notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm). If `null`, WGS84 will be used. - * + * */ fromLatitudeLongitude(coordinates: string, spatialReference?: SpatialReference): Point; /** * Parses coordinates in Military Grid Reference System (MGRS) notation, and returns a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) representing that location. The spatial reference provided must have an ellipsoid and datum matching those used by the source of the MGRS string. If no spatial reference is provided, it is assumed the MGRS string is referenced to WGS84. Note that the choice between zone 01 and 60 has no impact when reading from an MGRS notation string. The MGRS string can contain leading and trailing whitespace and can have whitespace between the grid zone designator, the 100km square identifier, and the numerical eastings and northings. MGRS notation examples: * * 30UVG898998 * * 30UVG 89885 99877 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#fromMgrs) - * + * * @param coordinates The MGRS notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) referenced by the MGRS coordinates. If `null`, WGS84 will be used. * @param conversionMode The mode used by the given MGRS coordinates. **Possible Values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 - * + * */ fromMgrs(coordinates: string, spatialReference: SpatialReference, conversionMode: string): Point; /** * Parses coordinates in United States National Grid (USNG) notation, and returns a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) representing that location. The spatial reference provided must have an ellipsoid and datum matching those used by the source of the USNG string. If no spatial reference is provided and the USNG string is suffixed with "(NAD 27)", it is assumed the USNG string is referenced to NAD 27. If no spatial reference is provided and no such suffix exists, it is assumed the USNG string is referenced to WGS84. USNG notation examples: * * 13TFJ 23 59 * * 13TFJ2374159574 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#fromUsng) - * + * * @param coordinates The USNG notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) that the USNG coordinates are in. If `null`, WGS84 will be used. - * + * */ fromUsng(coordinates: string, spatialReference?: SpatialReference): Point; /** @@ -2139,42 +2230,42 @@ declare namespace __esri { * * 30U 489885 6199877 * * 30U4898856199877 * * 30N 489885 6199877 (using N/S indicator) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#fromUtm) - * + * * @param coordinates The UTM notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) that the UTM coordinates are in. If `null`, WGS84 will be used. * @param conversionMode The latitude notation scheme used by the given UTM coordinates, either a latitudinal band, or a hemisphere designator. **Possible Values**: latitude-band-indicators | north-south-indicators - * + * */ fromUtm(coordinates: string, spatialReference: SpatialReference, conversionMode: string): Point; /** * Indicates if all dependencies of this module have been loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#isLoaded) - * - * + * + * */ isLoaded(): boolean; /** * Indicates if this module is supported in the current browser. The browser must support [WebAssembly](https://caniuse.com/#feat=wasm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#isSupported) - * - * + * + * */ isSupported(): boolean; /** * Load this module's dependencies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#load) - * - * + * + * */ load(): IPromise; /** * Returns formatted coordinates in latitude/longitude notation representing the given point's location. The latitude/longitude string will contain a space separating the latitude from the longitude value, and the characters 'N' or 'S', and 'E' and 'W', to indicate the hemisphere of each value. The string will also contain spaces separating the components (degrees, minutes, seconds) of each value. The precision of the output is controlled by both the `format` and `decimalPlaces` parameters. For example: - * + * * | Decimal places | format | Example output | Angular precision | Approximate precision | * | --- | --- | --- | --- | --- | * | 0 | dd | 056N 0003W | 1deg | 100km | @@ -2189,19 +2280,19 @@ declare namespace __esri { * | 1 | dms | 55 56 39.1N 003 09 43.0W | 0.1sec| 3m | * | 2 | dms | 55 56 39.12N 003 09 43.03W | 0.01sec | 300mm | * | 3 | dms | 55 56 39.123N 003 09 43.034W | 0.001sec | 30mm | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toLatitudeLongitude) - * + * * @param point The location to be represented as a formatted latitude/longitude string. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm). * @param format The mode to use when formatting the latitude/longitude string. **Possible Values**: dd | ddm | dms * @param decimalPlaces The number of decimal places to use, it should be an integer from 0 to 16. - * + * */ toLatitudeLongitude(point: Point, format: string, decimalPlaces?: number): string; /** * Returns formatted coordinates in Military Grid Reference System (MGRS) notation representing the given point's location. Note that the choice between zone 01 and 60 has an impact only when generating the MGRS notation string for a point with longitude of exactly 180deg. The precision value controls the number of digits used to represent each numerical easting and northing value within the MGRS string. For example: - * + * * | precision | add_spaces | Example output | Approximate precision | * | --- | --- | --- | --- | * | 0 | false | 30UVG | 100km | @@ -2216,20 +2307,20 @@ declare namespace __esri { * | 3 | true | 30U VG 898 998 | 100m | * | 4 | true | 30U VG 8988 9988 | 10m | * | 5 | true | 30U VG 89884 99881 | 1m | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toMgrs) - * + * * @param point The location to be represented in MGRS notation. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) * @param conversionMode The mode to use for the returned MGRS notation string. **Possible Values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 * @param precision The precision with which to represent the coordinates, it should be an integer from 0 to 8. * @param addSpaces If `false`, the generated string will contain no spaces. If `true`, a space separates the grid zone designator, the 100km square identifier, and the numerical easting and northing values. - * + * */ toMgrs(point: Point, conversionMode: string, precision?: number, addSpaces?: boolean): string; /** * Returns formatted coordinates in United States National Grid (USNG) notation representing the given point's location. The precision value controls the number of digits used to represent each numerical easting and northing value within the USNG string. For example: - * + * * | precision | add_spaces | Example output | Approximate precision | * | --- | --- | --- | --- | * | 0 | false | 13TFJ | 100km | @@ -2247,33 +2338,33 @@ declare namespace __esri { * | 4* | false | 13TFJ23795929 (NAD 27) | 10m | * | 2* | true | 13T FJ 23 59 (NAD 27) | 1km | * * *When the point's spatial reference is based on NAD 27.* - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toUsng) - * + * * @param point The location to be represented in USNG notation. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm). * @param precision The precision with which to represent the coordinates, it should be an integer from 0 to 8. * @param addSpaces If `false`, the generated string will contain no spaces. If `true`, a space separates the grid zone designator, the 100km square identifier, and the numerical easting and northing values. - * + * */ toUsng(point: Point, precision?: number, addSpaces?: boolean): string; /** * Returns formatted coordinates in Universal Transverse Mercator (UTM) notation representing the given point's location. Example output for a point in the southern hemisphere: - * + * * | conversionMode | add_spaces | Example output | * | --- | --- | --- | * | latitude-band-indicators | false | 30U4898846199881 | * | latitude-band-indicators | true | 30U 489884 6199881 | * | north-south-indicators | false | 30N4898846199881 | * | north-south-indicators | true | 30N 489884 6199881 | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toUtm) - * + * * @param point The location to be represented in UTM notation. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) * @param conversionMode The latitude notation scheme to use in the returned UTM notation string, either a latitudinal band, or a hemisphere designator. **Possible Values**: latitude-band-indicators | north-south-indicators * @param addSpaces If `false`, the generated string will contain no spaces. If `true`, a space separates the UTM zone and latitude designator and each numerical easting and northing value. - * + * */ toUtm(point: Point, conversionMode: string, addSpaces?: boolean): string; } @@ -2283,191 +2374,189 @@ declare namespace __esri { interface Extent extends Geometry { /** * The center point of the extent in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#center) */ readonly center: Point; /** * The height of the extent in map units (the distance between [ymin](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) and [ymax](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#height) */ readonly height: number; /** * The maximum possible `m` value in an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmax) - * + * * @default undefined */ mmax: number; /** * The minimum possible `m` value of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmin) - * + * * @default undefined */ mmin: number; /** * For Extent, the type is always `extent`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#type) */ readonly type: "extent"; /** * The width of the extent in map units (the distance between [xmin](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) and [xmax](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#width) */ readonly width: number; /** * The bottom-right X-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax) - * + * * @default 0 */ xmax: number; /** * The top-left X-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) - * + * * @default 0 */ xmin: number; /** * The top-right Y-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax) - * + * * @default 0 */ ymax: number; /** * The bottom-left Y-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) - * + * * @default 0 */ ymin: number; /** - * The maximum possible `z`, or elevation, value in an extent envelope. + * The maximum possible `z`, or elevation, value in an extent envelope. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmax) - * + * * @default undefined */ zmax: number; /** - * The minimum possible `z`, or elevation, value of an extent envelope. + * The minimum possible `z`, or elevation, value of an extent envelope. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmin) - * + * * @default undefined */ zmin: number; /** * Centers the extent to the specified [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#centerAt) - * + * * @param point The point to center the extent. - * + * */ centerAt(point: Point): Extent; /** * Creates a deep clone of Extent object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) - * - * + * + * */ clone(): Extent; /** * Checks if the input geometry is contained within the extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#contains) - * + * * @param geometry Input geometry to test if it is contained within the extent. - * + * */ contains(geometry: Point | Extent): boolean; /** * Indicates if the input extent is equal to the testing extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#equals) - * + * * @param extent Input extent. - * + * */ equals(extent: Extent): boolean; /** * Expands the extent by the given factor. For example, a value of 1.5 will expand the extent to be 50 percent larger than the original extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#expand) - * + * * @param factor The multiplier value. - * + * */ expand(factor: number): Extent; /** * Shrinks the original extent to the intersection with the input extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. If the original extent and the input extent have no intersection, the extent is not modified and null is returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#intersection) - * + * * @param extent The input extent to intersect. - * + * */ intersection(extent: Extent): Extent; /** * Tests to validate if the input geometry intersects the extent and returns a Boolean value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#intersects) - * + * * @param geometry The geometry used to test the intersection. It can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) or [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * */ intersects(geometry: Geometry): boolean; /** * Returns an array with either one Extent that's been shifted to within +/- 180 or two Extents if the original extent intersects the International Dateline. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#normalize) - * - * + * + * */ normalize(): Extent[]; /** * Modifies the extent geometry in-place with X and Y offsets in map units. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#offset) - * + * * @param dx The offset distance in map units for the X-coordinate. * @param dy The offset distance in map units for the Y-coordinate. * @param dz The offset distance in map units for the Z-coordinate. - * + * */ offset(dx: number, dy: number, dz: number): Extent; /** * Expands the original extent to include the extent of the input Extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#union) - * + * * @param extent The input extent to union. - * + * */ union(extent: Extent): Extent; } interface ExtentConstructor { - - - new(properties?: ExtentProperties): Extent; + new (properties?: ExtentProperties): Extent; fromJSON(json: any): Extent; } @@ -2477,67 +2566,67 @@ declare namespace __esri { interface ExtentProperties extends GeometryProperties { /** * The maximum possible `m` value in an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmax) - * + * * @default undefined */ mmax?: number; /** * The minimum possible `m` value of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmin) - * + * * @default undefined */ mmin?: number; /** * The bottom-right X-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax) - * + * * @default 0 */ xmax?: number; /** * The top-left X-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) - * + * * @default 0 */ xmin?: number; /** * The top-right Y-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax) - * + * * @default 0 */ ymax?: number; /** * The bottom-left Y-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) - * + * * @default 0 */ ymin?: number; /** - * The maximum possible `z`, or elevation, value in an extent envelope. + * The maximum possible `z`, or elevation, value in an extent envelope. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmax) - * + * * @default undefined */ zmax?: number; /** - * The minimum possible `z`, or elevation, value of an extent envelope. + * The minimum possible `z`, or elevation, value of an extent envelope. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmin) - * + * * @default undefined */ zmin?: number; @@ -2546,58 +2635,56 @@ declare namespace __esri { interface Geometry extends Accessor, JSONSupport { /** * The cache is used to store values computed from geometries that need to cleared or recomputed upon mutation. An example is the extent of a polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#cache) */ readonly cache: any; /** * The extent of the geometry. For a point, the extent is null. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#extent) */ readonly extent: Extent; /** * Indicates if the geometry has M values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasM) */ hasM: boolean; /** - * Indicates if the geometry has Z (elevation) values. + * Indicates if the geometry has Z (elevation) values. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasZ) */ hasZ: boolean; /** * The spatial reference of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#spatialReference) - * + * * @default WGS84 (wkid: 4326) */ spatialReference: SpatialReference; /** * The geometry type. **Possible Values:** point | multipoint | polyline | polygon | extent | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) */ readonly type: string; /** * Creates a deep clone of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#clone) - * - * + * + * */ clone(): Geometry; } interface GeometryConstructor { - - - new(properties?: GeometryProperties): Geometry; + new (properties?: GeometryProperties): Geometry; fromJSON(json: any): Geometry; } @@ -2607,401 +2694,431 @@ declare namespace __esri { interface GeometryProperties { /** * Indicates if the geometry has M values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasM) */ hasM?: boolean; /** - * Indicates if the geometry has Z (elevation) values. + * Indicates if the geometry has Z (elevation) values. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasZ) */ hasZ?: boolean; /** * The spatial reference of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#spatialReference) - * + * * @default WGS84 (wkid: 4326) */ spatialReference?: SpatialReferenceProperties; } - interface geometryEngine { /** * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. The GeometryEngine has two methods for buffering geometries client-side: buffer and [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer). Use caution when deciding which method to use. As a general rule, use [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer) if the input geometries have a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator). Only use buffer (this method) when attempting to buffer geometries with a [projected coordinate system](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) other than Web Mercator. If you need to buffer geometries with a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buffer) - * + * * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param unionResults Determines whether the output geometries should be unioned into a single polygon. - * + * */ - buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + buffer( + geometry: Geometry | Geometry[], + distance: number | number[], + unit: string | number, + unionResults?: boolean + ): Polygon | Polygon[]; /** * Calculates the clipped geometry from a target geometry by an envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#clip) - * + * * @param geometry The geometry to be clipped. * @param envelope The envelope used to clip. - * + * */ clip(geometry: Geometry, envelope: Extent): Geometry; /** * Indicates if one geometry contains another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#contains) - * + * * @param containerGeometry The geometry that is tested for the "contains" relationship to the other geometry. Think of this geometry as the potential "container" of the `insideGeometry`. * @param insideGeometry The geometry that is tested for the "within" relationship to the `containerGeometry`. - * + * */ contains(containerGeometry: Geometry, insideGeometry: Geometry): boolean; /** * Calculates the convex hull of the input geometry. A convex hull is the smallest convex polygon that encloses a group of Objects, such as points. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#convexHull) - * + * * @param geometry The input geometry. * @param merge Dictates whether to merge output geometries. - * + * */ convexHull(geometry: Geometry, merge?: boolean): Geometry | Geometry[]; /** * Indicates if one geometry crosses another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#crosses) - * + * * @param geometry1 The geometry to cross. * @param geometry2 The geometry being crossed. - * + * */ crosses(geometry1: Geometry, geometry2: Geometry): boolean; /** * Split the input Polyline or Polygon where it crosses a cutting Polyline. For Polylines, all left cuts are grouped together in the first Geometry. Right cuts and coincident cuts are grouped in the second Geometry and each undefined cut, along with any uncut parts, are output as separate Polylines. For Polygons, all left cuts are grouped in the first Polygon, all right cuts are grouped in the second Polygon, and each undefined cut, along with any left-over parts after cutting, are output as a separate Polygon. If no cuts are returned then the array will be empty. An undefined cut will only be produced if a left cut or right cut was produced and there was a part left over after cutting, or a cut is bounded to the left and right of the cutter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#cut) - * + * * @param geometry The geometry to be cut. * @param cutter The polyline to cut the geometry. - * + * */ cut(geometry: Geometry, cutter: Polyline): Geometry[]; /** * Densify geometries by plotting points between existing vertices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#densify) - * + * * @param geometry The geometry to be densified. * @param maxSegmentLength The maximum segment length allowed. Must be a positive value. * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; /** * Creates the difference of two geometries. The resultant geometry is the portion of `inputGeometry` not in the `subtractor`. The dimension of the `subtractor` has to be equal to or greater than that of the `inputGeometry`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#difference) - * + * * @param inputGeometry The input geometry to subtract from. * @param subtractor The geometry being subtracted from inputGeometry. - * + * */ difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): Geometry | Geometry[]; /** * Indicates if one geometry is disjoint (doesn't intersect in any way) with another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#disjoint) - * + * * @param geometry1 The base geometry that is tested for the "disjoint" relationship to the other geometry. * @param geometry2 The comparison geometry that is tested for the "disjoint" relationship to the other geometry. - * + * */ disjoint(geometry1: Geometry, geometry2: Geometry): boolean; /** - * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. + * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. * > To calculate the geodesic distance between two points, first construct a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) using the two points of interest as the beginning and ending points of a single path. Then use the polyline as input for the [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#distance) - * + * * @param geometry1 First input geometry. * @param geometry2 Second input geometry. * @param distanceUnit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number; /** * Indicates if two geometries are equal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#equals) - * + * * @param geometry1 First input geometry. * @param geometry2 Second input geometry. - * + * */ equals(geometry1: Geometry, geometry2: Geometry): boolean; /** * Returns an Object containing additional information about the input spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#extendedSpatialReferenceInfo) - * + * * @param spatialReference The input spatial reference. - * + * */ extendedSpatialReferenceInfo(spatialReference: SpatialReference): any; /** * Flips a geometry on the horizontal axis. Can optionally be flipped around a point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#flipHorizontal) - * + * * @param geometry The input geometry to be flipped. * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. - * + * */ flipHorizontal(geometry: Geometry, flipOrigin?: Point): Geometry; /** * Flips a geometry on the vertical axis. Can optionally be flipped around a point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#flipVertical) - * + * * @param geometry The input geometry to be flipped. * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. - * + * */ flipVertical(geometry: Geometry, flipOrigin?: Point): Geometry; /** * Performs the generalize operation on the geometries in the cursor. Point and Multipoint geometries are left unchanged. Envelope is converted to a Polygon and then generalized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#generalize) - * + * * @param geometry The input geometry to be generalized. * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. * @param removeDegenerateParts When `true` the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). * @param maxDeviationUnit Measurement unit for maxDeviation. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry; + generalize( + geometry: Geometry, + maxDeviation: number, + removeDegenerateParts?: boolean, + maxDeviationUnit?: string | number + ): Geometry; /** * Calculates the area of the input geometry. As opposed to [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea), geodesicArea takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea) - * + * * @param geometry The input polygon. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles - * + * */ geodesicArea(geometry: Polygon, unit: string | number): number; /** * Creates geodesic buffer polygons at a specified distance around the input geometries. When calculating distances, this method takes the curvature of the earth into account, which provides highly accurate results when dealing with very large geometries and/or geometries that spatially vary on a global scale where one projected coordinate system could not accurately plot coordinates and measure distances for all the geometries. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. In general, if your input geometries are assigned one of those two spatial references, you should always use geodesicBuffer() to obtain the most accurate results for those geometries. If needing to buffer points assigned a [projected coordinate system other than Web Mercator](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm), use [buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buffer) instead. If the input geometries have a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer) - * + * * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param unionResults Determines whether the output geometries should be unioned into a single polygon. - * + * */ - geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + geodesicBuffer( + geometry: Geometry | Geometry[], + distance: number | number[], + unit: string | number, + unionResults?: boolean + ): Polygon | Polygon[]; /** * Returns a geodesically densified version of the input geometry. Use this function to draw the line(s) of the geometry along great circles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicDensify) - * + * * @param geometry A polyline or polygon to densify. * @param maxSegmentLength The maximum segment length allowed. This must be a positive value. * @param maxSegmentLengthUnit Measurement unit for `maxSegmentLength`. If a unit is not specified, the units are considered to be the same as the units of the `geometry`. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ - geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; + geodesicDensify( + geometry: Polyline | Polygon, + maxSegmentLength: number, + maxSegmentLengthUnit: string | number + ): Geometry; /** * Calculates the length of the input geometry. As opposed to [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength), geodesicLength() takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using geodesicLength(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength) - * + * * @param geometry The input geometry. * @param unit Measurement unit of the return value. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ geodesicLength(geometry: Geometry, unit: string | number): number; /** * Creates a new geometry through intersection between two geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#intersect) - * + * * @param geometry The input geometry(ies). * @param intersector The geometry being intersected. - * + * */ intersect(geometry: Geometry | Geometry[], intersector: Geometry): Geometry | Geometry[]; /** * Indicates if one geometry intersects another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#intersects) - * + * * @param geometry1 The geometry that is tested for the intersects relationship to the other geometry. * @param geometry2 The geometry being intersected. - * + * */ intersects(geometry1: Geometry, geometry2: Geometry): boolean; /** * Indicates if the given geometry is topologically simple. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#isSimple) - * + * * @param geometry The input geometry. - * + * */ isSimple(geometry: Geometry): boolean; /** * Finds the coordinate of the geometry that is closest to the specified point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestCoordinate) - * + * * @param geometry The geometry to consider. * @param inputPoint The point used to search the nearest coordinate in the geometry. - * + * */ nearestCoordinate(geometry: Geometry, inputPoint: Point): NearestPointResult; /** * Finds the vertex on the geometry nearest to the specified point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertex) - * + * * @param geometry The geometry to consider. * @param inputPoint The point used to search the nearest vertex in the geometry. - * + * */ nearestVertex(geometry: Geometry, inputPoint: Point): NearestPointResult; /** * Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of Objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertices) - * + * * @param geometry The geometry to consider. * @param inputPoint The point from which to measure. * @param searchRadius The distance to search from the inputPoint in the units of the view's spatial reference. * @param maxVertexCountToReturn The maximum number of vertices to return. - * + * */ - nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): NearestPointResult[]; + nearestVertices( + geometry: Geometry, + inputPoint: Point, + searchRadius: number, + maxVertexCountToReturn: number + ): NearestPointResult[]; /** * The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon. It is similar to buffering, but produces a one-sided result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#offset) - * + * * @param geometry The geometries to offset. * @param offsetDistance The planar distance to offset from the input geometry. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, if offsetDistance = 0, then there is no change in the geometries, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the "right side" of a simple polygon is always its inside. * @param offsetUnit Measurement unit of the offset distance. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param joinType The join type. **Possible values:** round | bevel | miter | square * @param bevelRatio Applicable when `joinType = 'miter'`; bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. * @param flattenError Applicable when `joinType = 'round'`; flattenError determines the maximum distance of the resulting segments compared to the true circular arc. The algorithm never produces more than around 180 vertices for each round join. - * + * */ - offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): Geometry | Geometry[]; + offset( + geometry: Geometry | Geometry[], + offsetDistance: number, + offsetUnit: string | number, + joinType: string, + bevelRatio?: number, + flattenError?: number + ): Geometry | Geometry[]; /** * Indicates if one geometry overlaps another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#overlaps) - * + * * @param geometry1 The base geometry that is tested for the "overlaps" relationship with the other geometry. * @param geometry2 The comparison geometry that is tested for the "overlaps" relationship with the other geometry. - * + * */ overlaps(geometry1: Geometry, geometry2: Geometry): boolean; /** * Calculates the area of the input geometry. As opposed to [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea), planarArea() performs this calculation using projected coordinates and does not take into account the earth's curvature. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea) - * + * * @param geometry The input polygon. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles - * + * */ planarArea(geometry: Polygon, unit: string | number): number; /** * Calculates the length of the input geometry. As opposed to [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength), planarLength() uses projected coordinates and does not take into account the curvature of the earth when performing this calculation. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength). If the input geometries have a projected coordinate system other than Web Mercator, use planarLength() instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength) - * + * * @param geometry The input geometry. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ planarLength(geometry: Geometry, unit: string | number): number; /** * Indicates if the given DE-9IM relation holds for the two geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) - * + * * @param geometry1 The first geometry for the relation. * @param geometry2 The second geometry for the relation. * @param relation The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: `0`,`1`,`2`), a Boolean value (`T` or `F`), or a mask character (for ignoring results: '\*'). Example: Each of the following DE-9IM string codes are valid for testing whether a polygon geometry completely contains a line geometry: `TTTFFTFFT` (Boolean), 'T*\*\*\*\*\*FF\*' (ignore irrelevant intersections), or '102FF\*FF\*' (dimension form). Each returns the same result. See [this article](https://en.wikipedia.org/wiki/DE-9IM) and [this ArcGIS help page](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) for more information about the DE-9IM model and how string codes are constructed. - * + * */ relate(geometry1: Geometry, geometry2: Geometry, relation: string): boolean; /** * Rotates a geometry counterclockwise by the specified number of degrees. Rotation is around the centroid, or a given rotation point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#rotate) - * + * * @param geometry The geometry to rotate. * @param angle The rotation angle in degrees. * @param rotationOrigin Point to rotate the geometry around. Defaults to the centroid of the geometry. - * + * */ rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): Geometry; /** * Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#simplify) - * + * * @param geometry The geometry to be simplified. - * + * */ simplify(geometry: Geometry): Geometry; /** * Creates the symmetric difference of two geometries. The symmetric difference includes the parts that are in either of the sets, but not in both. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#symmetricDifference) - * + * * @param leftGeometry One of the Geometry instances in the XOR operation. * @param rightGeometry One of the Geometry instances in the XOR operation. - * + * */ symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): Geometry | Geometry[]; /** * Indicates if one geometry touches another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#touches) - * + * * @param geometry1 The geometry to test the "touches" relationship with the other geometry. * @param geometry2 The geometry to be touched. - * + * */ touches(geometry1: Geometry, geometry2: Geometry): boolean; /** * All inputs must be of the same type of geometries and share one spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#union) - * + * * @param geometries An array of Geometries to union. - * + * */ union(geometries: Geometry[]): Geometry; /** * Indicates if one geometry is within another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#within) - * + * * @param innerGeometry The base geometry that is tested for the "within" relationship to the other geometry. * @param outerGeometry The comparison geometry that is tested for the "contains" relationship to the other geometry. - * + * */ within(innerGeometry: Geometry, outerGeometry: Geometry): boolean; } @@ -3010,416 +3127,446 @@ declare namespace __esri { /** * Object returned from the [nearestCoordinate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestCoordinate), [nearestVertex()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertex), and [nearestVertices()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertices) methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ export interface NearestPointResult extends Object { /** * A vertex within the specified distance of the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ coordinate: Point; /** * The distance from the `inputPoint` in the units of the view's spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ distance: number; /** * Indicates if the vertex is on the right side of the `geometry`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ isRightSide: boolean; /** * The index of the vertex within the geometry's rings or paths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ vertexIndex: number; /** * Indicates if it is an empty geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ isEmpty: boolean; } - interface geometryEngineAsync { /** * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. The GeometryEngine has two methods for buffering geometries client-side: buffer and [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer). Use caution when deciding which method to use. As a general rule, use [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer) if the input geometries have a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator). Only use buffer (this method) when attempting to buffer geometries with a [projected coordinate system](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) other than Web Mercator. If you need to buffer geometries with a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#buffer) - * + * * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param unionResults Determines whether the output geometries should be unioned into a single polygon. - * + * */ - buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; + buffer( + geometry: Geometry | Geometry[], + distance: number | number[], + unit: string | number, + unionResults?: boolean + ): IPromise; /** * Calculates the clipped geometry from a target geometry by an envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#clip) - * + * * @param geometry The geometry to be clipped. * @param envelope The envelope used to clip. - * + * */ clip(geometry: Geometry, envelope: Extent): IPromise; /** * Indicates if one geometry contains another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#contains) - * + * * @param containerGeometry The geometry that is tested for the "contains" relationship to the other geometry. Think of this geometry as the potential "container" of the `insideGeometry`. * @param insideGeometry The geometry that is tested for the "within" relationship to the `containerGeometry`. - * + * */ contains(containerGeometry: Geometry, insideGeometry: Geometry): IPromise; /** * Calculates the convex hull of the input geometry. A convex hull is the smallest convex polygon that encloses a group of Objects, such as points. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#convexHull) - * + * * @param geometry The input geometry. * @param merge Dictates whether to merge output geometries. - * + * */ convexHull(geometry: Geometry, merge?: boolean): IPromise; /** * Indicates if one geometry crosses another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#crosses) - * + * * @param geometry1 The geometry to cross. * @param geometry2 The geometry being crossed. - * + * */ crosses(geometry1: Geometry, geometry2: Geometry): IPromise; /** * Split the input Polyline or Polygon where it crosses a cutting Polyline. For Polylines, all left cuts are grouped together in the first Geometry. Right cuts and coincident cuts are grouped in the second Geometry and each undefined cut, along with any uncut parts, are output as separate Polylines. For Polygons, all left cuts are grouped in the first Polygon, all right cuts are grouped in the second Polygon, and each undefined cut, along with any left-over parts after cutting, are output as a separate Polygon. If no cuts are returned then the array will be empty. An undefined cut will only be produced if a left cut or right cut was produced and there was a part left over after cutting, or a cut is bounded to the left and right of the cutter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#cut) - * + * * @param geometry The geometry to be cut. * @param cutter The polyline to cut the geometry. - * + * */ cut(geometry: Geometry, cutter: Polyline): IPromise; /** * Densify geometries by plotting points between existing vertices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#densify) - * + * * @param geometry The geometry to be densified. * @param maxSegmentLength The maximum segment length allowed. Must be a positive value. * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; /** * Creates the difference of two geometries. The resultant geometry is the portion of inputGeometry not in the subtractor. The dimension of the subtractor has to be equal to or greater than that of the inputGeometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#difference) - * + * * @param inputGeometry The input geometry to subtract from. * @param subtractor The geometry being subtracted from inputGeometry. - * + * */ difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): IPromise; /** * Indicates if one geometry is disjoint (doesn't intersect in any way) with another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#disjoint) - * + * * @param geometry1 The base geometry that is tested for the "disjoint" relationship to the other geometry. * @param geometry2 The comparison geometry that is tested for the "disjoint" relationship to the other geometry. - * + * */ disjoint(geometry1: Geometry, geometry2: Geometry): IPromise; /** - * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. + * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. * > To calculate the geodesic distance between two points, first construct a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) using the two points of interest as the beginning and ending points of a single path. Then use the polyline as input for the [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#distance) - * + * * @param geometry1 First input geometry. * @param geometry2 Second input geometry. * @param distanceUnit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): IPromise; /** * Indicates if two geometries are equal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#equals) - * + * * @param geometry1 First input geometry. * @param geometry2 Second input geometry. - * + * */ equals(geometry1: Geometry, geometry2: Geometry): IPromise; /** * Returns an Object containing additional information about the input spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#extendedSpatialReferenceInfo) - * + * * @param spatialReference The input spatial reference. - * + * */ extendedSpatialReferenceInfo(spatialReference: SpatialReference): IPromise; /** * Flips a geometry on the horizontal axis. Can optionally be flipped around a point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#flipHorizontal) - * + * * @param geometry The input geometry to be flipped. * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. - * + * */ flipHorizontal(geometry: Geometry, flipOrigin?: Point): IPromise; /** * Flips a geometry on the vertical axis. Can optionally be flipped around a point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#flipVertical) - * + * * @param geometry The input geometry to be flipped. * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. - * + * */ flipVertical(geometry: Geometry, flipOrigin?: Point): IPromise; /** * Performs the generalize operation on the geometries in the cursor. Point and Multipoint geometries are left unchanged. Envelope is converted to a Polygon and then generalized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#generalize) - * + * * @param geometry The input geometry to be generalized. * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. * @param removeDegenerateParts When `true` the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). * @param maxDeviationUnit Measurement unit for maxDeviation. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): IPromise; + generalize( + geometry: Geometry, + maxDeviation: number, + removeDegenerateParts?: boolean, + maxDeviationUnit?: string | number + ): IPromise; /** * Calculates the area of the input geometry. As opposed to [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea), geodesicArea takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea) - * + * * @param geometry The input polygon. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles - * + * */ geodesicArea(geometry: Polygon, unit: string | number): IPromise; /** * Creates geodesic buffer polygons at a specified distance around the input geometries. When calculating distances, this method takes the curvature of the earth into account, which provides highly accurate results when dealing with very large geometries and/or geometries that spatially vary on a global scale where one projected coordinate system could not accurately plot coordinates and measure distances for all the geometries. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. In general, if your input geometries are assigned one of those two spatial references, you should always use geodesicBuffer() to obtain the most accurate results for those geometries. If needing to buffer points assigned a [projected coordinate system other than Web Mercator](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm), use [buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#buffer) instead. If the input geometries have a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer) - * + * * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param unionResults Determines whether the output geometries should be unioned into a single polygon. - * + * */ - geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; + geodesicBuffer( + geometry: Geometry | Geometry[], + distance: number | number[], + unit: string | number, + unionResults?: boolean + ): IPromise; /** * Returns a geodesically densified version of the input geometry. Use this function to draw the line(s) of the geometry along great circles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicDensify) - * + * * @param geometry A polyline or polygon to densify. * @param maxSegmentLength The maximum segment length allowed. This must be a positive value. * @param maxSegmentLengthUnit Measurement unit for `maxSegmentLength`. If a unit is not specified, the units are considered to be the same as the units of the `geometry`. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ - geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; + geodesicDensify( + geometry: Polyline | Polygon, + maxSegmentLength: number, + maxSegmentLengthUnit: string | number + ): IPromise; /** * Calculates the length of the input geometry. As opposed to [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength), geodesicLength() takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using geodesicLength(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength) - * + * * @param geometry The input geometry. * @param unit Measurement unit of the return value. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ geodesicLength(geometry: Geometry, unit: string | number): IPromise; /** * Creates a new geometry through intersection between two geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#intersect) - * + * * @param geometry The input geometry(ies). * @param intersector The geometry being intersected. - * + * */ intersect(geometry: Geometry | Geometry[], intersector: Geometry): IPromise; /** * Indicates if one geometry intersects another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#intersects) - * + * * @param geometry1 The geometry that is tested for the intersects relationship to the other geometry. * @param geometry2 The geometry being intersected. - * + * */ intersects(geometry1: Geometry, geometry2: Geometry): IPromise; /** * Indicates if the given geometry is topologically simple. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#isSimple) - * + * * @param geometry The input geometry. - * + * */ isSimple(geometry: Geometry): IPromise; /** * Finds the coordinate of the geometry that is closest to the specified point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestCoordinate) - * + * * @param geometry The geometry to consider. * @param inputPoint The point used to search the nearest coordinate in the geometry. - * + * */ nearestCoordinate(geometry: Geometry, inputPoint: Point): IPromise; /** * Finds vertex on the geometry nearest to the specified point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestVertex) - * + * * @param geometry The geometry to consider. * @param inputPoint The point used to search the nearest vertex in the geometry. - * + * */ nearestVertex(geometry: Geometry, inputPoint: Point): IPromise; /** * Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of Objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestVertices) - * + * * @param geometry The geometry to consider. * @param inputPoint The point from which to measure. * @param searchRadius The distance to search from the inputPoint in the units of the view's spatial reference. * @param maxVertexCountToReturn The maximum number of vertices to return. - * + * */ - nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): IPromise; + nearestVertices( + geometry: Geometry, + inputPoint: Point, + searchRadius: number, + maxVertexCountToReturn: number + ): IPromise; /** * The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon. It is similar to buffering, but produces a one-sided result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#offset) - * + * * @param geometry The geometries to offset. * @param offsetDistance The planar distance to offset from the input geometry. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, if offsetDistance = 0, then there is no change in the geometries, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the "right side" of a simple polygon is always its inside. * @param offsetUnit Measurement unit of the offset distance. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param joinType The join type. **Possible values:** round | bevel | miter | square * @param bevelRatio Applicable when `joinType = 'miter'`; bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. * @param flattenError Applicable when `joinType = 'round'`; flattenError determines the maximum distance of the resulting segments compared to the true circular arc. The algorithm never produces more than around 180 vertices for each round join. - * + * */ - offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): IPromise; + offset( + geometry: Geometry | Geometry[], + offsetDistance: number, + offsetUnit: string | number, + joinType: string, + bevelRatio?: number, + flattenError?: number + ): IPromise; /** * Indicates if one geometry overlaps another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#overlaps) - * + * * @param geometry1 The base geometry that is tested for the "overlaps" relationship with the other geometry. * @param geometry2 The comparison geometry that is tested for the "overlaps" relationship with the other geometry. - * + * */ overlaps(geometry1: Geometry, geometry2: Geometry): IPromise; /** * Calculates the area of the input geometry. As opposed to [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea), planarArea() performs this calculation using projected coordinates and does not take into account the earth's curvature. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea) - * + * * @param geometry The input polygon. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles - * + * */ planarArea(geometry: Polygon, unit: string | number): IPromise; /** * Calculates the length of the input geometry. As opposed to [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength), planarLength() uses projected coordinates and does not take into account the curvature of the earth when performing this calculation. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength). If the input geometries have a projected coordinate system other than Web Mercator, use planarLength() instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength) - * + * * @param geometry The input geometry. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ planarLength(geometry: Geometry, unit: string | number): IPromise; /** * Indicates if the given DE-9IM relation holds for the two geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#relate) - * + * * @param geometry1 The first geometry for the relation. * @param geometry2 The second geometry for the relation. * @param relation The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: `0`,`1`,`2`), a Boolean value (`T` or `F`), or a mask character (for ignoring results: '\*'). Example: Each of the following DE-9IM string codes are valid for testing whether a polygon geometry completely contains a line geometry: `TTTFFTFFT` (Boolean), 'T\*\*\*\*\*FF\*' (ignore irrelevant intersections), or '102FF\*FF\*' (dimension form). Each returns the same result. See [this article](https://en.wikipedia.org/wiki/DE-9IM) and [this ArcGIS help page](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) for more information about the DE-9IM model and how string codes are constructed. - * + * */ relate(geometry1: Geometry, geometry2: Geometry, relation: string): IPromise; /** * Rotates a geometry counterclockwise by the specified number of degrees. Rotation is around the centroid, or a given rotation point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#rotate) - * + * * @param geometry The geometry to rotate. * @param angle The rotation angle in degrees. * @param rotationOrigin Point to rotate the geometry around. Defaults to the centroid of the geometry. - * + * */ rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): IPromise; /** * Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#simplify) - * + * * @param geometry The geometry to be simplified. - * + * */ simplify(geometry: Geometry): IPromise; /** * Creates the symmetric difference of two geometries. The symmetric difference includes the parts that are in either of the sets, but not in both. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#symmetricDifference) - * + * * @param leftGeometry One of the Geometry instances in the XOR operation. * @param rightGeometry One of the Geometry instances in the XOR operation. - * + * */ symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): IPromise; /** * Indicates if one geometry touches another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#touches) - * + * * @param geometry1 The geometry to test the "touches" relationship with the other geometry. * @param geometry2 The geometry to be touched. - * + * */ touches(geometry1: Geometry, geometry2: Geometry): IPromise; /** * All inputs must be of the same type of geometries and share one spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#union) - * + * * @param geometries An array of Geometries to union. - * + * */ union(geometries: Geometry[]): IPromise; /** * Indicates if one geometry is within another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#within) - * + * * @param innerGeometry The base geometry that is tested for the "within" relationship to the other geometry. * @param outerGeometry The comparison geometry that is tested for the "contains" relationship to the other geometry. - * + * */ within(innerGeometry: Geometry, outerGeometry: Geometry): IPromise; } @@ -3428,39 +3575,37 @@ declare namespace __esri { interface HeightModelInfo extends Accessor, JSONSupport { /** - * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. - * + * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. + * * Value | Description * ------|------------ * gravity-related-height | A gravity-related VCS may set its zero point through a local mean sea level or a benchmark, and is compatible with other gravity-related VCS for the purposes of rendering. * ellipsoidal | An ellipsoidal VCS defines heights that are referenced to an ellipsoid of a geographic coordinate system. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightModel) - * + * * @default "gravity-related-height" */ readonly heightModel: string; /** * The unit of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will use this property to check that the vertical data of layers that define a HeightModelInfo is compatible with the view. **Possible Values:** meters | feet | us-feet | clarke-feet | clarke-yards | clarke-links | sears-yards | sears-feet | sears-chains | benoit-1895-b-chains | indian-yards | indian-1937-yards | gold-coast-feet | sears-1922-truncated-chains | 50-kilometers | 150-kilometers - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightUnit) - * + * * @default "meters" */ readonly heightUnit: string; /** * The datum realization of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers that define a HeightModelInfo with an identical `vertCRS` to that of the scene, when using an `ellipsoidal` height model. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#vertCRS) */ readonly vertCRS: string; } interface HeightModelInfoConstructor { - - - new(properties?: HeightModelInfoProperties): HeightModelInfo; + new (properties?: HeightModelInfoProperties): HeightModelInfo; fromJSON(json: any): HeightModelInfo; } @@ -3469,30 +3614,30 @@ declare namespace __esri { interface HeightModelInfoProperties { /** - * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. - * + * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. + * * Value | Description * ------|------------ * gravity-related-height | A gravity-related VCS may set its zero point through a local mean sea level or a benchmark, and is compatible with other gravity-related VCS for the purposes of rendering. * ellipsoidal | An ellipsoidal VCS defines heights that are referenced to an ellipsoid of a geographic coordinate system. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightModel) - * + * * @default "gravity-related-height" */ heightModel?: string; /** * The unit of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will use this property to check that the vertical data of layers that define a HeightModelInfo is compatible with the view. **Possible Values:** meters | feet | us-feet | clarke-feet | clarke-yards | clarke-links | sears-yards | sears-feet | sears-chains | benoit-1895-b-chains | indian-yards | indian-1937-yards | gold-coast-feet | sears-1922-truncated-chains | 50-kilometers | 150-kilometers - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightUnit) - * + * * @default "meters" */ heightUnit?: string; /** * The datum realization of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers that define a HeightModelInfo with an identical `vertCRS` to that of the scene, when using an `ellipsoidal` height model. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#vertCRS) */ vertCRS?: string; @@ -3501,94 +3646,94 @@ declare namespace __esri { interface Mesh extends Geometry { /** * An array of mesh components that can be used to apply materials to different regions of the same mesh. There are three common usage patterns for components. 1. **Specify a material for the whole mesh.** In this case, use a single component with only a material (leaving faces as `null`). 2. **Reuse vertex attributes.** When modeling continuous surfaces, it can be convenient to only specify vertices once and then simply refer to them. In this case, use a single component with faces set to index the vertex attributes that form triangles. 3. **Specify multiple materials for the same mesh.** In this case, use multiple components with faces that determine to which region of the mesh the material of the component applies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#components) */ components: MeshComponent[]; /** * For Mesh, the type is always `mesh`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#type) */ readonly type: "mesh"; /** * Object describing the attributes of each vertex of the mesh. Vertex attributes are flat numerical arrays that describe the position (mandatory), normal (used for lighting calculations and shading) and uv (used for mapping material images to the mesh surface) for each vertex. Vertex attributes can be addressed by indices specified in the components [faces](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) property. If the mesh does not contain any components, or if a component does not specify any faces, then the vertex attributes are interpreted as if each consecutive vertex triple makes up a triangle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ vertexAttributes: MeshVertexAttributes; /** * Adds a component to the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#addComponent) - * + * * @param component The component to add. - * + * */ addComponent(component: MeshComponent): void; /** * Centers the mesh at the specified location without changing its scale. The mesh will be modified in place. To modify a copy of the mesh instead, use [clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#clone) before calling [centerAt()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#centerAt). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#centerAt) - * + * * @param location The location at which to center the mesh. * @param params Additional parameters. * @param params.geographic Indicates whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the offset applied to center the mesh is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. * @param params.origin The origin at which to center. If not specified, the mesh will be centered at the mesh extent center. - * + * */ centerAt(location: Point, params?: MeshCenterAtParams): Mesh; /** * Creates a deep clone of the Mesh object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#clone) - * - * + * + * */ clone(): Mesh; /** * Offsets the mesh geometry by the specified distance in x, y, and z. The units of x, y, and z are the units of the spatial reference. When the offset is applied geographically (default for either WGS84 or WebMercator), then the offsets are interpreted in meters. The mesh will be modified in place. To modify a copy of the mesh instead, use [clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#clone) before calling [offset()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#offset). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#offset) - * + * * @param dx The amount to offset the geometry in the x direction. * @param dy The amount to offset the geometry in the y direction. * @param dz The amount to offset the geometry in the z direction. * @param params Additional parameters. * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the offset is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. - * + * */ offset(dx: number, dy: number, dz: number, params?: MeshOffsetParams): Mesh; /** * Removes a component from the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#removeComponent) - * + * * @param component The component to remove. - * + * */ removeComponent(component: MeshComponent): void; /** * Rotates the mesh geometry around its x, y and z axis (in that order). For each rotation angle, the rotation direction is clockwise when looking in the direction of the respective axis. The mesh will be modified in place. To modify a copy of the mesh instead, use [clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#clone) before calling [rotate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#rotate). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#rotate) - * + * * @param angleX The angle by which to rotate around the x-axis (in degrees). * @param angleY The angle by which to rotate around the y-axis (in degrees). * @param angleZ The angle by which to rotate around the z-axis (in degrees). * @param params Additional parameters. * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the rotation is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. * @param params.origin The origin around which to rotate. If not specified, the mesh will be rotated around the mesh extent center. - * + * */ rotate(angleX: number, angleY: number, angleZ: number, params?: MeshRotateParams): Mesh; /** * Notifies that any cached values that depend on vertex attributes need to be recalculated. Use this method after modifying the vertex attributes in place so that values that depend on them (such as the calculation of the extent) are recalculated accordingly. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributesChanged) - * - * + * + * */ vertexAttributesChanged(): void; } @@ -3596,78 +3741,77 @@ declare namespace __esri { interface MeshConstructor { /** * A mesh is a general, client-side 3D [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) type composed of [vertices with attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes). The vertices include geographic position, normals that affect lighting/shading and uv coordinates that can be used to map images to the mesh. Vertices are combined into 3D primitives to render the mesh in the scene (only triangle primitives are currently supported). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) */ - new(properties?: MeshProperties): Mesh; - + new (properties?: MeshProperties): Mesh; /** * 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) - * + * * @param location The location bottom center of the box. * @param params Additional parameters. * @param params.size A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. * @param params.material The material to be used for the mesh. * @param params.imageFace The face for generating image uv coordinates. By default, a single set of unwrapped UV coordinates are generated for all the faces. By setting the `imageFace` parameter to one of `east`, `west`, `north`, `south`, `up` or `down`, the specified face will have full sized UV coordinates while the other faces will pertain their regular unwrapped UV coordinates. This is useful for applying an image only to a single face of the box. The provided `material` parameter will be applied to the specified `imageFace`. The resulting mesh will have two components, the first contains the selected image face and the second contains the other faces of the box. - * + * */ 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): - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) - * + * * @param location The location of the bottom center of the cylinder. * @param params Additional parameters. * @param params.size A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. * @param params.densificationFactor The additional number of subdivisions for generating the mesh representing a cylinder. A densificationFactor parameter of 0 will generate a default of 16 vertices to approximate the cylinder. A densificationFactor of 1 will generate 32 vertices, etc. The larger the densificationFactor, the better the mesh will approximate a perfect cylinder (at the cost of processing and rendering performance). * @param params.material The material to be used for the mesh. - * + * */ createCylinder(location: Point, params?: MeshCreateCylinderParams): Mesh; /** * Creates a new mesh geometry from a polygon geometry. The resulting mesh contains only a position vertex attribute and a single component with faces. The default shading will be set to `flat`. The spatial reference of the resulting mesh is the same as the input polygon. The resulting mesh will not contain any uv nor normal vertex attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createFromPolygon) - * + * * @param polygon The input polygon. * @param params Optional parameters. * @param params.material The material to be used for the mesh. - * + * */ 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: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) - * + * * @param location The location of the bottom center of the plane. * @param params Additional parameters. * @param params.size A uniform size value or an object containing individual values width and height. The unit of the size values is derived from the spatial reference of the provided location. * @param params.facing Direction the plane is facing. Possible values are `east`, `west`, `north`, `south`, `up` and `down`. Defaults to `up`, * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. * @param params.material The material to be used for the mesh. - * + * */ 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): - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) - * + * * @param location The location of the bottom center of the sphere. * @param params Additional parameters. * @param params.size A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. * @param params.geographic Indicates whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. * @param params.densificationFactor The additional number of subdivisions for generating the mesh representing a sphere. A densificationFactor parameter of 0 will generate a default of 16-by-16 vertices to approximate the sphere. A densificationFactor of 1 will generate 32-by-32 vertices, etc. The larger the densificationFactor, the better the mesh will approximate a perfect sphere (at the cost of processing and rendering performance). * @param params.material The material to be used for the mesh. - * + * */ createSphere(location: Point, params?: MeshCreateSphereParams): Mesh; @@ -3679,337 +3823,319 @@ declare namespace __esri { interface MeshProperties extends GeometryProperties { /** * An array of mesh components that can be used to apply materials to different regions of the same mesh. There are three common usage patterns for components. 1. **Specify a material for the whole mesh.** In this case, use a single component with only a material (leaving faces as `null`). 2. **Reuse vertex attributes.** When modeling continuous surfaces, it can be convenient to only specify vertices once and then simply refer to them. In this case, use a single component with faces set to index the vertex attributes that form triangles. 3. **Specify multiple materials for the same mesh.** In this case, use multiple components with faces that determine to which region of the mesh the material of the component applies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#components) */ components?: MeshComponentProperties[]; /** * Object describing the attributes of each vertex of the mesh. Vertex attributes are flat numerical arrays that describe the position (mandatory), normal (used for lighting calculations and shading) and uv (used for mapping material images to the mesh surface) for each vertex. Vertex attributes can be addressed by indices specified in the components [faces](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) property. If the mesh does not contain any components, or if a component does not specify any faces, then the vertex attributes are interpreted as if each consecutive vertex triple makes up a triangle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ vertexAttributes?: MeshVertexAttributesProperties; } - export interface MeshCenterAtParams extends Object { /** * Indicates whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the offset applied to center the mesh is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#centerAt) */ geographic?: boolean; /** * The origin at which to center. If not specified, the mesh will be centered at the mesh extent center. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#centerAt) */ origin?: Point; } - export interface MeshCreateBoxParams extends Object { /** * A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ size?: number | MeshCreateBoxParamsSize; /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ geographic?: boolean; /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ material?: MeshCreateBoxParamsMaterial; /** * The face for generating image uv coordinates. By default, a single set of unwrapped UV coordinates are generated for all the faces. By setting the `imageFace` parameter to one of `east`, `west`, `north`, `south`, `up` or `down`, the specified face will have full sized UV coordinates while the other faces will pertain their regular unwrapped UV coordinates. This is useful for applying an image only to a single face of the box. The provided `material` parameter will be applied to the specified `imageFace`. The resulting mesh will have two components, the first contains the selected image face and the second contains the other faces of the box. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ imageFace?: string; } - export interface MeshCreateBoxParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreateBoxParamsSize extends Object { /** * The width of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ width?: number; /** * The depth of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ depth?: number; /** * The height of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ height?: number; } - export interface MeshCreateCylinderParams extends Object { /** * A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ size?: number | MeshCreateCylinderParamsSize; /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ geographic?: boolean; /** * The additional number of subdivisions for generating the mesh representing a cylinder. A densificationFactor parameter of 0 will generate a default of 16 vertices to approximate the cylinder. A densificationFactor of 1 will generate 32 vertices, etc. The larger the densificationFactor, the better the mesh will approximate a perfect cylinder (at the cost of processing and rendering performance). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ densificationFactor?: number; /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ material?: MeshCreateCylinderParamsMaterial; } - export interface MeshCreateCylinderParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ color: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreateCylinderParamsSize extends Object { /** * The width of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ width?: number; /** * The depth of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ depth?: number; /** * The height of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ height?: number; } - export interface MeshCreateFromPolygonParams extends Object { /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createFromPolygon) */ material?: MeshCreateFromPolygonParamsMaterial; } - export interface MeshCreateFromPolygonParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createFromPolygon) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreatePlaneParams extends Object { /** * A uniform size value or an object containing individual values width and height. The unit of the size values is derived from the spatial reference of the provided location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ size?: number | MeshCreatePlaneParamsSize; /** * Direction the plane is facing. Possible values are `east`, `west`, `north`, `south`, `up` and `down`. Defaults to `up`, - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ facing?: string; /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ geographic?: boolean; /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ material?: MeshCreatePlaneParamsMaterial; } - export interface MeshCreatePlaneParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreatePlaneParamsSize extends Object { /** * The width of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ width?: number; /** * The height of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ height?: number; } - export interface MeshCreateSphereParams extends Object { /** * A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ size?: number | MeshCreateSphereParamsSize; /** * Indicates whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ geographic?: boolean; /** * The additional number of subdivisions for generating the mesh representing a sphere. A densificationFactor parameter of 0 will generate a default of 16-by-16 vertices to approximate the sphere. A densificationFactor of 1 will generate 32-by-32 vertices, etc. The larger the densificationFactor, the better the mesh will approximate a perfect sphere (at the cost of processing and rendering performance). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ densificationFactor?: number; /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ material?: MeshCreateSphereParamsMaterial; } - export interface MeshCreateSphereParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreateSphereParamsSize extends Object { /** * The width of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ width?: number; /** * The depth of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ depth?: number; /** * The height of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ height?: number; } - export interface MeshOffsetParams extends Object { /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the offset is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#offset) */ geographic?: boolean; } - export interface MeshRotateParams extends Object { /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the rotation is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#rotate) */ geographic?: boolean; /** * The origin around which to rotate. If not specified, the mesh will be rotated around the mesh extent center. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#rotate) */ origin?: Point; } - export interface MeshVertexAttributesProperties extends Object { /** * A flat array of vertex positions. Vertex positions have x, y and z coordinates and they should be in the spatial reference system of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ position?: Float64Array | number[] | Float32Array; /** * A flat array of vertex uv coordinates (2 elements per vertex). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ uv?: Float32Array | number[] | Float64Array; /** * 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[] | 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; @@ -4018,25 +4144,25 @@ declare namespace __esri { export interface MeshVertexAttributes extends AnonymousAccessor { /** * A flat array of vertex positions. Vertex positions have x, y and z coordinates and they should be in the spatial reference system of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ position: Float64Array; /** * A flat array of vertex uv coordinates (2 elements per vertex). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ uv?: Float32Array; /** * 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; @@ -4045,68 +4171,66 @@ declare namespace __esri { interface Multipoint extends Geometry { /** * An array of points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) */ points: number[][]; /** * For Multipoint, the type is always `multipoint`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#type) */ readonly type: "multipoint"; /** * Adds a point to the Multipoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#addPoint) - * + * * @param point The point to add to the multipoint. The point can either be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of numbers representing XY coordinates. - * + * */ addPoint(point: Point | number[]): Multipoint; /** * Creates a deep clone of Multipoint object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#clone) - * - * + * + * */ clone(): Multipoint; /** * Returns the point at the specified index. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#getPoint) - * + * * @param index The index of the point in the [points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) property. - * + * */ getPoint(index: number): Point; /** * Removes a point from the Multipoint. The index specifies which point to remove. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#removePoint) - * + * * @param index The index of the point to remove. - * + * */ removePoint(index: number): Point; /** * Updates the point at the specified index. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#setPoint) - * + * * @param index The index of the point in the [points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) property. * @param point Point geometry that specifies the new location. - * + * */ setPoint(index: number, point: Point): Multipoint; } interface MultipointConstructor { - - - new(properties?: MultipointProperties): Multipoint; + new (properties?: MultipointProperties): Multipoint; fromJSON(json: any): Multipoint; } @@ -4116,7 +4240,7 @@ declare namespace __esri { interface MultipointProperties extends GeometryProperties { /** * An array of points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) */ points?: number[][]; @@ -4125,97 +4249,97 @@ declare namespace __esri { interface Point extends Geometry { /** * The latitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#latitude) */ latitude: number; /** * The longitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#longitude) */ longitude: number; /** * The m-coordinate of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#m) - * + * * @default undefined */ m: number; /** * For Point, the type is always `point`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#type) */ readonly type: "point"; /** * The x-coordinate (easting) of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#x) - * + * * @default 0 */ x: number; /** * The y-coordinate (northing) of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#y) - * + * * @default 0 */ y: number; /** - * The z-coordinate (or elevation) of the point in map units. + * The z-coordinate (or elevation) of the point in map units. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#z) - * + * * @default undefined */ z: number; /** * Creates a deep clone of Point object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone) - * - * + * + * */ clone(): Point; /** * Copies all values from another Point instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#copy) - * + * * @param other The point to copy from. - * + * */ copy(other: Point): void; /** * Computes the Euclidean distance between this Point and a given Point. Points must have the same spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#distance) - * + * * @param other The point to compute the distance to. - * + * */ distance(other: Point): number; /** * Determines if the input point is equal to the point calling the function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#equals) - * + * * @param point The input point to test. - * + * */ equals(point: Point): boolean; /** * Modifies the point geometry in-place by shifting the X-coordinate to within +/- 180 span in map units. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone) the point object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#normalize) - * - * + * + * */ normalize(): Point; } @@ -4223,11 +4347,11 @@ declare namespace __esri { interface PointConstructor { /** * A location defined by X, Y, and Z coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) */ - new(properties?: PointProperties): Point; + new (properties?: PointProperties): Point; fromJSON(json: any): Point; } @@ -4237,46 +4361,46 @@ declare namespace __esri { interface PointProperties extends GeometryProperties { /** * The latitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#latitude) */ latitude?: number; /** * The longitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#longitude) */ longitude?: number; /** * The m-coordinate of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#m) - * + * * @default undefined */ m?: number; /** * The x-coordinate (easting) of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#x) - * + * * @default 0 */ x?: number; /** * The y-coordinate (northing) of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#y) - * + * * @default 0 */ y?: number; /** - * The z-coordinate (or elevation) of the point in map units. + * The z-coordinate (or elevation) of the point in map units. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#z) - * + * * @default undefined */ z?: number; @@ -4285,121 +4409,121 @@ declare namespace __esri { interface Polygon extends Geometry { /** * The centroid of the polygon. For a polygon with multiple rings, it represents the centroid of the largest ring. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#centroid) */ centroid: Point; /** * Checks to see if polygon rings cross each other and indicates if the polygon is self-intersecting, which means the ring of the polygon crosses itself. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting) */ isSelfIntersecting: boolean; /** * An array of rings. Each ring is a two-dimensional array of numbers representing the coordinates of each vertex in the ring in the spatial reference of the view. The first vertex of each ring should always be the same as the last vertex. Each vertex is an array of two, three, or four numbers. The table below shows the various structures of a vertex array. - * + * * Case | Vertex array * --- | --- * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM)| [x, y] * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, m] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z, m] - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) */ rings: number[][][]; /** * For Polygon, the type is always `polygon`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#type) */ readonly type: "polygon"; /** * Adds a ring to the Polygon. The ring can be one of the following: an array of numbers or an array of points. When added the index of the ring is incremented by one. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#addRing) - * + * * @param points A polygon ring. The first and last coordinates/points in the ring must be the same. This can either be defined as an array of Point geometries or an array of XY coordinates. - * + * */ addRing(points: Point[] | number[][]): Polygon; /** * Creates a deep clone of Polygon object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#clone) - * - * + * + * */ clone(): Polygon; /** * Checks on the client if the input point is inside the polygon. A point on the polygon line is considered inside. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#contains) - * + * * @param point The point to test whether it is contained within the testing polygon. - * + * */ contains(point: Point): boolean; /** * Returns a point specified by a ring and point in the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#getPoint) - * + * * @param ringIndex The index of the ring containing the desired point. * @param pointIndex The index of the desired point within the ring. - * + * */ getPoint(ringIndex: number, pointIndex: number): Point; /** * Inserts a new point into the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#insertPoint) - * + * * @param ringIndex The index of the ring in which to insert the point. * @param pointIndex The index of the point to insert within the ring. * @param point The point to insert. - * + * */ insertPoint(ringIndex: number, pointIndex: number, point: Point | number[]): Polygon; /** * Checks if a Polygon ring is clockwise. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isClockwise) - * + * * @param ring A polygon ring. The first and last coordinates/points in the ring must be the same. This can either be defined as an array of Point geometries or an array of XY coordinates. - * + * */ isClockwise(ring: Point[] | number[][]): boolean; /** * Removes a point from the polygon at the given `pointIndex` within the ring identified by `ringIndex`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#removePoint) - * + * * @param ringIndex The index of the ring containing the point to remove. * @param pointIndex The index of the point to remove within the ring. - * + * */ removePoint(ringIndex: number, pointIndex: number): Point[]; /** * Removes a ring from the Polygon. The index specifies which ring to remove. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#removeRing) - * + * * @param index The index of the ring to remove. - * + * */ removeRing(index: number): Point[]; /** * Updates a point in the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#setPoint) - * + * * @param ringIndex The index of the ring containing the point to update. * @param pointIndex The index of the point to update within the ring. * @param point The new point geometry. - * + * */ setPoint(ringIndex: number, pointIndex: number, point: Point | number[]): Polygon; } @@ -4407,20 +4531,19 @@ declare namespace __esri { interface PolygonConstructor { /** * A polygon contains an array of [rings](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) and a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#spatialReference). Each ring is represented as an array points. The first and last points of a ring must be the same. A polygon also has boolean-valued [hasM](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) and [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) */ - new(properties?: PolygonProperties): Polygon; - + new (properties?: PolygonProperties): Polygon; /** * Converts the given Extent to a Polygon instance. This is useful for scenarios in which you would like to display an area of interest, which is typically defined by an Extent or bounding box, as a polygon with a fill symbol in the view. Some geoprocessing tools require input geometries to be of a Polygon type and not an Extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#fromExtent) - * + * * @param extent An extent object to convert to a polygon. - * + * */ fromExtent(extent: Extent): Polygon; @@ -4432,27 +4555,27 @@ declare namespace __esri { interface PolygonProperties extends GeometryProperties { /** * The centroid of the polygon. For a polygon with multiple rings, it represents the centroid of the largest ring. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#centroid) */ centroid?: PointProperties; /** * Checks to see if polygon rings cross each other and indicates if the polygon is self-intersecting, which means the ring of the polygon crosses itself. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting) */ isSelfIntersecting?: boolean; /** * An array of rings. Each ring is a two-dimensional array of numbers representing the coordinates of each vertex in the ring in the spatial reference of the view. The first vertex of each ring should always be the same as the last vertex. Each vertex is an array of two, three, or four numbers. The table below shows the various structures of a vertex array. - * + * * Case | Vertex array * --- | --- * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM)| [x, y] * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, m] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z, m] - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) */ rings?: number[][][]; @@ -4461,99 +4584,97 @@ declare namespace __esri { interface Polyline extends Geometry { /** * An array of paths, or line segments, that make up the polyline. Each path is a two-dimensional array of numbers representing the coordinates of each vertex in the path in the spatial reference of the view. Each vertex is represented as an array of two, three, or four numbers. The table below shows the various structures of a vertex array. - * + * * Case | Vertex array * --- | --- * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y] * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, m] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z, m] - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#paths) */ paths: number[][][]; /** * For Polyline, the type is always `polyline`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#type) */ readonly type: "polyline"; /** * Adds a path, or line segment, to the polyline. When added, the index of the path is incremented by one. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#addPath) - * + * * @param points A polyline path. This can either be defined as an array of Point geometries or an array of XY coordinates. - * + * */ addPath(points: Point[] | number[][]): Polyline; /** * Creates a deep clone of Polyline object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#clone) - * - * + * + * */ clone(): Polyline; /** * Returns a point specified by a path and point in the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#getPoint) - * + * * @param pathIndex The index of a path in the polyline. * @param pointIndex The index of a point in a path. - * + * */ getPoint(pathIndex: number, pointIndex: number): Point; /** * Inserts a new point into a polyline. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#insertPoint) - * + * * @param pathIndex The index of the path in which to insert a point. * @param pointIndex The index of the inserted point in the path. * @param point The point to insert. - * + * */ insertPoint(pathIndex: number, pointIndex: number, point: Point | number[]): Polyline; /** * Removes a path from the Polyline. The index specifies which path to remove. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#removePath) - * + * * @param index The index of the path to remove from the polyline. - * + * */ removePath(index: number): Point[]; /** * Removes a point from the polyline at the given `pointIndex` within the path identified by the given `pathIndex`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#removePoint) - * + * * @param pathIndex The index of the path containing the point to be removed. * @param pointIndex The index of the point to be removed within the path. - * + * */ removePoint(pathIndex: number, pointIndex: number): Point; /** * Updates a point in a polyline. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#setPoint) - * + * * @param pathIndex The index of the path that contains the point to be updated. * @param pointIndex The index of the point to be updated in the path. * @param point Point geometry to update in the path. - * + * */ setPoint(pathIndex: number, pointIndex: number, point: Point | number[]): Polyline; } interface PolylineConstructor { - - - new(properties?: PolylineProperties): Polyline; + new (properties?: PolylineProperties): Polyline; fromJSON(json: any): Polyline; } @@ -4563,15 +4684,15 @@ declare namespace __esri { interface PolylineProperties extends GeometryProperties { /** * An array of paths, or line segments, that make up the polyline. Each path is a two-dimensional array of numbers representing the coordinates of each vertex in the path in the spatial reference of the view. Each vertex is represented as an array of two, three, or four numbers. The table below shows the various structures of a vertex array. - * + * * Case | Vertex array * --- | --- * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y] * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, m] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z, m] - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#paths) */ paths?: number[][][]; @@ -4579,74 +4700,86 @@ declare namespace __esri { /** * A client-side projection engine for converting geometries from one [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) to another. When projecting geometries the starting spatial reference must be specified on the input geometry. You can specify a specific geographic (datum) transformation for the [project](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) operation, or accept the default transformation if one is needed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) */ interface projection { /** - * Returns the default geographic transformation used to convert the geometry from the input spatial reference to the output spatial reference. The default transformation is used when [projecting geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) where the datum transformation is required but not specified in the `geographicTransformation` parameter. - * > **Known Limitations** + * Returns the default geographic transformation used to convert the geometry from the input spatial reference to the output spatial reference. The default transformation is used when [projecting geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) where the datum transformation is required but not specified in the `geographicTransformation` parameter. + * > **Known Limitations** * * This method returns equation-based geographic transformations only. * * Geographic transformations are returned with their maximum number of [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html#steps). Currently, number of steps is limited to 2. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#getTransformation) - * + * * @param inSpatialReference The input spatial reference from which to project geometries. This is the spatial reference of the input geometries. * @param outSpatialReference The spatial reference to which you are converting the geometries. * @param extent An extent used to determine the suitability of the returned transformation. The extent will be re-projected to the `inSpatialReference` if it has a different spatial reference. - * + * */ - getTransformation(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference | SpatialReferenceProperties, extent?: Extent): GeographicTransformation; + getTransformation( + inSpatialReference: SpatialReference | SpatialReferenceProperties, + outSpatialReference: SpatialReference | SpatialReferenceProperties, + extent?: Extent + ): GeographicTransformation; /** - * Returns a list of all geographic transformations suitable to convert geometries from the input spatial reference to the specified output spatial reference. The list is ordered in descending order by suitability, with the most suitable being first in the list. - * > **Known Limitations** + * Returns a list of all geographic transformations suitable to convert geometries from the input spatial reference to the specified output spatial reference. The list is ordered in descending order by suitability, with the most suitable being first in the list. + * > **Known Limitations** * * This method returns all the suitable equation-based geographic transformations. * * Geographic transformations are returned with their maximum number of [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html#steps). Currently, number of steps is limited to 2. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#getTransformations) - * + * * @param inSpatialReference The spatial reference that the geometries are currently using. * @param outSpatialReference The spatial reference to which you are converting the geometries to. * @param extent An extent used to determine the suitability of the returned transformations. The extent will be re-projected to the input spatial reference if necessary. - * + * */ - getTransformations(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference | SpatialReferenceProperties, extent?: Extent): GeographicTransformation[]; + getTransformations( + inSpatialReference: SpatialReference | SpatialReferenceProperties, + outSpatialReference: SpatialReference | SpatialReferenceProperties, + extent?: Extent + ): GeographicTransformation[]; /** * Indicates if all dependencies of this module have been loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#isLoaded) - * - * + * + * */ isLoaded(): boolean; /** * Indicates if this module is supported in the browser. The browser must support [WebAssembly](https://caniuse.com/#feat=wasm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#isSupported) - * - * + * + * */ isSupported(): boolean; /** * Loads this module's dependencies. This method must be called before [projecting](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#load) - * - * + * + * */ load(): IPromise; /** - * Projects a geometry or an array of geometries to the specified output spatial reference. A default geographic transformation is used if not explicitly provided, but required. Use the [getTransformation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#getTransformation) method to find out which transformation is used by default for the given input and output spatial references. Note that you must [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#load) this module before attempting to project geometries. + * Projects a geometry or an array of geometries to the specified output spatial reference. A default geographic transformation is used if not explicitly provided, but required. Use the [getTransformation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#getTransformation) method to find out which transformation is used by default for the given input and output spatial references. Note that you must [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#load) this module before attempting to project geometries. * > **Known Limitations** This method uses the spatial reference of the first geometry as an input spatial reference. Therefore all geometries in the array must have the same spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) - * + * * @param geometry The geometry or geometries to project. * @param outSpatialReference The spatial reference to which you are converting the geometries' coordinates. * @param geographicTransformation The geographic transformation used to transform the geometries. Specify this parameter to project a geometry when the default transformation is not appropriate for your requirements. - * + * */ - project(geometry: Geometry | Geometry[], outSpatialReference: SpatialReference | SpatialReferenceProperties, geographicTransformation?: GeographicTransformation): Geometry | Geometry[]; + project( + geometry: Geometry | Geometry[], + outSpatialReference: SpatialReference | SpatialReferenceProperties, + geographicTransformation?: GeographicTransformation + ): Geometry | Geometry[]; } export const projection: projection; @@ -4654,35 +4787,33 @@ declare namespace __esri { interface ScreenPoint extends Accessor { /** * X-coordinate in pixels relative to the top-left corner of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#x) - * + * * @default 0 */ x: number; /** * Y-coordinate in pixels relative to the top-left corner of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#y) - * + * * @default 0 */ y: number; /** * Creates a deep clone of ScreenPoint object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#clone) - * - * + * + * */ clone(): ScreenPoint; } interface ScreenPointConstructor { - - - new(properties?: ScreenPointProperties): ScreenPoint; + new (properties?: ScreenPointProperties): ScreenPoint; } export const ScreenPoint: ScreenPointConstructor; @@ -4690,17 +4821,17 @@ declare namespace __esri { interface ScreenPointProperties { /** * X-coordinate in pixels relative to the top-left corner of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#x) - * + * * @default 0 */ x?: number; /** * Y-coordinate in pixels relative to the top-left corner of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#y) - * + * * @default 0 */ y?: number; @@ -4709,75 +4840,72 @@ declare namespace __esri { interface SpatialReference extends Accessor, JSONSupport { /** * Indicates if the spatial reference refers to a geographic coordinate system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isGeographic) */ readonly isGeographic: boolean; /** * Indicates if the [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) of the spatial reference object is one of the following values: `102113`, `102100`, `3857`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) */ readonly isWebMercator: boolean; /** * Indicates if the [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) of the spatial reference object is `4326`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWGS84) */ readonly isWGS84: boolean; /** * Indicates if the spatial reference of the map supports wrapping around the International Date Line. Value is `true` if the spatial reference is Web Mercator or WGS84. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWrappable) */ readonly isWrappable: boolean; /** * The well-known ID of a spatial reference. See [Projected Coordinate Systems](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) and [Geographic Coordinate Systems](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) for the list of supported spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) */ wkid: number; /** * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to setup and use a proxy page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) */ wkt: string; /** * Returns a deep clone of the spatial reference object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#clone) - * - * + * + * */ clone(): SpatialReference; /** * Checks if the specified spatial reference object has the same [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) or [wkt](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) as this spatial reference object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#equals) - * + * * @param spatialReference The spatial reference to compare to. - * + * */ equals(spatialReference: SpatialReference): boolean; } interface SpatialReferenceConstructor { - - - new(properties?: SpatialReferenceProperties): SpatialReference; - + new (properties?: SpatialReferenceProperties): SpatialReference; /** * A convenience spatial reference instance for Web Mercator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#WebMercator) */ WebMercator: SpatialReference; /** * A convenience spatial reference instance for WGS84. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#WGS84) */ WGS84: SpatialReference; @@ -4790,13 +4918,13 @@ declare namespace __esri { interface SpatialReferenceProperties { /** * The well-known ID of a spatial reference. See [Projected Coordinate Systems](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) and [Geographic Coordinate Systems](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) for the list of supported spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) */ wkid?: number; /** * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to setup and use a proxy page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) */ wkt?: string; @@ -4805,17 +4933,17 @@ declare namespace __esri { interface GeographicTransformation { /** * Geographic transformation steps. Each step represents a geographic transformation that will be used in the process of transforming coordinates from one geographic coordinate system to another. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html#steps) */ steps: GeographicTransformationStep[]; /** * Returns the inverse of the geographic transformation calling this method or `null` if the transformation is not invertible. The inverse of a transformation converts coordinates using the same method and parameters, but in the opposite direction of the original object. For example if the original object represents the `NAD_1983_HARN_To_NAD_1983_NSRS2007_1` transformation, then the inverse will transform from `NAD 83 (NSRS 2007)` to `NAD 83 (HARN)`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html#getInverse) - * - * + * + * */ getInverse(): GeographicTransformation; } @@ -4823,12 +4951,11 @@ declare namespace __esri { interface GeographicTransformationConstructor { /** * Projecting your data between coordinate systems sometimes requires transforming between geographic coordinate systems. Geographic transformations are used to transform coordinates between spatial references that have different geographic coordinate systems, and thus different datums. Using the most suitable transformation ensures the best possible accuracy when converting geometries from one spatial reference to another. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html) */ - - new(properties?: any): GeographicTransformation; + new (properties?: any): GeographicTransformation; } export const GeographicTransformation: GeographicTransformationConstructor; @@ -4836,40 +4963,37 @@ declare namespace __esri { interface GeographicTransformationStep { /** * Indicates with the geographic transformation is inverted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformationStep.html#isInverse) - * + * * @default false */ isInverse: boolean; /** * The well-known id (wkid) hat represents a known geographic transformation. See [Geographic datum transformations](https://developers.arcgis.com/java/10-2/guide/datum-transformations.htm#ESRI_SECTION1_7635FE2A60E6449898D5AD0ADE2CA0C3) for the list of supported equation-based geographic transformations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformationStep.html#wkid) */ wkid: number; /** * The well-known text (wkt) that represents a known geographic transformation. See [Geographic datum transformations](https://developers.arcgis.com/java/10-2/guide/datum-transformations.htm#ESRI_SECTION1_7635FE2A60E6449898D5AD0ADE2CA0C3) for the list of supported equation-based geographic transformations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformationStep.html#wkt) */ wkt: string; /** * Gets the inverse of the geographic transformation step used to call this method or `null` if the transformation step is not invertible. The inverse of a transformation converts coordinates using the same method and parameters, but in the opposite direction of the original object. For example if the original object represents the `NAD_1983_HARN_To_NAD_1983_NSRS2007_1` transformation, then the inverse will transform from `NAD 83 (NSRS 2007)` to `NAD 83 (HARN)`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformationStep.html#getInverse) - * - * + * + * */ getInverse(): GeographicTransformationStep; } interface GeographicTransformationStepConstructor { - - - - new(properties?: any): GeographicTransformationStep; + new (properties?: any): GeographicTransformationStep; } export const GeographicTransformationStep: GeographicTransformationStepConstructor; @@ -4877,37 +5001,37 @@ declare namespace __esri { 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`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#type) */ 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 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) */ url: string; /** * Creates a deep clone. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#clone) - * - * + * + * */ clone(): ImageMeshColor; } @@ -4915,11 +5039,11 @@ 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. 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) */ - new(properties?: ImageMeshColorProperties): ImageMeshColor; + new (properties?: ImageMeshColorProperties): ImageMeshColor; } export const ImageMeshColor: ImageMeshColorConstructor; @@ -4927,44 +5051,43 @@ declare namespace __esri { interface ImageMeshColorProperties { /** * 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) */ url?: string; } - interface jsonUtils { /** * Creates a new instance of an appropriate [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-jsonUtils.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/overview-of-common-data-types.htm) for examples of the structure of various input JSON objects. - * + * */ fromJSON(json: any): Geometry; /** * Returns the type for a given geometry in the JSON format used by the ArcGIS platform. This only applies to geometries that can be processed by the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-jsonUtils.html#getJsonType) - * + * * @param geometry The input geometry object. - * + * */ getJsonType(geometry: Geometry): string; } @@ -4974,36 +5097,36 @@ declare namespace __esri { interface MeshComponent extends Accessor { /** * A flat array of indices that refer to vertices in the [vertexAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) of the mesh to which the component belongs. Each triple of indices defines a triangle to render (i.e. the faces array must always have a length that is a multiple of 3). Note that the indices refer to **vertices** and not to the index of the first coordinate of a vertex in the [vertexAttributes.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) array. If faces is `null`, then all the vertices in the mesh will be rendered as triangles for this component. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) */ faces: Uint32Array; /** * The material determines how the component is visualized. Materials specify a color that may either be a single color value (a [ValueMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html)) or an image ( an [ImageMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html)), which is mapped to the uv coordinate specified for each vertex in the mesh vertex attributes. The material property supports a number of convenience autocast types, including hex color strings and well known color strings (autocasts to [ValueMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html)), or strings representing urls, HTMLImageElements or HTMLCanvasElements (autocasts to [ImageMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ material: MeshComponentMaterial; /** - * Specifies the type of normals used for lighting. This determines whether the object has a smooth or an angular appearance. The following shading types are supported: - * + * Specifies the type of normals used for lighting. This determines whether the object has a smooth or an angular appearance. The following shading types are supported: + * * | Type | Description | * |------|-------------| * | source | Shading uses the normals as defined in the vertex attributes. If no normals are defined, then shading defaults back to `flat` | * | flat | Shading uses normals created per triangle face. This type of shading is good for objects with sharp edges such as boxes. | * | smooth | Shading uses per-vertex normals that average the normals of all the faces a vertex is a part of. This type of shading is good for meshes that approximate curved surfaces such as spheres. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#shading) */ shading: string; /** * Creates a deep clone. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#clone) - * - * + * + * */ clone(): MeshComponent; } @@ -5011,11 +5134,11 @@ declare namespace __esri { interface MeshComponentConstructor { /** * The MeshComponent class is used to apply one or more materials to a single [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html). The [faces](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) property is a flat array of indices in the mesh [vertexAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) and defines the region of vertices in the mesh on which to apply the material. Each triple of values in the flat array of indices specifies a triangle to be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html) */ - new(properties?: MeshComponentProperties): MeshComponent; + new (properties?: MeshComponentProperties): MeshComponent; } export const MeshComponent: MeshComponentConstructor; @@ -5023,36 +5146,35 @@ declare namespace __esri { interface MeshComponentProperties { /** * A flat array of indices that refer to vertices in the [vertexAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) of the mesh to which the component belongs. Each triple of indices defines a triangle to render (i.e. the faces array must always have a length that is a multiple of 3). Note that the indices refer to **vertices** and not to the index of the first coordinate of a vertex in the [vertexAttributes.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) array. If faces is `null`, then all the vertices in the mesh will be rendered as triangles for this component. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) */ faces?: Uint32Array | number[] | Uint16Array; /** * The material determines how the component is visualized. Materials specify a color that may either be a single color value (a [ValueMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html)) or an image ( an [ImageMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html)), which is mapped to the uv coordinate specified for each vertex in the mesh vertex attributes. The material property supports a number of convenience autocast types, including hex color strings and well known color strings (autocasts to [ValueMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html)), or strings representing urls, HTMLImageElements or HTMLCanvasElements (autocasts to [ImageMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ material?: MeshComponentMaterialProperties; /** - * Specifies the type of normals used for lighting. This determines whether the object has a smooth or an angular appearance. The following shading types are supported: - * + * Specifies the type of normals used for lighting. This determines whether the object has a smooth or an angular appearance. The following shading types are supported: + * * | Type | Description | * |------|-------------| * | source | Shading uses the normals as defined in the vertex attributes. If no normals are defined, then shading defaults back to `flat` | * | flat | Shading uses normals created per triangle face. This type of shading is good for objects with sharp edges such as boxes. | * | smooth | Shading uses per-vertex normals that average the normals of all the faces a vertex is a part of. This type of shading is good for meshes that approximate curved surfaces such as spheres. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#shading) */ shading?: string; } - export interface MeshComponentMaterialProperties extends Object { /** * the material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ color?: ValueMeshColorProperties | ImageMeshColorProperties; @@ -5061,123 +5183,155 @@ declare namespace __esri { export interface MeshComponentMaterial extends AnonymousAccessor { /** * the material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ color: ValueMeshColor | ImageMeshColor; } - interface meshUtils { /** * Creates a mesh geometry by sampling elevation data from an elevation service on a regular grid. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#createFromElevation) - * + * * @param source The source from which to query the elevation data. * @param extent The extent from which to create the mesh. * @param params Optional parameters. * @param params.material The material. * @param params.demResolution Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See [ElevationLayer.queryElevation](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) for more details on the different settings. - * + * */ - createFromElevation(source: ElevationLayer | Ground | ElevationSampler, extent: Extent, params?: meshUtilsCreateFromElevationParams): IPromise; + 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`. 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) - * + * * @param vertexAttributes The position and normal buffers to georeference. * @param location The location at which to georeference the position and normal buffers. * @param params Optional parameters. * @param params.geographic Indicates whether to georeference relative to the globe or the projected coordinate system. - * + * */ - georeference(vertexAttributes: VertexAttributes, location: Point, params?: meshUtilsGeoreferenceParams): VertexAttributes; + georeference( + vertexAttributes: VertexAttributes, + location: Point, + params?: meshUtilsGeoreferenceParams + ): VertexAttributes; /** * Merges multiple meshes into a single mesh. All mesh geometries must be in the same spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#merge) - * + * * @param geometries One or more meshes. - * + * */ merge(geometries: Mesh[]): Mesh; + /** + * Projects georeferenced vertices to a Cartesian coordinate system. This is useful for converting existing scene geometry so that it can be used as source material for generating new 3D meshes. This method operates on mesh vertex attributes and will convert positions and normals (if specified) from georeferenced coordinates at the specified `location` to a local (0, 0, 0) Cartesian system. The units of the input positions are determined by the `location`'s coordinate system. 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#ungeoreference) + * + * @param vertexAttributes The georeferenced position and normal buffers. + * @param location The location to which the position and normal buffers are georeferenced. + * @param params Optional parameters. + * @param params.geographic Indicates whether the coordinates are georeferenced relative to the globe or the projected coordinate system. + * + */ + ungeoreference( + vertexAttributes: VertexAttributes, + location: Point, + params?: meshUtilsUngeoreferenceParams + ): VertexAttributes; } export const meshUtils: meshUtils; - /** - * Represents the position and normal vertex attribute buffers of a mesh. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) - */ - export interface VertexAttributes extends Object { - /** - * The position buffer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) - */ - position: Float64Array; - /** - * The normal buffer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) - */ - normal?: Float32Array; - } - - export interface meshUtilsCreateFromElevationParams extends Object { /** * The material. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#createFromElevation) */ material?: meshUtilsCreateFromElevationParamsMaterial; /** * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See [ElevationLayer.queryElevation](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) for more details on the different settings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#createFromElevation) - * + * * @default auto */ demResolution?: number | string; } - export interface meshUtilsCreateFromElevationParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#createFromElevation) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface meshUtilsGeoreferenceParams extends Object { /** * Indicates whether to georeference relative to the globe or the projected coordinate system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#georeference) */ geographic?: boolean; } + export interface meshUtilsUngeoreferenceParams extends Object { + /** + * Indicates whether the coordinates are georeferenced relative to the globe or the projected coordinate system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#ungeoreference) + */ + geographic?: boolean; + } + + /** + * Represents the position and normal vertex attribute buffers of a mesh. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) + */ + export interface VertexAttributes extends Object { + /** + * The position buffer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) + */ + position: Float64Array; + /** + * The normal buffer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) + */ + normal?: Float32Array; + } interface normalizeUtils { /** * Normalizes geometries that intersect the central meridian or fall outside the world extent so they stay within the coordinate system of the view. Only supported for Web Mercator and WGS84 spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-normalizeUtils.html#normalizeCentralMeridian) - * + * * @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, requestOptions?: any): IPromise; + normalizeCentralMeridian( + geometries: Geometry[], + geometryService?: GeometryService, + requestOptions?: any + ): IPromise; } export const normalizeUtils: normalizeUtils; @@ -5185,23 +5339,23 @@ declare namespace __esri { interface ValueMeshColor extends Accessor { /** * For ValueMeshColor the type is always `value`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html#type) */ readonly type: "value"; /** * The color value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html#value) */ value: Color; /** * Creates a deep clone. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html#clone) - * - * + * + * */ clone(): ValueMeshColor; } @@ -5209,11 +5363,11 @@ declare namespace __esri { interface ValueMeshColorConstructor { /** * ValueMeshColor is a type of mesh color that represents a single uniform color to be applied to a mesh component. ValueMeshColor instances can be used with the [MeshComponent.material.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html) */ - new(properties?: ValueMeshColorProperties): ValueMeshColor; + new (properties?: ValueMeshColorProperties): ValueMeshColor; } export const ValueMeshColor: ValueMeshColorConstructor; @@ -5221,150 +5375,198 @@ declare namespace __esri { interface ValueMeshColorProperties { /** * The color value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html#value) */ value?: Color | number[] | string; } - interface webMercatorUtils { /** * Returns `true` if the `source` spatial reference can be projected to the `target` spatial reference with the [project()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#project) function, or if the `source` and `target` are the same [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) - * + * * @param source The input [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). * @param target The target [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). - * + * */ canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; /** * Converts a geometry from geographic units (wkid: 4326) to Web Mercator units (wkid: 3857). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#geographicToWebMercator) - * + * * @param geometry The input geometry to convert. - * + * */ geographicToWebMercator(geometry: Geometry): Geometry; /** * Translates the given latitude and longitude (decimal degree) values to Web Mercator XY values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#lngLatToXY) - * + * * @param long The longitude value to convert. * @param lat The latitude value to convert. - * + * */ lngLatToXY(long: number, lat: number): number[]; /** * Projects the geometry clientside (if possible). You should test the input geometry in [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) prior to using this function. If the result of [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) is `true`, then proceed to project. If [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) returns `false`, then `project()` won't return useful results. Use [GeometryService.project()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#project) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#project) - * + * * @param geometry The input geometry. * @param spatialReference The target [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). - * + * */ project(geometry: Geometry, spatialReference: SpatialReference | any): Geometry; /** * Converts a geometry from Web Mercator units (wkid: 3857) to geographic units (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#webMercatorToGeographic) - * + * * @param geometry The input geometry to convert. - * + * */ webMercatorToGeographic(geometry: Geometry): Geometry; /** * Translates the given Web Mercator coordinates to Longitude and Latitude values (decimal degrees). By default the returned longitude is normalized so that it is within -180 and +180. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#xyToLngLat) - * + * * @param x The X coordinate value to convert. * @param y The Y coordinate value to convert. - * + * */ xyToLngLat(x: number, y: number): number[]; } export const webMercatorUtils: webMercatorUtils; + /** + * Extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Extent) + */ + export type geometryExtent = Extent; + + /** + * Geometry types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Geometry) + */ + export type geometryGeometry = Extent | Multipoint | Point | Polygon | Polyline | Mesh; + + /** + * Mesh. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Mesh) + */ + export type geometryMesh = Mesh; + + /** + * Multipoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Multipoint) + */ + export type geometryMultipoint = Multipoint; + + /** + * Point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Point) + */ + export type geometryPoint = Point; + + /** + * Polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Polygon) + */ + export type geometryPolygon = Polygon; + + /** + * Polyline. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Polyline) + */ + export type geometryPolyline = Polyline; + interface Graphic extends Accessor, JSONSupport { /** * Name-value pairs of fields and field values associated with the graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) */ attributes: any; /** - * The geometry that defines the graphic's location. + * The geometry that defines the graphic's location. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry) */ geometry: Geometry; /** * If applicable, references the layer in which the graphic is stored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) */ layer: Layer; /** * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of 4.8 to get the actual `popupTemplate` of the graphic, see the [getEffectivePopupTemplate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) method that either returns this value or the `popupTemplate` of the graphic's layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) */ 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. 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) */ symbol: Symbol; /** * Indicates the visibility of the graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#visible) - * + * * @default true */ visible: boolean; /** * Creates a deep clone of the graphic object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#clone) - * - * + * + * */ clone(): Graphic; /** * Returns the value of the specified attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getAttribute) - * + * * @param name The name of the attribute. - * + * */ getAttribute(name: string): any; /** * Returns the popup template applicable for the graphic. It's either the value of [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) or the `popupTemplate` from the graphic's layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) - * - * + * + * */ getEffectivePopupTemplate(): PopupTemplate; /** * Sets a new value to the specified attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#setAttribute) - * + * * @param name The name of the attribute to set. * @param newValue The new value to set on the named attribute. - * + * */ setAttribute(name: string, newValue: any): void; } @@ -5372,11 +5574,11 @@ declare namespace __esri { interface GraphicConstructor { /** * A Graphic is a vector representation of real world geographic phenomena. It can contain [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry), a [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol), and [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes). A Graphic is displayed in the [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) */ - new(properties?: GraphicProperties): Graphic; + new (properties?: GraphicProperties): Graphic; fromJSON(json: any): Graphic; } @@ -5386,40 +5588,40 @@ declare namespace __esri { interface GraphicProperties { /** * Name-value pairs of fields and field values associated with the graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) */ attributes?: any; /** - * The geometry that defines the graphic's location. + * The geometry that defines the graphic's location. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry) */ geometry?: GeometryProperties; /** * If applicable, references the layer in which the graphic is stored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) */ layer?: LayerProperties; /** * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of 4.8 to get the actual `popupTemplate` of the graphic, see the [getEffectivePopupTemplate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) method that either returns this value or the `popupTemplate` of the graphic's layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) */ 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. 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) */ symbol?: SymbolProperties; /** * Indicates the visibility of the graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#visible) - * + * * @default true */ visible?: boolean; @@ -5428,90 +5630,93 @@ 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/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) */ layers: Collection; /** * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A Ground is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) are fully created, but not yet loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * Specifies the user navigation constraints relative to the ground surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) */ navigationConstraint: GroundNavigationConstraint; /** * Opacity of the ground, including surface default color and the basemap (without reference layers). This property can be used for a see-through ground effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) - * + * * @default 1 */ opacity: number; /** * The color of the ground surface, displayed underneath the basemap. If this is null, a grid is displayed instead. The alpha value in the color is ignored. Use the [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) property to control the opacity of the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#surfaceColor) - * + * * @default null */ surfaceColor: Color; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#clone) - * - * + * + * */ clone(): Ground; /** * Creates an elevation sampler for the given extent by querying the ground layers for elevation data and caching it so values may be sampled quickly afterwards. The sampler uses the elevation data from the first layer that has data available. For getting elevation data from a specific layer use [ElevationLayer.createElevationSampler()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#createElevationSampler) - * + * * @param extent The extent for which to create the sampler. * @param options Additional sampler options. * @param options.noDataValue The value to use when there is no data available. - * + * */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) - * + * * @param geometry The geometry to sample. * @param options Additional query options. * @param options.returnSampleInfo Indicates whether to return additional sample information for each sampled coordinate. * @param options.noDataValue The value that appears in the resulting geometry when there is no data available. - * + * */ - queryElevation(geometry: Point | Multipoint | Polyline, options?: GroundQueryElevationOptions): IPromise; + queryElevation( + geometry: Point | Multipoint | Polyline, + options?: GroundQueryElevationOptions + ): IPromise; } interface GroundConstructor { /** * The Ground class contains properties that specify how the ground surface is displayed in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It contains a [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) property, which is a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that defines the elevation or terrain of the map's surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) */ - new(properties?: GroundProperties): Ground; + new (properties?: GroundProperties): Ground; fromJSON(json: any): Ground; } @@ -5521,29 +5726,29 @@ 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/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) */ layers?: CollectionProperties; /** * Specifies the user navigation constraints relative to the ground surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) */ navigationConstraint?: GroundNavigationConstraintProperties; /** * Opacity of the ground, including surface default color and the basemap (without reference layers). This property can be used for a see-through ground effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) - * + * * @default 1 */ opacity?: number; /** * The color of the ground surface, displayed underneath the basemap. If this is null, a grid is displayed instead. The alpha value in the color is ignored. Use the [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) property to control the opacity of the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#surfaceColor) - * + * * @default null */ surfaceColor?: Color | number[] | string; @@ -5551,54 +5756,52 @@ declare namespace __esri { /** * Object returned when [queryElevation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) promise resolves: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ export interface ElevationQueryResult extends Object { /** * The geometry with sampled z-values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ geometry: Point | Multipoint | Polyline; /** * Contains additional information about how the geometry was sampled. This property is present depending on whether the user set `options.returnSampleInfo = true`, for each coordinate in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ sampleInfo?: ElevationQueryResultSampleInfo[]; /** * The value used when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ noDataValue: number; } - export interface GroundCreateElevationSamplerOptions extends Object { /** * The value to use when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#createElevationSampler) - * + * * @default 0 */ noDataValue?: number; } - export interface GroundNavigationConstraintProperties extends Object { /** - * The type of the constraint. It can be one of the following: - * + * The type of the constraint. It can be one of the following: + * * Value | Description * -----------|-------------------- * stay-above | User can only navigate above ground surface * none | User can navigate above and below the ground surface - * + * * Default value: stay-above - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) */ type?: string; @@ -5606,51 +5809,49 @@ declare namespace __esri { export interface GroundNavigationConstraint extends AnonymousAccessor { /** - * The type of the constraint. It can be one of the following: - * + * The type of the constraint. It can be one of the following: + * * Value | Description * -----------|-------------------- * stay-above | User can only navigate above ground surface * none | User can navigate above and below the ground surface - * + * * Default value: stay-above - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) */ type: string; } - export interface GroundQueryElevationOptions extends Object { /** * Indicates whether to return additional sample information for each sampled coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) - * + * * @default false */ returnSampleInfo?: boolean; /** * The value that appears in the resulting geometry when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) - * + * * @default 0 */ noDataValue?: number; } - export interface ElevationQueryResultSampleInfo extends Object { /** * The resolution at which the z-value was sampled. If no data was available for sampling for a given coordinate, the dem resolution value will be -1 for that coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ demResolution: number; /** * The elevation source from which the data for the corresponding coordinate was sampled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ source: ElevationLayer; @@ -5659,69 +5860,71 @@ declare namespace __esri { interface Credential extends Accessor { /** * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#expires) */ expires: number; /** - * Indicates whether this credential belongs to a user with admin privileges. - * + * Indicates that this credential was created to access the [ArcGIS REST Admin service](https://developers.arcgis.com/rest/services-reference/rest-api-admin.htm). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#isAdmin) */ isAdmin: boolean; /** * The Identity Manager's [setOAuthRedirectionHandler](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) returns an object that contains a `state` property. This information is returned for this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#oAuthState) */ oAuthState: any; /** * The server url. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#server) */ server: string; /** * Indicates whether the resources accessed using this credential should be fetched over HTTPS protocol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#ssl) */ ssl: boolean; /** * Token generated by the token service using the specified userId and password. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) */ token: string; /** * User associated with the Credential object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#userId) */ userId: string; /** * Destroys the credential. When the credential is destroyed, you should remove any map layers that are using this credential. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#destroy) - * - * + * + * */ destroy(): void; /** * Generates a new token and updates the Credential's [token](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) property with the newly acquired token. Tokens are typically kept valid using a timer that automatically triggers a refresh before the token expires. Use this method in cases where the timer has been delayed or stopped. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#refreshToken) - * - * + * + * */ refreshToken(): void; + + on(name: "token-change", eventHandler: CredentialTokenChangeEventHandler): IHandle; + + on(name: "destroy", eventHandler: CredentialDestroyEventHandler): IHandle; } interface CredentialConstructor { - - - new(properties?: CredentialProperties): Credential; + new (properties?: CredentialProperties): Credential; } export const Credential: CredentialConstructor; @@ -5729,570 +5932,486 @@ declare namespace __esri { interface CredentialProperties { /** * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#expires) */ expires?: number; /** - * Indicates whether this credential belongs to a user with admin privileges. - * + * Indicates that this credential was created to access the [ArcGIS REST Admin service](https://developers.arcgis.com/rest/services-reference/rest-api-admin.htm). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#isAdmin) */ isAdmin?: boolean; /** * The Identity Manager's [setOAuthRedirectionHandler](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) returns an object that contains a `state` property. This information is returned for this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#oAuthState) */ oAuthState?: any; /** * The server url. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#server) */ server?: string; /** * Indicates whether the resources accessed using this credential should be fetched over HTTPS protocol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#ssl) */ ssl?: boolean; /** * Token generated by the token service using the specified userId and password. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) */ token?: string; /** * User associated with the Credential object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#userId) */ userId?: string; } - interface IdentityManager extends IdentityManagerBase { + export interface CredentialDestroyEvent {} + + export interface CredentialTokenChangeEvent {} + + interface IdentityManager extends Evented { /** * Dialog box widget used to challenge the user for their credentials when the application attempts to access a secure resource. This property is available after the dialog-create event has fired. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#dialog) */ dialog: any; - - /** - * Once a user successfully logs in, they are redirected back to the application. Use this method if the application needs to execute custom logic before the page is redirected. The IdentityManager calls the custom handler function with an object containing redirection properties. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) - * - * @param handlerFunction When called, the callback passed to `setOAuthRedirectionHandler` receives an object containing the redirection properties. - * - */ - setOAuthRedirectionHandler(handlerFunction: HandlerCallback): void; - /** - * Use this method in the popup callback page to pass the token and other values back to the IdentityManager. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthResponseHash) - * - * @param hash The token information in addition to any other values needed to be passed back to the IdentityManager. - * - */ - setOAuthResponseHash(hash: string): void; - - - on(name: "credential-create", eventHandler: IdentityManagerCredentialCreateEventHandler): IHandle; - - on(name: "credentials-destroy", eventHandler: IdentityManagerCredentialsDestroyEventHandler): IHandle; - } - - interface IdentityManagerConstructor { - /** - * This object provides the framework and helper methods used in managing user credentials for the following resources: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html) - */ - - new(): IdentityManager; - } - - export const IdentityManager: IdentityManagerConstructor; - - export interface IdentityManagerCredentialCreateEvent { - - credential: Credential; - } - - export interface IdentityManagerCredentialsDestroyEvent { - } - - export type HandlerCallback = (authorizeParams: any, authorizeUrl: string, oAuthInfo: OAuthInfo, resourceUrl: string, serverInfo: ServerInfo) => void; - - interface IdentityManagerBase extends Evented { /** * The suggested lifetime of the token in minutes. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#tokenValidity) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#tokenValidity) + * * @default 60 */ tokenValidity: number; /** - * If your application is on the same domain as *.arcgis.com or ArcGIS Enterprise Server, the IdentityManager will redirect the user to its sign-in page. For instance, let's say an application accesses secure resources from ArcGIS.com or one of its subdomains. Once the application attempts to access this resource, the IdentityManager redirects the user to the ArcGIS.com sign-in page. Once a user successfully logs in, they are redirected back to the application. The same holds true if the application accesses secure resources from ArcGIS Enterprise as the IdentityManager will redirect the user to its sign-in page. If you do not wish for the application to automatically redirect, set this property to `false`. (Please note that this is not a common scenario. For most, using the OAuth sign-in behavior should handle most of their authentication needs.) - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#useSignInPage) - * + * If your application is on the same domain as *.arcgis.com or ArcGIS Enterprise Server, the IdentityManager will redirect the user to its sign-in page. For instance, let's say an application accesses secure resources from ArcGIS.com or one of its subdomains. Once the application attempts to access this resource, the IdentityManager redirects the user to the ArcGIS.com sign-in page. Once a user successfully logs in, they are redirected back to the application. The same holds true if the application accesses secure resources from ArcGIS Enterprise as the IdentityManager will redirect the user to its sign-in page. If you do not wish for the application to automatically redirect, set this property to `false`. + * > Please note that this is not a common scenario. For most, using the OAuth sign-in behavior should handle most of their authentication needs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#useSignInPage) + * * @default true */ useSignInPage: boolean; /** - * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) if the user has already signed in to access the given resource. If the user has not signed in, then the promise will be rejected and its error callback will be called. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#checkSignInStatus) - * + * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) if the user has already signed in to access the given resource and is allowed to do so when using the given application id. If the user has not signed in or does not have access, then the promise will be rejected and its error callback will be called. + * > This scenario is generally not common unless you are building a licensed app. Also, please note that this method should only be used if your application is on the same domain as `*.arcgis.com` or ArcGIS Enterprise Server and is only applicable to applications registered as items in the `Esri` organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#checkAppAccess) + * * @param resUrl The resource URL. - * + * @param appId The registered OAuth application id. + * + */ + checkAppAccess(resUrl: string, appId: string): IPromise; + /** + * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) if the user has already signed in to access the given resource. If the user has not signed in, then the promise will be rejected and its error callback will be called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#checkSignInStatus) + * + * @param resUrl The resource URL. + * */ checkSignInStatus(resUrl: string): IPromise; /** * Destroys all credentials. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#destroyCredentials) - * - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#destroyCredentials) + * + * */ destroyCredentials(): void; /** * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) for the resource identified by the specified url. Optionally, you can provide a userId to find credentials for a specific user. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findCredential) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#findCredential) + * * @param url The URL to a server. * @param userId The userId for which you want to obtain credentials. - * + * */ findCredential(url: string, userId?: string): Credential; /** * Returns the [OAuthInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html) configuration for the passed in Portal server URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findOAuthInfo) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#findOauthInfo) + * * @param url The URL to a Portal. - * + * */ - findOAuthInfo(url: string): OAuthInfo; + findOauthInfo(url: string): OAuthInfo; /** * Returns information about the server that is hosting the specified URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findServerInfo) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#findServerinfo) + * * @param url The URL to the server - * + * */ - findServerInfo(url: string): ServerInfo; + findServerinfo(url: string): ServerInfo; /** * Returns an object containing a token and its expiration time. It is necessary to provide the [ServerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html) object that contains a token service URL and a user info object containing username and password. This is a helper method typically called by sub-classes to generate tokens. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#generateToken) + * * @param serverInfo A ServerInfo object that contains a token service URL. * @param userInfo A user info object containing a user name and password. * @param options See the table below for the structure of this object. * @param options.serverUrl The server URL. * @param options.token The server token. * @param options.ssl Indicates if the server requires SSL. - * + * */ - generateToken(serverInfo: ServerInfo, userInfo: any, options?: IdentityManagerBaseGenerateTokenOptions): IPromise; + generateToken(serverInfo: ServerInfo, userInfo: any, options?: IdentityManagerGenerateTokenOptions): IPromise; /** * Returns a [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) object that can be used to access the secured resource identified by the input URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#getCredential) + * * @param url The URL for the secure resource * @param options See the table below for the structure of the **options** object. * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. * @param options.oAuthPopupConfirmation If set to *false*, the user will not be shown a dialog before the OAuth popup window is opened. - * @param options.retry Determines if the method should make additional attempts to get the credentials after a failure. * @param options.token Token used for a previous unsuccessful attempt to fetch the given URL. - * + * */ - getCredential(url: string, options?: IdentityManagerBaseGetCredentialOptions): IPromise; + getCredential(url: string, options?: IdentityManagerGetCredentialOptions): IPromise; /** - * Call this method during application initialization with the JSON previously obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) method used to re-hydrate the state of IdentityManager. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#initialize) - * - * @param json The JSON obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) method. - * + * Call this method during application initialization with the JSON previously obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#toJSON) method used to re-hydrate the state of IdentityManager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#initialize) + * + * @param json The JSON obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#toJSON) method. + * */ initialize(json: any): void; /** - * Indicates if the IdentityManager is busy accepting user input. For example, it returns `true` if the user has invoked [signIn](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) and is waiting for a response. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#isBusy) - * - * + * Indicates if the IdentityManager is busy accepting user input. For example, it returns `true` if the user has invoked [signIn](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#signIn) and is waiting for a response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#isBusy) + * + * */ isBusy(): boolean; - /** - * Subclasses must implement this method if OAuth support is required. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) - * - * @param resUrl The resource URL. - * @param serverInfo A ServerInfo object that contains the token service URL. - * @param oAuthInfo An OAuthInfo object that contains the authorization configuration. - * @param options See the table below for the structure of the **options** object. - * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. - * @param options.oAuthPopupConfirmation Indicates whether the user will be shown a dialog before the OAuth popup window is opened. - * @param options.token Token used for previous unsuccessful attempts to fetch the given URL. - * - */ - oAuthSignIn(resUrl: string, serverInfo: ServerInfo, oAuthInfo: OAuthInfo, options?: IdentityManagerBaseOAuthSignInOptions): IPromise; /** * Registers OAuth 2.0 configurations. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerOAuthInfos) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerOAuthInfos) + * * @param oAuthInfos An array of OAuthInfo objects that defines the OAuth configurations. - * + * */ registerOAuthInfos(oAuthInfos: OAuthInfo[]): void; /** * Register secure servers and the token endpoints. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerServers) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerServers) + * * @param serverInfos An array of ServerInfos objects that defines the secure service and token endpoint. The IdentityManager makes its best guess to determine the location of the secure server and token endpoint. Therefore, in most cases calling this method is not necessary. However, if the location of your server or token endpoint is not standard, use this method to register the location. - * + * */ registerServers(serverInfos: ServerInfo[]): void; /** - * Registers the given OAuth 2.0 access token or ArcGIS Server token with the IdentityManager. See [registerOAuthInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerOAuthInfos) for additional information. The `registerToken` method is an advanced workflow for pre-registering long-term tokens for when you don't want users to sign in. See also [resource-proxy](https://github.com/Esri/resource-proxy) for another workflow to achieve this result. Once a user logs in, the access token is registered with the IdentityManager. Subsequently, every AJAX request made by the application forwards this token when accessing web maps and other items stored in ArcGIS Online, or resources on your server. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerToken) - * + * Registers the given OAuth 2.0 access token or ArcGIS Server token with the IdentityManager. See [registerOAuthInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerOAuthInfos) for additional information. The `registerToken` method is an advanced workflow for pre-registering long-term tokens for when you don't want users to sign in. See also [resource-proxy](https://github.com/Esri/resource-proxy) for another workflow to achieve this result. Once a user logs in, the access token is registered with the IdentityManager. Subsequently, every AJAX request made by the application forwards this token when accessing web maps and other items stored in ArcGIS Online, or resources on your server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken) + * * @param properties See the table below for the structure of the **properties** object. * @param properties.expires Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. * @param properties.server For ArcGIS Online or Portal, this is https://www.arcgis.com/sharing/rest or similar to https://www.example.com/portal/sharing/rest. For ArcGIS Server this is similar to https://www.example.com/arcgis/rest/services. * @param properties.ssl Set this to `true` if the user has an ArcGIS Online organizational account and the organization is configured to allow access to resources only through SSL. * @param properties.token The access token. * @param properties.userId The id of the user who owns the access token. - * + * */ - registerToken(properties: IdentityManagerBaseRegisterTokenProperties): void; + registerToken(properties: IdentityManagerRegisterTokenProperties): void; + /** + * Once a user successfully logs in, they are redirected back to the application. Use this method if the application needs to execute custom logic before the page is redirected. The IdentityManager calls the custom handler function with an object containing redirection properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) + * + * @param handlerFunction When called, the callback passed to `setOAuthRedirectionHandler` receives an object containing the redirection properties. + * + */ + setOAuthRedirectionHandler(handlerFunction: HandlerCallback): void; + /** + * Use this method in the popup callback page to pass the token and other values back to the IdentityManager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthResponseHash) + * + * @param hash The token information in addition to any other values needed to be passed back to the IdentityManager. + * + */ + setOAuthResponseHash(hash: string): void; /** * When accessing secured resources, the IdentityManager may prompt for username and password and send them to the server using a secure connection. Due to potential browser limitations, it may not be possible to establish a secure connection with the server if the application is being run over HTTP protocol. In such cases, the Identity Manager will abort the request to fetch the secured resource. To resolve this issue, configure your web application server with HTTPS support and run the application over HTTPS. This is the recommended solution for production environments. However, for internal development environments that don't have HTTPS support, you can define a protocol error handler that allows the Identity Manager to continue with the process over HTTP protocol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setProtocolErrorHandler) + * * @param handlerFunction The function to call when the protocol is mismatched. * @param handlerFunction.resourceUrl The secure resource URL. * @param handlerFunction.serverInfo ServerInfo object describing the server where the secure resource is hosted. - * + * */ - setProtocolErrorHandler(handlerFunction: IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction): void; + setProtocolErrorHandler(handlerFunction: IdentityManagerSetProtocolErrorHandlerHandlerFunction): void; /** * If your application is on the same domain as *.arcgis.com or ArcGIS Enterprise Server, the IdentityManager will redirect the user to its sign-in page. For instance, let's say an application accesses secure resources from ArcGIS.com or one of its subdomains. Once the application attempts to access this resource, the IdentityManager redirects the user to the ArcGIS.com sign-in page. Once a user successfully logs in, they are redirected back to the application. The same holds true if the application accesses secure resources from ArcGIS Enterprise as the IdentityManager will redirect the user to its sign-in page. Use this method if the application needs to execute custom logic before the page is redirected by creating a custom redirection handler. The IdentityManager calls the custom handler function with an object containing the redirection properties. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) + * * @param handlerFunction The function passed to setRedirectionHandler receives an object containing redirection properties. These properties are listed in the table below. * @param handlerFunction.resourceUrl The URL of the secure resource that triggers the redirection to the ArcGIS.com sign-in page. * @param handlerFunction.returnUrlParamName The application URL where the sign-in page redirects after a successful login. To create the return URL, append the application's URL to signInPage as a parameter. The *returnUrlParamName* contains the name of the parameter. * @param handlerFunction.serverInfo The ServerInfo object describing the server where the secure resource is hosted. * @param handlerFunction.signInPage URL of the sign-in page where users will be redirected. - * + * */ - setRedirectionHandler(handlerFunction: IdentityManagerBaseSetRedirectionHandlerHandlerFunction): void; - /** - * Subclasses must implement this method to create and manage the user interface used to obtain a username and password from the end user. It should perform the following tasks: - * * challenge the user for a username and password, - * * generate a token and return it to the caller. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) - * - * @param url URL for the secured resource. - * @param serverInfo A ServerInfo object that contains the token service URL. - * @param options See the table below for the structure of the **options** object. - * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. - * - */ - signIn(url: string, serverInfo: ServerInfo, options?: IdentityManagerBaseSignInOptions): IPromise; + setRedirectionHandler(handlerFunction: IdentityManagerSetRedirectionHandlerHandlerFunction): void; /** * Return properties of this object in JSON format. It can be stored in a cookie or persisted in HTML5 LocalStorage and later used to: * * Initialize the IdentityManager the next time a user opens your application. * * Share the state of the IdentityManager between multiple web pages of your website. This way users will not be asked to sign in repeatedly when they launch your app multiple times or when navigating between multiple web pages in your website. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) - * - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#toJSON) + * + * */ toJSON(): any; } - interface IdentityManagerBaseConstructor { + interface IdentityManagerConstructor { /** - * This class provides the framework and helper methods required to implement a solution for managing user credentials. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html) + * This object provides the framework and helper methods used in managing user credentials for the following resources: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html) */ - new(): IdentityManagerBase; + new (): IdentityManager; } - export const IdentityManagerBase: IdentityManagerBaseConstructor; + export const IdentityManager: IdentityManagerConstructor; + export type HandlerCallback = ( + authorizeParams: any, + authorizeUrl: string, + oAuthInfo: OAuthInfo, + resourceUrl: string, + serverInfo: ServerInfo + ) => void; - export interface IdentityManagerBaseGenerateTokenOptions extends Object { + export interface IdentityManagerGenerateTokenOptions extends Object { /** * The server URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#generateToken) */ serverUrl: string; /** * The server token. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#generateToken) */ token: string; /** * Indicates if the server requires SSL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#generateToken) */ ssl: boolean; } - - export interface IdentityManagerBaseGetCredentialOptions extends Object { + export interface IdentityManagerGetCredentialOptions extends Object { /** * Error object returned by the server from a previous attempt to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#getCredential) */ error?: Error; /** * If set to *false*, the user will not be shown a dialog before the OAuth popup window is opened. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#getCredential) + * * @default true */ oAuthPopupConfirmation?: boolean; - /** - * Determines if the method should make additional attempts to get the credentials after a failure. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) - */ - retry?: boolean; /** * Token used for a previous unsuccessful attempt to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#getCredential) */ token?: string; } - - export interface IdentityManagerBaseOAuthSignInOptions extends Object { - /** - * Error object returned by the server from a previous attempt to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) - */ - error?: Error; - /** - * Indicates whether the user will be shown a dialog before the OAuth popup window is opened. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) - * - * @default true - */ - oAuthPopupConfirmation?: boolean; - /** - * Token used for previous unsuccessful attempts to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) - */ - token?: string; - } - - - export interface IdentityManagerBaseRegisterTokenProperties extends Object { + export interface IdentityManagerRegisterTokenProperties extends Object { /** * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. - * + * * [Read more...](properties.html) */ expires?: number; /** * For ArcGIS Online or Portal, this is https://www.arcgis.com/sharing/rest or similar to https://www.example.com/portal/sharing/rest. For ArcGIS Server this is similar to https://www.example.com/arcgis/rest/services. - * + * * [Read more...](properties.html) */ server: string; /** * Set this to `true` if the user has an ArcGIS Online organizational account and the organization is configured to allow access to resources only through SSL. - * + * * [Read more...](properties.html) */ ssl?: boolean; /** * The access token. - * + * * [Read more...](properties.html) */ token: string; /** * The id of the user who owns the access token. - * + * * [Read more...](properties.html) */ userId?: string; } - - export interface IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction extends Object { + export interface IdentityManagerSetProtocolErrorHandlerHandlerFunction extends Object { /** * The secure resource URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setProtocolErrorHandler) */ resourceUrl: string; /** * ServerInfo object describing the server where the secure resource is hosted. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setProtocolErrorHandler) */ serverInfo: ServerInfo; } - - export interface IdentityManagerBaseSetRedirectionHandlerHandlerFunction extends Object { + export interface IdentityManagerSetRedirectionHandlerHandlerFunction extends Object { /** * The URL of the secure resource that triggers the redirection to the ArcGIS.com sign-in page. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) */ resourceUrl: string; /** * The application URL where the sign-in page redirects after a successful login. To create the return URL, append the application's URL to signInPage as a parameter. The *returnUrlParamName* contains the name of the parameter. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) */ returnUrlParamName: string; /** * The ServerInfo object describing the server where the secure resource is hosted. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) */ serverInfo: ServerInfo; /** * URL of the sign-in page where users will be redirected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) */ signInPage: string; } - - export interface IdentityManagerBaseSignInOptions extends Object { - /** - * Error object returned by the server from a previous attempt to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) - */ - error: Error; - } - interface OAuthInfo extends Accessor, JSONSupport { /** * The registered application id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#appId) */ appId: string; /** * Applications with the same value will share the stored token on the same host. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#authNamespace) - * + * * @default / (forward slash) */ authNamespace: string; /** * The number of minutes that the token is valid. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#expiration) - * + * * @default 20160 (two weeks) */ expiration: number; /** * The locale for the OAuth sign in page. The default locale is based on your browser/OS and the organization locale. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#locale) - * + * * @default Based on your browser/OS and the organization locale. */ locale: string; /** * The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#minTimeUntilExpiration) - * + * * @default 30 */ minTimeUntilExpiration: number; /** * Set to `true` to show the OAuth sign in page in a popup window. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popup) - * + * * @default false */ popup: boolean; /** * Applicable if working with the popup user-login workflow. This is a relative page URL that redirects the user back to the secured application after successful login. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupCallbackUrl) - * + * * @default "oauth-callback.html" */ popupCallbackUrl: string; /** * The window features passed to [window.open()](https://developer.mozilla.org/en-US/docs/Web/API/Window/open). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupWindowFeatures) - * + * * @default height=490,width=800,resizable,scrollbars,status */ popupWindowFeatures: string; /** * The ArcGIS Enterprise portal URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#portalUrl) - * + * * @default "https://www.arcgis.com" */ portalUrl: string; /** * Creates a copy of the OAuthInfo object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#clone) - * - * + * + * */ clone(): OAuthInfo; } interface OAuthInfoConstructor { - - - new(properties?: OAuthInfoProperties): OAuthInfo; + new (properties?: OAuthInfoProperties): OAuthInfo; fromJSON(json: any): OAuthInfo; } @@ -6302,71 +6421,71 @@ declare namespace __esri { interface OAuthInfoProperties { /** * The registered application id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#appId) */ appId?: string; /** * Applications with the same value will share the stored token on the same host. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#authNamespace) - * + * * @default / (forward slash) */ authNamespace?: string; /** * The number of minutes that the token is valid. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#expiration) - * + * * @default 20160 (two weeks) */ expiration?: number; /** * The locale for the OAuth sign in page. The default locale is based on your browser/OS and the organization locale. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#locale) - * + * * @default Based on your browser/OS and the organization locale. */ locale?: string; /** * The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#minTimeUntilExpiration) - * + * * @default 30 */ minTimeUntilExpiration?: number; /** * Set to `true` to show the OAuth sign in page in a popup window. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popup) - * + * * @default false */ popup?: boolean; /** * Applicable if working with the popup user-login workflow. This is a relative page URL that redirects the user back to the secured application after successful login. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupCallbackUrl) - * + * * @default "oauth-callback.html" */ popupCallbackUrl?: string; /** * The window features passed to [window.open()](https://developer.mozilla.org/en-US/docs/Web/API/Window/open). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupWindowFeatures) - * + * * @default height=490,width=800,resizable,scrollbars,status */ popupWindowFeatures?: string; /** * The ArcGIS Enterprise portal URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#portalUrl) - * + * * @default "https://www.arcgis.com" */ portalUrl?: string; @@ -6375,40 +6494,38 @@ declare namespace __esri { interface ServerInfo extends Accessor, JSONSupport { /** * The token service URL used to generate tokens for ArcGIS Server Admin resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#adminTokenServiceUrl) */ adminTokenServiceUrl: string; /** * Version of the ArcGIS Server deployed on this server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#currentVersion) */ currentVersion: number; /** * The server URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#server) */ server: string; /** * Validity of short-lived token in minutes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#shortLivedTokenValidity) */ shortLivedTokenValidity: number; /** * The token service URL used to generate tokens for the secured resources on the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#tokenServiceUrl) */ tokenServiceUrl: string; } interface ServerInfoConstructor { - - - new(properties?: ServerInfoProperties): ServerInfo; + new (properties?: ServerInfoProperties): ServerInfo; fromJSON(json: any): ServerInfo; } @@ -6418,40 +6535,39 @@ declare namespace __esri { interface ServerInfoProperties { /** * The token service URL used to generate tokens for ArcGIS Server Admin resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#adminTokenServiceUrl) */ adminTokenServiceUrl?: string; /** * Version of the ArcGIS Server deployed on this server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#currentVersion) */ currentVersion?: number; /** * The server URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#server) */ server?: string; /** * Validity of short-lived token in minutes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#shortLivedTokenValidity) */ shortLivedTokenValidity?: number; /** * The token service URL used to generate tokens for the secured resources on the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#tokenServiceUrl) */ tokenServiceUrl?: string; } - interface kernel { /** - * Current version of the ArcGIS API for JavaScript. + * Current version of the ArcGIS API for JavaScript. * ```js * require([ * "esri/kernel" @@ -6459,7 +6575,7 @@ declare namespace __esri { * console.log(esriNS.version); * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-kernel.html#version) */ readonly version: string; @@ -6470,37 +6586,36 @@ declare namespace __esri { interface BaseDynamicLayer extends Layer, ScaleRangeLayer, RefreshableLayer { /** * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#addResolvingPromise) - * + * * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loaded). - * + * */ addResolvingPromise(promiseToLoad: IPromise): IPromise; /** * This method fetches the image for the specified extent and size. Override this method if the data returned from the server needs to be processed before it can be displayed. For example, if the server returns binary data, override this method to convert the binary data to an image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#fetchImage) - * + * * @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). - * + * */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#getImageUrl) - * + * * @param extent Extent of the view. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param width Width of the view in pixels. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param height Height of the view in pixels. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * + * */ getImageUrl(extent: Extent, width: number, height: number): IPromise | string; - on(name: "layerview-create", eventHandler: BaseDynamicLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BaseDynamicLayerLayerviewDestroyEventHandler): IHandle; @@ -6509,28 +6624,24 @@ declare namespace __esri { interface BaseDynamicLayerConstructor { /** * This class may be extended to create dynamic map layers. Dynamic layers display an image dynamically generated on the server based on a request, including the extent and size of the image. The exported image covers the entire view extent. Each interaction on the view (e.g. panning, zooming) will result in an export of a new image on the server. Each export is unique so it cannot be cached in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html) */ - new(properties?: BaseDynamicLayerProperties): BaseDynamicLayer; + new (properties?: BaseDynamicLayerProperties): BaseDynamicLayer; } export const BaseDynamicLayer: BaseDynamicLayerConstructor; - interface BaseDynamicLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { - - } + interface BaseDynamicLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties {} export interface BaseDynamicLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface BaseDynamicLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -6539,57 +6650,61 @@ declare namespace __esri { interface BaseElevationLayer extends Layer { /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#spatialReference) - * + * * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} */ spatialReference: SpatialReference; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#tileInfo) */ tileInfo: TileInfo; /** * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#addResolvingPromise) - * + * * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loaded). - * + * */ addResolvingPromise(promiseToLoad: IPromise): IPromise; /** - * Fetches a tile at the given level, row, and column present in the view. This method must be overwritten to display custom elevation values in the [Map.ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground). Note that this method must return a promise that resolves to an object with the properties defined in [ElevationTileData](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData). See the following samples for examples of how to overwrite this method: + * Fetches a tile at the given level, row, and column present in the view. This method must be overwritten to display custom elevation values in the [Map.ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground). Note that this method must return a promise that resolves to an object with the properties defined in [ElevationTileData](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData). See the following samples for examples of how to overwrite this method: * * [Sample - Custom ElevationLayer: Exaggerating elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-exaggerated/index.html) * * [Sample - Custom ElevationLayer: Thematic data as elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-thematic/index.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) - * + * * @param level The level of detail of the tile to fetch. * @param row The row (y) position of the tile to fetch. * @param column The column (x) position of the tile to fetch. * @param options Optional settings for the tile request. * @param options.noDataValue The value representing pixels in the tile that don't contain an elevation value. - * + * */ - fetchTile(level: number, row: number, column: number, options?: BaseElevationLayerFetchTileOptions): IPromise; + fetchTile( + level: number, + row: number, + column: number, + options?: BaseElevationLayerFetchTileOptions + ): IPromise; /** * Returns the bounds of the tile as an array of four numbers that can be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. See the table in the `returns` section below for more details about the values returned by this method. This function can be used inside [fetchTile()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) so you can get the bounds of the current tile, convert it to an extent object, and request the desired data for the given extent. See the [Custom ElevationLayer: Thematic data as elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-thematic/index.html) sample for an example of how this method works. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#getTileBounds) - * + * * @param level The level of detail (LOD) of the tile. * @param row The tile's row (y) position in the dataset. * @param column The tiles column (x) position in the dataset. * @param out Array for storing the tile bounds or extent. - * + * */ getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; - on(name: "layerview-create", eventHandler: BaseElevationLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BaseElevationLayerLayerviewDestroyEventHandler): IHandle; @@ -6598,11 +6713,11 @@ declare namespace __esri { interface BaseElevationLayerConstructor { /** * BaseElevationLayer is intended to be extended for creating custom elevation layers. You create a custom [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) by calling [createSubclass()](https://dojotoolkit.org/reference-guide/1.10/dojo/_base/declare.html#createsubclass) on the `BaseElevationLayer`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html) */ - new(properties?: BaseElevationLayerProperties): BaseElevationLayer; + new (properties?: BaseElevationLayerProperties): BaseElevationLayer; } export const BaseElevationLayer: BaseElevationLayerConstructor; @@ -6610,25 +6725,24 @@ declare namespace __esri { interface BaseElevationLayerProperties extends LayerProperties { /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#spatialReference) - * + * * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} */ spatialReference?: SpatialReferenceProperties; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#tileInfo) */ tileInfo?: TileInfoProperties; } - export interface BaseElevationLayerFetchTileOptions extends Object { /** * The value representing pixels in the tile that don't contain an elevation value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) */ noDataValue?: number; @@ -6636,51 +6750,49 @@ declare namespace __esri { /** * Describes elevation contained in the pixels that comprise an elevation tile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ export interface ElevationTileData extends Object { /** * The elevation values of each pixel in the tile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ values: number[]; /** * The width of the tile in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ width: number; /** * The height of the tile in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ height: number; /** * The maximum allowed error of the Z-value for each value in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ maxZError: number; /** * Indicating the pixel values where no elevation data is present. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ noDataValue: number; } export interface BaseElevationLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface BaseElevationLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -6689,73 +6801,72 @@ declare namespace __esri { interface BaseTileLayer extends Layer, ScaleRangeLayer, RefreshableLayer { /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#spatialReference) - * + * * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} */ spatialReference: SpatialReference; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#tileInfo) */ tileInfo: TileInfo; /** * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#addResolvingPromise) - * + * * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loaded). - * + * */ addResolvingPromise(promiseToLoad: IPromise): IPromise; /** * This method fetches a tile for the given level, row and column present in the view. Override this method if the data or image returned from the server needs to be processed before it can be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#fetchTile) - * + * * @param level Level of detail 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 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. - * + * */ 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: - * + * 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: + * * Index | Value * ------|------ * 0 | Minimum x-value * 1 | Minimum y-value * 2 | Maximum x-value * 3 | Maximum y-value - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#getTileBounds) - * + * * @param level The level of detail (LOD) of the tile. * @param row The tile's row (y) position in the dataset. * @param column The tiles column (x) position in the dataset. * @param out Array for storing the tile bounds or extent. - * + * */ getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; /** * This method returns a URL to an image for a given level, row and column. Override this method to construct the URL for the image based on user interaction. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#getTileUrl) - * + * * @param level Level of detail. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row Tile row. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @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; - on(name: "layerview-create", eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BaseTileLayerLayerviewDestroyEventHandler): IHandle; @@ -6764,11 +6875,11 @@ declare namespace __esri { interface BaseTileLayerConstructor { /** * This class may be extended to create a custom [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html). Tile layers are composed of images, such as satellite imagery, that are composed of square tiles mosaicked together in columns and rows, giving the layer the appearance that it is one continuous image. These layers have several levels of detail (LOD) that permit users to zoom in to any region of the map and load additional tiles that depict features in higher resolution at larger map scales. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html) */ - new(properties?: BaseTileLayerProperties): BaseTileLayer; + new (properties?: BaseTileLayerProperties): BaseTileLayer; } export const BaseTileLayer: BaseTileLayerConstructor; @@ -6776,29 +6887,27 @@ declare namespace __esri { interface BaseTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#spatialReference) - * + * * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} */ spatialReference?: SpatialReferenceProperties; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#tileInfo) */ tileInfo?: TileInfoProperties; } export interface BaseTileLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface BaseTileLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -6807,50 +6916,55 @@ declare namespace __esri { interface BingMapsLayer extends BaseTileLayer { /** * Expose Bing logo url. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#bingLogo) */ readonly bingLogo: string; /** * Copyright information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#copyright) */ readonly copyright: string; /** * Provides culture specific map labels. For more information visit: https://msdn.microsoft.com/en-us/library/ff701709.aspx For a list of supported culture codes please visit: https://msdn.microsoft.com/en-us/library/hh441729.aspx - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#culture) - * + * * @default "en-US" */ culture: string; + /** + * Indicates if the layer has attribution data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#hasAttributionData) + */ + readonly hasAttributionData: boolean; /** * Bing Maps Key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#key) - * + * * @default null */ key: string; /** * This will alter Geopolitical disputed borders and labels to align with the specified user region. For more information on Bing's region setting please visit: https://msdn.microsoft.com/en-us/library/ff701704.aspx For a list of supported country codes please visit: see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#region) - * + * * @default null */ region: string; /** * The three supported maps are: `road` | `aerial` | `hybrid` For more information on Bing map styles please visit: https://msdn.microsoft.com/en-us/library/ff701716.aspx - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#style) - * + * * @default "road" */ style: string; - on(name: "layerview-create", eventHandler: BingMapsLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BingMapsLayerLayerviewDestroyEventHandler): IHandle; @@ -6859,11 +6973,11 @@ declare namespace __esri { interface BingMapsLayerConstructor { /** * This layer supports Microsoft's Bing tiled map content. Three map styles are supported - `road`, `aerial` and `hybrid`. Please note that a valid [Bing Maps key](https://msdn.microsoft.com/en-us/library/ff428642.aspx) is required to use this layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html) */ - new(properties?: BingMapsLayerProperties): BingMapsLayer; + new (properties?: BingMapsLayerProperties): BingMapsLayer; } export const BingMapsLayer: BingMapsLayerConstructor; @@ -6871,68 +6985,323 @@ declare namespace __esri { interface BingMapsLayerProperties extends BaseTileLayerProperties { /** * Provides culture specific map labels. For more information visit: https://msdn.microsoft.com/en-us/library/ff701709.aspx For a list of supported culture codes please visit: https://msdn.microsoft.com/en-us/library/hh441729.aspx - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#culture) - * + * * @default "en-US" */ culture?: string; /** * Bing Maps Key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#key) - * + * * @default null */ key?: string; /** * This will alter Geopolitical disputed borders and labels to align with the specified user region. For more information on Bing's region setting please visit: https://msdn.microsoft.com/en-us/library/ff701704.aspx For a list of supported country codes please visit: see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#region) - * + * * @default null */ region?: string; /** * The three supported maps are: `road` | `aerial` | `hybrid` For more information on Bing map styles please visit: https://msdn.microsoft.com/en-us/library/ff701716.aspx - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#style) - * + * * @default "road" */ style?: string; } export interface BingMapsLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface BingMapsLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } + interface BuildingSceneLayer extends Layer, SceneService, 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-BuildingSceneLayer.html#sublayers) in the BuildingSublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#allSublayers) + */ + readonly allSublayers: Collection; + /** + * Specifies how features are placed on the vertical axis (z). This property only affects [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html) when using the `absolute-height` mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + */ + elevationInfo: BuildingSceneLayerElevationInfo; + /** + * Hierarchical structure of sublayers in a BuildingSceneLayer. Usually contains an Overview [BuildingComponentSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html) and a Full Model [BuildingGroupSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html). However, some BuildingSceneLayers can contain only the Full Model [BuildingGroupSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html) or the discipline [BuildingGroupSublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html) directly. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#sublayers) + */ + readonly sublayers: Collection; + + on(name: "layerview-create", eventHandler: BuildingSceneLayerLayerviewCreateEventHandler): IHandle; + + on(name: "layerview-destroy", eventHandler: BuildingSceneLayerLayerviewDestroyEventHandler): IHandle; + } + + interface BuildingSceneLayerConstructor { + /** + * The BuildingSceneLayer is designed for visualizing buildings with detailed interiors in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). These building models are usually exported from Building Information Modeling (BIM) projects. The data in a BuildingSceneLayer can represent walls, lighting fixtures, mechanical systems, furniture and so on. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html) + */ + + new (properties?: BuildingSceneLayerProperties): BuildingSceneLayer; + + fromJSON(json: any): BuildingSceneLayer; + } + + export const BuildingSceneLayer: BuildingSceneLayerConstructor; + + interface BuildingSceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + /** + * Specifies how features are placed on the vertical axis (z). This property only affects [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html) when using the `absolute-height` mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + */ + elevationInfo?: BuildingSceneLayerElevationInfo; + } + + export interface BuildingSceneLayerElevationInfo extends Object { + /** + * Defines how features are placed on the vertical axis (z). Currently only `absolute-height` mode is supported. + * + * Mode | Description + * ------|------------ + * absolute-height | Features are placed at an absolute elevation (z-value) above sea level. This z-value is determined by summing up the `offset` value and the point's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for a [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + */ + mode: string; + /** + * An elevation offset, which is added to the vertical position of each feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + * + * @default 0 + */ + offset?: number; + /** + * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + * + * @default meters + */ + unit?: string; + } + + export interface BuildingSceneLayerLayerviewCreateEvent { + layerView: LayerView; + + view: View; + } + + export interface BuildingSceneLayerLayerviewDestroyEvent { + layerView: LayerView; + + view: View; + } + + interface BuildingComponentSublayer extends BuildingSublayer, Loadable { + /** + * 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 only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. 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. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. This property is evaluated on the client using the cached attributes and it only supports [standardized SQL](http://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#definitionExpression) + */ + definitionExpression: string; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupEnabled) + * + * @default true + */ + popupEnabled: boolean; + /** + * 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 a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupTemplate) + */ + popupTemplate: PopupTemplate; + /** + * The renderer assigned to the sublayer. The renderer defines how to visualize each feature in the sublayer. 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#renderer) + */ + renderer: Renderer; + /** + * The type for this sublayer is always `building-component`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#type) + */ + readonly type: "building-component"; + } + + interface BuildingComponentSublayerConstructor { + new (properties?: BuildingComponentSublayerProperties): BuildingComponentSublayer; + + fromJSON(json: any): BuildingComponentSublayer; + } + + export const BuildingComponentSublayer: BuildingComponentSublayerConstructor; + + interface BuildingComponentSublayerProperties extends BuildingSublayerProperties, LoadableProperties { + /** + * 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 only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. 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. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. This property is evaluated on the client using the cached attributes and it only supports [standardized SQL](http://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#definitionExpression) + */ + definitionExpression?: string; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupEnabled) + * + * @default true + */ + popupEnabled?: boolean; + /** + * 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 a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupTemplate) + */ + popupTemplate?: PopupTemplateProperties; + /** + * The renderer assigned to the sublayer. The renderer defines how to visualize each feature in the sublayer. 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#renderer) + */ + renderer?: RendererProperties; + } + + interface BuildingGroupSublayer extends BuildingSublayer { + /** + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html#sublayers) + */ + readonly sublayers: Collection; + /** + * The type for this sublayer is always `building-group`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html#type) + */ + readonly type: "building-group"; + } + + interface BuildingGroupSublayerConstructor { + new (properties?: BuildingGroupSublayerProperties): BuildingGroupSublayer; + + fromJSON(json: any): BuildingGroupSublayer; + } + + export const BuildingGroupSublayer: BuildingGroupSublayerConstructor; + + interface BuildingGroupSublayerProperties extends BuildingSublayerProperties {} + + interface BuildingSublayer extends Accessor { + /** + * The sublayer's layer id as defined by the Scene Service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#id) + */ + readonly id: number; + /** + * The modelName is a standard name for each sublayer. For example the sublayer containing the doors in a building has the modelName "Doors". Use this property to retrieve sublayers in a [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#modelName) + */ + readonly modelName: string; + /** + * Opacity of the sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#opacity) + * + * @default 1 + */ + opacity: number; + /** + * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#title) + */ + title: string; + /** + * Indicates if the sublayer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#visible) + * + * @default true + */ + visible: boolean; + } + + interface BuildingSublayerConstructor { + new (properties?: BuildingSublayerProperties): BuildingSublayer; + + fromJSON(json: any): BuildingSublayer; + } + + export const BuildingSublayer: BuildingSublayerConstructor; + + interface BuildingSublayerProperties { + /** + * Opacity of the sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#opacity) + * + * @default 1 + */ + opacity?: number; + /** + * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#title) + */ + title?: string; + /** + * Indicates if the sublayer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#visible) + * + * @default true + */ + visible?: boolean; + } + interface CSVLayer extends Layer { /** * Copyright information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#copyright) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#definitionExpression) */ definitionExpression: string; /** - * The column delimiter. See the table below for possible values. - * + * The column delimiter. See the table below for possible values. + * * | Value | Description| * | --- | --- | * | `,` | comma | @@ -6940,208 +7309,206 @@ declare namespace __esri { * | `;` | semicolon | * | `|` | pipe | * | `\t` | tab-delimited | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#delimiter) */ delimiter: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ 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/assets/img/samples/city-points-declutter.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) */ featureReduction: CSVLayerFeatureReduction; /** * An array of fields in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#fields) */ 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). + * 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** 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) */ labelingInfo: LabelClass[]; /** - * 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** + * 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** * * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The latitude field name. If not specified, the API will look for following field names in the CSV source: "lat", "latitude", "y", "ycenter", "latitude83", "latdecdeg", "POINT-Y". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#latitudeField) */ latitudeField: string; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The longitude field name. If not specified, the API will look for following field names in the CSV source: "lon", "lng", "long", "longitude", "x", "xcenter", "longitude83", "longdecdeg", "POINT-X". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#longitudeField) */ longitudeField: string; /** * 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) - * + * * @default 0 */ maxScale: number; /** * 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) - * + * * @default 0 */ minScale: number; /** * An array of field names to include in the CSVLayer. If not specified, the layer will include all fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#outFields) */ outFields: string[]; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * The popup template for the layer. When set on the layer, 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 a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [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-CSVLayer.html#popupTemplate) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#renderer) */ 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/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) + * 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) - * + * * @default true */ screenSizePerspectiveEnabled: boolean; /** - * The spatial reference of the layer. The default value is WGS84. This property can be set explicitly to project the longitude and latitude coordinates when the layer parses the CSV file. While not required, explicitly setting the spatial reference of the layer will improve the performance when projecting to a spatial reference other than the one used by the coordinates in the raw data. + * The spatial reference of the layer. The default value is WGS84. This property can be set explicitly to project the longitude and latitude coordinates when the layer parses the CSV file. While not required, explicitly setting the spatial reference of the layer will improve the performance when projecting to a spatial reference other than the one used by the coordinates in the raw data. * > **Known Limitations** The browser must support [WebAssembly](https://caniuse.com/#feat=wasm) if a spatial reference other than WGS84 or Web Mercator is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#spatialReference) - * + * * @default SpatialReference.WGS84 */ spatialReference: SpatialReference; /** * The URL of the CSV file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#url) */ url: string; /** * Creates query parameters that can be used to fetch features that satisfy the layer's current filters, and definitions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#createQuery) - * - * + * + * */ createQuery(): Query; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data 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. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data 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. + * > **Known Limitations** * * 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 currently not 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 * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryExtent) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryExtent(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data 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. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data 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. + * > **Known Limitations** * * 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 currently not 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 * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryFeatureCount) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. 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 [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. 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 [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. + * > **Known Limitations** * * 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 * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryFeatures) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryFeatures(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. + * > **Known Limitations** * * 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 currently not 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 * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryObjectIds) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryObjectIds(params?: Query | QueryProperties): IPromise; - on(name: "layerview-create", eventHandler: CSVLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: CSVLayerLayerviewDestroyEventHandler): IHandle; @@ -7150,11 +7517,11 @@ declare namespace __esri { interface CSVLayerConstructor { /** * The CSVLayer is a point layer based on a CSV file (.csv, .txt). CSV is a plain-text file format used to represent tabular data, including geographic point features (latitude, longitude). Typically the latitude coordinate is the Y value, and the longitude coordinate is the X value. Features from the CSV file are accessible via the API so you can query features and use them as input to geometry or geoprocessing services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) */ - new(properties?: CSVLayerProperties): CSVLayer; + new (properties?: CSVLayerProperties): CSVLayer; } export const CSVLayer: CSVLayerConstructor; @@ -7162,19 +7529,19 @@ declare namespace __esri { interface CSVLayerProperties extends LayerProperties { /** * Copyright information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#copyright) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#definitionExpression) */ definitionExpression?: string; /** - * The column delimiter. See the table below for possible values. - * + * The column delimiter. See the table below for possible values. + * * | Value | Description| * | --- | --- | * | `,` | comma | @@ -7182,200 +7549,194 @@ declare namespace __esri { * | `;` | semicolon | * | `|` | pipe | * | `\t` | tab-delimited | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#delimiter) */ delimiter?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ 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/assets/img/samples/city-points-declutter.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) */ featureReduction?: CSVLayerFeatureReduction; /** * An array of fields in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#fields) */ 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). + * 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** 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) */ labelingInfo?: LabelClassProperties[]; /** - * 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** + * 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** * * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The latitude field name. If not specified, the API will look for following field names in the CSV source: "lat", "latitude", "y", "ycenter", "latitude83", "latdecdeg", "POINT-Y". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#latitudeField) */ latitudeField?: string; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The longitude field name. If not specified, the API will look for following field names in the CSV source: "lon", "lng", "long", "longitude", "x", "xcenter", "longitude83", "longdecdeg", "POINT-X". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#longitudeField) */ longitudeField?: string; /** * 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) - * + * * @default 0 */ maxScale?: number; /** * 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) - * + * * @default 0 */ minScale?: number; /** * An array of field names to include in the CSVLayer. If not specified, the layer will include all fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#outFields) */ outFields?: string[]; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * The popup template for the layer. When set on the layer, 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 a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [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-CSVLayer.html#popupTemplate) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#renderer) */ 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/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) + * 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) - * + * * @default true */ screenSizePerspectiveEnabled?: boolean; /** - * The spatial reference of the layer. The default value is WGS84. This property can be set explicitly to project the longitude and latitude coordinates when the layer parses the CSV file. While not required, explicitly setting the spatial reference of the layer will improve the performance when projecting to a spatial reference other than the one used by the coordinates in the raw data. + * The spatial reference of the layer. The default value is WGS84. This property can be set explicitly to project the longitude and latitude coordinates when the layer parses the CSV file. While not required, explicitly setting the spatial reference of the layer will improve the performance when projecting to a spatial reference other than the one used by the coordinates in the raw data. * > **Known Limitations** The browser must support [WebAssembly](https://caniuse.com/#feat=wasm) if a spatial reference other than WGS84 or Web Mercator is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#spatialReference) - * + * * @default SpatialReference.WGS84 */ spatialReference?: SpatialReferenceProperties; /** * The URL of the CSV file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#url) */ url?: string; } - export interface CSVLayerElevationInfo extends Object { /** - * Defines how the graphic is placed with respect to the terrain surface. See the table below for a list of possible values. - * + * Defines how the graphic is placed with respect to the terrain surface. 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 [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 result of `featureExpressionInfo` (if defined). This 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 result of `featureExpressionInfo` (if defined). This mode doesn't take the elevation of the terrain into account. + * absolute-height | Graphics are placed at an absolute elevation (z-value) above sea level. This z-value is determined by the result of `featureExpressionInfo` (if defined). This mode doesn't take the elevation of the terrain into account. * 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. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.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 z-value on the feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ featureExpressionInfo?: CSVLayerElevationInfoFeatureExpressionInfo; /** * The unit for `featureExpressionInfo` and `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ unit?: string; } - export interface CSVLayerElevationInfoFeatureExpressionInfo 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. 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 z-value 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-CSVLayer.html#elevationInfo) */ expression?: string; } - export interface CSVLayerFeatureReduction extends Object { /** * Type of the decluttering method. The only supported type at the moment is `selection`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) */ type: string; } export interface CSVLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface CSVLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -7384,51 +7745,59 @@ declare namespace __esri { interface DynamicLayer { /** * The portal item from which the layer is loaded. This will load the layer along with any overridden properties (e.g. renderers, definition expressions, etc.) saved to the portal item, not the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#portalItem) */ portalItem: PortalItem; /** * The URL to the REST endpoint of the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#url) */ url: string; /** * This method fetches the image for the specified extent and size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#fetchImage) - * + * * @param extent The extent of the view. * @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.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. - * + * */ - fetchImage(extent: Extent, width: number, height: number, options?: DynamicLayerFetchImageOptions): IPromise; + fetchImage( + extent: Extent, + width: number, + height: number, + options?: DynamicLayerFetchImageOptions + ): IPromise; /** * This method returns a URL to an image for a given extent, width and height. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#getImageUrl) - * + * * @param extent The extent of the exported image. * @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.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. Available since ArcGIS Server 10.3. - * + * */ - getImageUrl(extent: Extent, width: number, height: number, options?: DynamicLayerGetImageUrlOptions): IPromise | string; + getImageUrl( + extent: Extent, + width: number, + height: number, + options?: DynamicLayerGetImageUrlOptions + ): IPromise | string; } interface DynamicLayerConstructor { - - - new(): DynamicLayer; + new (): DynamicLayer; } export const DynamicLayer: DynamicLayerConstructor; @@ -7436,45 +7805,43 @@ declare namespace __esri { interface DynamicLayerProperties { /** * The portal item from which the layer is loaded. This will load the layer along with any overridden properties (e.g. renderers, definition expressions, etc.) saved to the portal item, not the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#portalItem) */ portalItem?: PortalItemProperties; /** * The URL to the REST endpoint of the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#url) */ url?: string; } - export interface DynamicLayerFetchImageOptions extends Object { /** * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#fetchImage) */ rotation?: number; /** * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#fetchImage) */ pixelRatio?: number; } - export interface DynamicLayerGetImageUrlOptions extends Object { /** * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#getImageUrl) */ pixelRatio?: number; /** * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#getImageUrl) */ rotation?: number; @@ -7483,64 +7850,67 @@ declare namespace __esri { interface ElevationLayer extends Layer, ArcGISCachedService, PortalLayer { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#url) */ url: string; /** * Creates an elevation sampler for the given [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) by querying the service layer for elevation data and caching it so values may be sampled quickly afterwards. The resolution of the cached data can be set using the `demResolution` option. In many cases, `auto` demResolution can be used to get high quality elevation samples without the need to know exactly where the data in the service is located. This is particularly useful for services which combine elevation data from many sources (such as the world elevation service). If more control, or higher quality samples are required, use either `finest-contiguous` or a fixed `{number}` resolution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler) - * + * * @param extent The extent for which to create the sampler. * @param options Additional query options. See the table below. * @param options.demResolution Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) for more details. * @param options.noDataValue The value to use when there is no data available. - * + * */ - createElevationSampler(extent: Extent, options?: ElevationLayerCreateElevationSamplerOptions): IPromise; + createElevationSampler( + extent: Extent, + options?: ElevationLayerCreateElevationSamplerOptions + ): IPromise; /** - * Requests a tile from the service and decodes the data into a linear array of elevation values. The returned promise resolves with a plain object describing the obtained elevation data for the tile. The object has the following properties: - * + * Requests a tile from the service and decodes the data into a linear array of elevation values. The returned promise resolves with a plain object describing the obtained elevation data for the tile. The object has the following properties: + * * Property | Type | Description * ----------|--------------|------------ * values | Float32Array | The elevation values contained in the tile. * width | number | The number of elevation values in one row of the tile. * height | number | The number of elevation values in one column of the tile. * maxZError | number | The upper bound for the compression error on the elevation values. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#fetchTile) - * + * * @param level the tile level. * @param row the tile row. * @param column the tile column. * @param noDataValue the value to use when a tile is partially missing data. - * + * */ fetchTile(level: number, row: number, column: number, noDataValue?: number): IPromise; /** * This method returns a URL to a tile for a given level, row and column. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#getTileUrl) - * + * * @param level The requested tile's level. * @param row The requested tile's row. * @param col The requested tile's column. - * + * */ getTileUrl(level: number, row: number, col: number): string; /** * Queries the service layer 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 service. The resolution from which the elevation is queried can be set using the `demResolution` option. In many cases, `auto` demResolution can be used to get high quality elevation samples without the need to know exactly where the data in the service is located. This is particularly useful for services which combine elevation data from many sources (such as the world elevation service). If more control, or higher quality samples are required, use either `finest-contiguous` or a fixed `{number}` resolution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) - * + * * @param geometry The geometry to use for sampling elevation data. * @param options Additional query options. See the table below. - * @param options.demResolution - * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. - * + * @param options.demResolution + * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. + * * demResolution | Description * -----------------------|------------- * `auto` | Automatically chooses an appropriate resolution for each coordinate of the input geometry. The current implementation will try to use the finest available resolution given that the total required number of tile requests does not exceed a certain maximum amount (currently 20). Note that this may result in values being sampled from different resolutions. @@ -7548,10 +7918,12 @@ declare namespace __esri { * `{number}` | Sample elevation from the resolution closest to the specified resolution (in meters). * @param options.returnSampleInfo Indicates whether to return additional sample information for each coordinate. * @param options.noDataValue The value to use when there is no data available. - * + * */ - queryElevation(geometry: Point | Multipoint | Polyline, options?: ElevationLayerQueryElevationOptions): IPromise; - + queryElevation( + geometry: Point | Multipoint | Polyline, + options?: ElevationLayerQueryElevationOptions + ): IPromise; on(name: "layerview-create", eventHandler: ElevationLayerLayerviewCreateEventHandler): IHandle; @@ -7561,11 +7933,11 @@ 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](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) */ - new(properties?: ElevationLayerProperties): ElevationLayer; + new (properties?: ElevationLayerProperties): ElevationLayer; fromJSON(json: any): ElevationLayer; } @@ -7575,62 +7947,60 @@ declare namespace __esri { interface ElevationLayerProperties extends LayerProperties, ArcGISCachedServiceProperties, PortalLayerProperties { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#url) */ url?: string; } - export interface ElevationLayerCreateElevationSamplerOptions extends Object { /** * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler) - * + * * @default auto */ demResolution?: number | string; /** * The value to use when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler) - * + * * @default 0 */ noDataValue?: number; } - export interface ElevationLayerQueryElevationOptions extends Object { /** - * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. - * + * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. + * * demResolution | Description * -----------------------|------------- * `auto` | Automatically chooses an appropriate resolution for each coordinate of the input geometry. The current implementation will try to use the finest available resolution given that the total required number of tile requests does not exceed a certain maximum amount (currently 20). Note that this may result in values being sampled from different resolutions. * `finest-contiguous` | Sample elevation from the finest available resolution (cell size) across the entire geometry. * `{number}` | Sample elevation from the resolution closest to the specified resolution (in meters). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) - * + * * @default auto */ demResolution?: number | string; /** * Indicates whether to return additional sample information for each coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) - * + * * @default false */ returnSampleInfo?: boolean; /** * The value to use when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) - * + * * @default 0 */ noDataValue?: number; @@ -7638,49 +8008,46 @@ declare namespace __esri { /** * Object returned when [queryElevation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) promise resolves: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ export interface ElevationLayerElevationQueryResult extends Object { /** * The geometry with sampled z-values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ geometry: Point | Multipoint | Polyline; /** * Contains additional information about how the geometry was sampled. This property is present depending on whether the user set `options.returnSampleInfo = true`, for each coordinate in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ sampleInfo?: ElevationLayerElevationQueryResultSampleInfo[]; /** * The value used when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ noDataValue: number; } export interface ElevationLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface ElevationLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface ElevationLayerElevationQueryResultSampleInfo extends Object { /** * The resolution at which the z-value was sampled. If no data was available for sampling for a given coordinate, the dem resolution value will be -1 for that coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ demResolution: number; @@ -7688,379 +8055,379 @@ declare namespace __esri { interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { /** - * Indicates the layer's supported capabilities. - * + * Describes the layer's supported capabilities. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ readonly capabilities: FeatureLayerCapabilities; /** * The copyright text as defined by the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#copyright) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) */ definitionExpression: string; /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#displayField) */ displayField: string; /** * An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). If you already have a [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) instance, you can call the [createFeatureLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer) method on the Sublayer to construct the layer for you. This only applies to map services with [dynamic layers](https://enterprise.arcgis.com/en/server/latest/publish-services/linux/about-dynamic-layers.htm) enabled. Therefore, the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) of the FeatureLayer instance must point to a map service url ending with `/dynamicLayer`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#dynamicDataSource) */ dynamicDataSource: DynamicMapLayer | DynamicDataLayer; /** * 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/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 [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. - * + * 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), [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), and [type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#type) properties. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ fields: Field[]; /** * The version of the geodatabase of the feature service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#gdbVersion) */ 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). 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; /** * 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) - * + * * @default false */ readonly hasAttachments: boolean; /** * 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 undefined */ readonly hasM: boolean; /** * 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 undefined */ readonly hasZ: boolean; /** * The historic moment to query. If historicMoment is not specified, the query will apply to the current features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#historicMoment) */ historicMoment: Date; /** - * 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** + * 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** * * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** - * 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** - * * Currently only FeatureLayers with point and polygon geometries are supported. + * 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** * * 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) - * + * * @default true */ labelsVisible: boolean; /** - * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property. * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) directly to the Feature Service. - * - * + * + * * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) */ layerId: number; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * 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) */ objectIdField: string; /** * An array of field names from the service to include in the FeatureLayer. If not specified, the layer will only return the `OBJECTID` field. To fetch the values from all fields in the layer, use `["*"]`. This is particularly useful when editing features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) */ outFields: string[]; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * The popup template for the layer. When set on the layer, 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 a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [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-FeatureLayer.html#popupTemplate) */ popupTemplate: PopupTemplate; /** * 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; + 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) */ renderer: Renderer; /** * When `true`, indicates that M values will be returned. When `false`, indicates that M values will never be returned. The layer view determines whether to include M values in feature queries when the property value is `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnM) - * + * * @default undefined */ returnM: boolean; /** * When `true`, indicates that Z values will always be returned. When `false`, indicates that Z values will never be returned. The layer view determines whether to include Z values in feature queries when the property value is `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) - * + * * @default undefined */ 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/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) + * 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) - * + * * @default true */ screenSizePerspectiveEnabled: boolean; /** - * 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. - * + * 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), [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), and [type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#type) 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. 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) */ spatialReference: SpatialReference; /** * An array of feature templates defined in the feature layer. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#templates) */ templates: FeatureTemplate[]; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#token) */ readonly token: string; /** * The name of the field holding the type ID or subtypes for the features. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#typeIdField) */ readonly typeIdField: string; /** * An array of subtypes defined in the feature service exposed by ArcGIS REST API. Each item includes information about the type, such as the type ID, name, and definition expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#types) */ types: FeatureType[]; /** * The URL of the REST endpoint of the layer or service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. If the url points directly to a service, then the layer must be specified in the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) property. If no [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) is given, then the first layer in the service will be loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) */ url: string; /** * The version of ArcGIS Server in which the layer is published. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#version) */ readonly version: number; /** - * 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`. - * + * Adds an attachment to a feature. This operation is available only if the layer's [capabilities.data.supportsAttachment](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). - * + * 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). If client-side features are added, removed or updated at runtime using [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) then use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) - * + * * @param edits Object containing features to be added, updated or deleted. * @param edits.addFeatures Array of features to be added. Values of non nullable fields must be provided when adding new features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. * @param edits.updateFeatures Array of features to be updated. Each feature must have valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). Values of non nullable fields must be provided when updating features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. * @param edits.deleteFeatures An array of features or objects to be deleted. When an array of features is passed, each feature must have a valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). When an array of objects is used, each object must have a valid `objectId` property. - * + * */ applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; /** * Creates query parameters that can be used to fetch features that satisfy the layer's current filters, and definitions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery) - * - * + * + * */ 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`. - * + * Deletes attachments from a feature. This operation is available only if the layer's [capabilities.data.supportsAttachment](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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getFeatureType) - * + * * @param feature A feature from this layer. - * + * */ getFeatureType(feature: Graphic): FeatureType; /** * Returns the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) associated with the given field name. The domain can be either a [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getFieldDomain) - * + * * @param fieldName Name of the field. * @param options An object specifying additional options. See the object specification table below for the required properties of this object. * @param options.feature The feature to which the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) is assigned. - * + * */ 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`. - * + * Query information about attachments associated with features. It will return an error if the layer's [capabilities.data.supportsAttachment](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.operations.supportsQueryAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. + * > **Known Limitations** When the layer's [capabilities.operations.supportsQueryAttachments](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; + 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. + * 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. - * + * */ queryExtent(params?: Query | QueryProperties): 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, 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, the total number of features satisfying the layer's configuration/filters is returned. - * + * */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. 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 [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. 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 [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. * > To query 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.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) method. - * + * * [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. - * + * */ queryFeatures(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. * > To query for ObjectIDs 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.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryObjectIds) method. - * + * * [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. - * + * */ 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`. - * + * Updates an existing attachment for a feature. This operation is available only if the layer's [capabilities.data.supportsAttachment](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; - + updateAttachment( + feature: Graphic, + attachmentId: number, + attachment: HTMLFormElement | FormData + ): IPromise; on(name: "layerview-create", eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; @@ -8070,196 +8437,198 @@ 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 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) */ - new(properties?: FeatureLayerProperties): FeatureLayer; + new (properties?: FeatureLayerProperties): FeatureLayer; fromJSON(json: any): FeatureLayer; } export const FeatureLayer: FeatureLayerConstructor; - interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface FeatureLayerProperties + extends LayerProperties, + PortalLayerProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { /** * The copyright text as defined by the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#copyright) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) */ definitionExpression?: string; /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#displayField) */ displayField?: string; /** * An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). If you already have a [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) instance, you can call the [createFeatureLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer) method on the Sublayer to construct the layer for you. This only applies to map services with [dynamic layers](https://enterprise.arcgis.com/en/server/latest/publish-services/linux/about-dynamic-layers.htm) enabled. Therefore, the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) of the FeatureLayer instance must point to a map service url ending with `/dynamicLayer`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#dynamicDataSource) */ dynamicDataSource?: DynamicMapLayer | DynamicDataLayer; /** * 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/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 [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. - * + * 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), [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), and [type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#type) 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). 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; /** * The historic moment to query. If historicMoment is not specified, the query will apply to the current features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#historicMoment) */ historicMoment?: DateProperties; /** - * 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** + * 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** * * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** - * 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** - * * Currently only FeatureLayers with point and polygon geometries are supported. + * 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** * * 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) - * + * * @default true */ labelsVisible?: boolean; /** - * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property. * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) directly to the Feature Service. - * - * + * + * * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) */ layerId?: number; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * 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) */ objectIdField?: string; /** * An array of field names from the service to include in the FeatureLayer. If not specified, the layer will only return the `OBJECTID` field. To fetch the values from all fields in the layer, use `["*"]`. This is particularly useful when editing features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) */ outFields?: string[]; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * The popup template for the layer. When set on the layer, 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 a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [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-FeatureLayer.html#popupTemplate) */ 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 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) */ renderer?: RendererProperties; /** * When `true`, indicates that M values will be returned. When `false`, indicates that M values will never be returned. The layer view determines whether to include M values in feature queries when the property value is `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnM) - * + * * @default undefined */ returnM?: boolean; /** * When `true`, indicates that Z values will always be returned. When `false`, indicates that Z values will never be returned. The layer view determines whether to include Z values in feature queries when the property value is `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) - * + * * @default undefined */ 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/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) + * 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) - * + * * @default true */ screenSizePerspectiveEnabled?: boolean; /** - * 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. - * + * 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), [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), and [type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#type) 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. 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) */ spatialReference?: SpatialReferenceProperties; /** * An array of feature templates defined in the feature layer. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#templates) */ templates?: FeatureTemplateProperties[]; /** * An array of subtypes defined in the feature service exposed by ArcGIS REST API. Each item includes information about the type, such as the type ID, name, and definition expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#types) */ types?: FeatureTypeProperties[]; /** * The URL of the REST endpoint of the layer or service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. If the url points directly to a service, then the layer must be specified in the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) property. If no [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) is given, then the first layer in the service will be loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) */ url?: string; @@ -8267,419 +8636,411 @@ declare namespace __esri { /** * FeatureEditResult represents the result of adding, updating or deleting a feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ export interface FeatureEditResult extends Object { /** * Object Id of the feature that was edited. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ objectId: number; /** * If the edit failed, the edit result includes an error. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ error: FeatureEditResultError; } - export interface FeatureLayerApplyEditsEdits extends Object { /** * Array of features to be added. Values of non nullable fields must be provided when adding new features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) */ addFeatures?: Graphic[]; /** * Array of features to be updated. Each feature must have valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). Values of non nullable fields must be provided when updating features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) */ updateFeatures?: Graphic[]; /** * An array of features or objects to be deleted. When an array of features is passed, each feature must have a valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). When an array of objects is used, each object must have a valid `objectId` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) */ deleteFeatures?: Graphic[] | any[]; } - export interface FeatureLayerCapabilities extends Object { /** - * Indicates data capabilities that can be performed on features in the layer. - * + * Describes characteristics of the data in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ data: FeatureLayerCapabilitiesData; /** - * Indicates editing capabilities that can be performed on the features in the layer. - * + * Describes editing capabilities that can be performed on the features in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ editing: FeatureLayerCapabilitiesEditing; /** - * Indicates operations that can be performed on features in the layer. - * + * Describes operations that can be performed on features in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ operations: FeatureLayerCapabilitiesOperations; /** - * Indicates query operations that can be performed on features in the layer. - * + * Describes [query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) operations that can be performed on features in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ query: FeatureLayerCapabilitiesQuery; /** * Indicates if the layer's query operation supports querying features or records related to features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ queryRelated: FeatureLayerCapabilitiesQueryRelated; } - export interface FeatureLayerCapabilitiesData extends Object { /** * Indicates if the attachment is enabled on the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsAttachment: boolean; /** * Indicates if the features in the layer support M values. Requires ArcGIS Server service 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ 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 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) */ supportsZ: boolean; } - export interface FeatureLayerCapabilitiesEditing extends Object { /** * Indicates if anonymous users can delete features created by others. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDeleteByAnonymous: boolean; /** * Indicates if logged in users can delete features created by others. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDeleteByOthers: boolean; /** * Indicates if the geometry of the features in the layer can be edited. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsGeometryUpdate: boolean; /** * Indicates if the `globalid` values provided by the client are used in [applyEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsGlobalId: boolean; /** * Indicates if the `rollbackOnFailure` parameter can be set to `true` or `false` when running the synchronizeReplica operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsRollbackOnFailure: boolean; /** * Indicates if anonymous users can update features created by others. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUpdateByAnonymous: boolean; /** * Indicates if logged in users can update features created by others. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUpdateByOthers: boolean; /** * Indicates if `m-values` must be provided when updating features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUpdateWithoutM: boolean; /** * Indicates if the layer supports uploading attachments by [UploadId](https://developers.arcgis.com/rest/services-reference/item.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUploadWithItemId: boolean; } - export interface FeatureLayerCapabilitiesOperations extends Object { /** * Indicates if new features can be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) to the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsAdd: boolean; /** * Indicates if features can be [deleted](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDelete: boolean; /** * Indicates if features in the layer can be [updated](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUpdate: boolean; /** * Indicates if features in the layer can be [edited](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). Use `supportsAdd`, `supportsUpdate` and `supportsDelete` to determine which editing operations are supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsEditing: boolean; /** * Indicates if values of one or more field values in the layer can be updated. See the [Calculate REST operation](https://developers.arcgis.com/rest/services-reference/calculate-feature-service-layer-.htm) document for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsCalculate: boolean; /** * Indicates if features in the layer can be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsQuery: boolean; + /** + * Indicates if the layer supports [REST API queryAttachments](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) operation, which is supported with hosted feature services at version 10.5 and greater. If `false`, [queryAttachments() method](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) + */ + supportsQueryAttachments: boolean; /** * Indicates if the layer supports a SQL-92 expression or where clause. This operation is only supported in ArcGIS Online hosted feature services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsValidateSql: boolean; /** * Indicates if resized attachments are supported in the feature layer. This is useful for showing thumbnails in [Popups](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsResizeAttachments: boolean; } - 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsCentroid: boolean; /** * Indicates if the layer's query operation supports a buffer distance for input geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDistance: boolean; /** * Indicates if the layer supports queries for distinct values based on fields specified in the [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDistinct: boolean; /** * Indicates if the layer's query response includes the extent of features. At 10.3, this option is only available for hosted feature services. At 10.3.1, it is available for hosted and non-hosted feature services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsExtent: boolean; /** * Indicates if the layer's query response contains geometry attributes, including shape area and length attributes. This operation is only supported in ArcGIS Online hosted feature services. - * + * * [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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsOrderBy: boolean; /** * Indicates if the query response supports pagination. Requires an ArcGIS Server service 10.3 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsPagination: boolean; /** - * Indicates if the query operation supports the projection of geometries onto a virtual grid. Requires an ArcGIS Server service 10.3 or greater. - * + * Indicates if the query operation supports the projection of geometries onto a virtual grid. 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) */ supportsQuantization: boolean; + /** + * Indicates if the query operation supports quantization designed to be used in edit mode (highest resolution at the given spatial reference). 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) + */ + supportsQuantizationEditMode: boolean; /** * Indicates if the number of features returned by the query operation can be controlled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsResultType: boolean; /** * Indicates if the query operation supports SQL expressions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsSqlExpression: boolean; /** * Indicates if the query operation supports using standardized queries. Learn more about [standardized queries here](http://server.arcgis.com/en/server/latest/administer/linux/about-standardized-queries.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsStandardizedQueriesOnly: boolean; /** * Indicates if the layer supports field-based statistical functions. Requires ArcGIS Server service 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsStatistics: boolean; /** * Indicates if the layer supports historic moment query. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsHistoricMoment: boolean; } - export interface FeatureLayerCapabilitiesQueryRelated extends Object { /** * Indicates if the layer's query response includes the number of features or records related to features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsCount: boolean; /** * Indicates if the related features or records returned in the query response can be ordered by one or more fields. Requires ArcGIS Server service 10.3 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsOrderBy: boolean; /** * Indicates if the query response supports pagination for related features or records. Requires ArcGIS Server service 10.3 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsPagination: boolean; } - export interface FeatureLayerElevationInfo extends Object { /** - * 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. - * + * 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 | 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`. + * absolute-height | Features are placed at an absolute elevation (z-value) above sea level. This z-value 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 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 feature. If this property is set, then z values are not considered for calculating feature height. - * + * This object contains information about setting a custom z-value on the feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ featureExpressionInfo?: FeatureLayerElevationInfoFeatureExpressionInfo; /** * The unit for `featureExpressionInfo` and `offset` values. It doesn't apply to z-values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ unit?: string; } - 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 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. - * + * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the z-value of the feature. If the geometry has z-values, they will be ignored and `featureExpressionInfo` will be 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) */ expression?: string; } - export interface FeatureLayerFeatureReduction extends Object { /** * Type of the decluttering method. The only supported type at the moment is `"selection"`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) */ type: string; } - export interface FeatureLayerGetFieldDomainOptions extends Object { /** * The feature to which the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getFieldDomain) */ feature: Graphic; } export interface FeatureLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface FeatureLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface FeatureEditResultError extends Object { /** * Error name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ name: string; /** * Message describing the error. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ message: string; @@ -8688,30 +9049,29 @@ declare namespace __esri { interface GeoRSSLayer extends Layer, ScaleRangeLayer { /** * Symbol used to represent line features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#lineSymbol) */ lineSymbol: SimpleLineSymbol; /** * Symbol used to represent point features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#pointSymbol) */ pointSymbol: PictureMarkerSymbol; /** * Symbol used to represent polygon features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#polygonSymbol) */ polygonSymbol: SimpleFillSymbol; /** * The URL pointing to a GeoRSS file. This must be publicly available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#url) */ url: string; - on(name: "layerview-create", eventHandler: GeoRSSLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: GeoRSSLayerLayerviewDestroyEventHandler): IHandle; @@ -8720,11 +9080,11 @@ declare namespace __esri { interface GeoRSSLayerConstructor { /** * The GeoRSSLayer class is used to create a layer based on [GeoRSS](http://www.georss.org/). GeoRSS is a way to add geographic information to an RSS feed. The GeoRSSLayer supports both `GeoRSS-Simple` and `GeoRSS GML` encodings, and multiple geometry types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html) */ - new(properties?: GeoRSSLayerProperties): GeoRSSLayer; + new (properties?: GeoRSSLayerProperties): GeoRSSLayer; } export const GeoRSSLayer: GeoRSSLayerConstructor; @@ -8732,39 +9092,37 @@ declare namespace __esri { interface GeoRSSLayerProperties extends LayerProperties, ScaleRangeLayerProperties { /** * Symbol used to represent line features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#lineSymbol) */ lineSymbol?: SimpleLineSymbolProperties; /** * Symbol used to represent point features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#pointSymbol) */ pointSymbol?: PictureMarkerSymbolProperties; /** * Symbol used to represent polygon features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#polygonSymbol) */ polygonSymbol?: SimpleFillSymbolProperties; /** * The URL pointing to a GeoRSS file. This must be publicly available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#url) */ url?: string; } export interface GeoRSSLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface GeoRSSLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -8773,78 +9131,77 @@ declare namespace __esri { interface GraphicsLayer extends Layer, ScaleRangeLayer { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ elevationInfo: GraphicsLayerElevationInfo; /** * A collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the layer. Each graphic is a vector representation of the location of a real-world feature. Each graphic in a single GraphicsLayer may contain either a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [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) [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry). In addition, each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the collection may contain its own [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes), [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html), and [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). To add a graphic to the GraphicsLayer use [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add), or [GraphicsLayer.graphics.add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) */ 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/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) + * 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) - * + * * @default true */ screenSizePerspectiveEnabled: boolean; /** * For [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) the type is `graphics`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#type) */ readonly type: "graphics"; /** * Adds a graphic to the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add) - * + * * @param graphic The graphic to add to the layer. - * + * */ add(graphic: Graphic): void; /** * Adds an array of graphics to the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#addMany) - * + * * @param graphics The graphic(s) to add to the layer. - * + * */ addMany(graphics: Graphic[]): void; /** * Removes a graphic from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#remove) - * + * * @param graphic The graphic to remove from the layer. - * + * */ remove(graphic: Graphic): void; /** * Clears all the graphics from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#removeAll) - * - * + * + * */ removeAll(): void; /** * Removes an array of graphics from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#removeMany) - * + * * @param graphics The graphics to remove from the layer. - * + * */ removeMany(graphics: Graphic[]): void; - on(name: "layerview-create", eventHandler: GraphicsLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: GraphicsLayerLayerviewDestroyEventHandler): IHandle; @@ -8853,11 +9210,11 @@ declare namespace __esri { interface GraphicsLayerConstructor { /** * A GraphicsLayer contains one or more client-side [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). Each [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) in the GraphicsLayer is rendered in a [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) inside either a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). The [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) contain discrete vector [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that represent real-world phenomena. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) */ - new(properties?: GraphicsLayerProperties): GraphicsLayer; + new (properties?: GraphicsLayerProperties): GraphicsLayer; } export const GraphicsLayer: GraphicsLayerConstructor; @@ -8865,81 +9222,77 @@ declare namespace __esri { interface GraphicsLayerProperties extends LayerProperties, ScaleRangeLayerProperties { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ elevationInfo?: GraphicsLayerElevationInfo; /** * A collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the layer. Each graphic is a vector representation of the location of a real-world feature. Each graphic in a single GraphicsLayer may contain either a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [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) [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry). In addition, each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the collection may contain its own [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes), [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html), and [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). To add a graphic to the GraphicsLayer use [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add), or [GraphicsLayer.graphics.add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) */ 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/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) + * 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) - * + * * @default true */ screenSizePerspectiveEnabled?: boolean; } - export interface GraphicsLayerElevationInfo 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 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. + * * Mode | Description * ------|------------ * on-the-ground | Graphics are placed on the terrain surface. * 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). In case `featureExpressionInfo` is defined, the result of the expression is used - * instead of the geometry’s z-value. 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. It doesn't take the elevation of the terrain into account. 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. - * + * instead of the geometry’s z-value. absolute-height | Graphics are placed at an absolute elevation (z-value) above sea level. This z-value 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. It doesn't take the elevation of the terrain into account. 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. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.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 z-value on the feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ featureExpressionInfo?: GraphicsLayerElevationInfoFeatureExpressionInfo; /** * The unit for `featureExpressionInfo` and `offset` values. It doesn't apply to z-values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ unit?: string; } - export interface GraphicsLayerElevationInfoFeatureExpressionInfo 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 z-value 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 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. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ expression?: string; } export interface GraphicsLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface GraphicsLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -8947,19 +9300,27 @@ declare namespace __esri { interface GroupLayer extends Layer, LayersMixin, PortalLayer { /** - * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. - * + * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. + * * Value | Description * ------|------------ * independent | Each child layer manages its visibility independent from other layers. * inherited | Each child layer's visibility matches the [GroupLayer’s visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visible). * exclusive | Only one child layer is visible at a time. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode) */ visibilityMode: string; + /** + * Loads all the externally loadable resources associated with the group layer. For the group layer this will load all the layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#loadAll) + * + * + */ + loadAll(): IPromise; on(name: "layerview-create", eventHandler: GroupLayerLayerviewCreateEventHandler): IHandle; @@ -8969,11 +9330,11 @@ declare namespace __esri { interface GroupLayerConstructor { /** * GroupLayer provides the ability to organize several sublayers into one common layer. Suppose there are several [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that all represent water features in different dimensions. For example, wells (points), streams (lines), and lakes (polygons). The GroupLayer provides the functionality to treat them as one layer called "Water Features" even though they are stored as separate feature layers. To accomplish this, create a new GroupLayer and use the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#add) method to add each of the water layers to the GroupLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) */ - new(properties?: GroupLayerProperties): GroupLayer; + new (properties?: GroupLayerProperties): GroupLayer; fromJSON(json: any): GroupLayer; } @@ -8982,29 +9343,27 @@ declare namespace __esri { interface GroupLayerProperties extends LayerProperties, LayersMixinProperties, PortalLayerProperties { /** - * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. - * + * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. + * * Value | Description * ------|------------ * independent | Each child layer manages its visibility independent from other layers. * inherited | Each child layer's visibility matches the [GroupLayer’s visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visible). * exclusive | Only one child layer is visible at a time. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode) */ visibilityMode?: string; } export interface GroupLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface GroupLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9013,41 +9372,40 @@ declare namespace __esri { interface ImageryLayer extends Layer, ArcGISImageService, ScaleRangeLayer, RefreshableLayer { /** * A function that processes [pixelData](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData). The `pixelData` object contains a [pixelBlock](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html) property that gives you access to all of the pixels in the raster on the client. Inside the `pixelFilter` you may loop through all the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) found in the `pixelBlock` property of the `pixelData` object and process them. This function may be used to hide some pixels from the view, alter their values, and change their color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) */ pixelFilter: Function; /** * Indicates whether to display popups when the layer is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * The portal item from which the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#portalItem) */ portalItem: PortalItem; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#token) */ readonly token: string; /** * Executes the [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function and redraws the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#redraw) - * - * + * + * */ redraw(): void; - on(name: "layerview-create", eventHandler: ImageryLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: ImageryLayerLayerviewDestroyEventHandler): IHandle; @@ -9056,49 +9414,51 @@ declare namespace __esri { interface ImageryLayerConstructor { /** * Represents an image service resource as a layer. An ImageryLayer retrieves and displays data from image services. ImageryLayer allows you to and apply client side [pixel filtering](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter), server defined or client-defined [rendering rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#renderingRule) (e.g. remap, colormap), and [mosaic rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#mosaicRule). This layer is particularly useful when you need to interactively change pixel manipulation criteria and get an immediate response on the client. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) */ - new(properties?: ImageryLayerProperties): ImageryLayer; + new (properties?: ImageryLayerProperties): ImageryLayer; fromJSON(json: any): ImageryLayer; } export const ImageryLayer: ImageryLayerConstructor; - interface ImageryLayerProperties extends LayerProperties, ArcGISImageServiceProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface ImageryLayerProperties + extends LayerProperties, + ArcGISImageServiceProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { /** * A function that processes [pixelData](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData). The `pixelData` object contains a [pixelBlock](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html) property that gives you access to all of the pixels in the raster on the client. Inside the `pixelFilter` you may loop through all the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) found in the `pixelBlock` property of the `pixelData` object and process them. This function may be used to hide some pixels from the view, alter their values, and change their color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) */ pixelFilter?: Function; /** * Indicates whether to display popups when the layer is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * The portal item from which the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#portalItem) */ portalItem?: PortalItemProperties; } export interface ImageryLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface ImageryLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9107,12 +9467,11 @@ declare namespace __esri { interface IntegratedMeshLayer extends Layer, SceneService, PortalLayer { /** * Specifies how the mesh is placed on the vertical axis (z). This property only affects [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) when using the `absolute-height` mode. Integrated mesh layers always render in front of the ground surface, so setting negative offset values will not render them below the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) */ elevationInfo: IntegratedMeshLayerElevationInfo; - on(name: "layerview-create", eventHandler: IntegratedMeshLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: IntegratedMeshLayerLayerviewDestroyEventHandler): IHandle; @@ -9121,11 +9480,11 @@ declare namespace __esri { interface IntegratedMeshLayerConstructor { /** * The IntegratedMeshLayer is designed for visualizing accurate representations in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) of infrastructure and natural landscapes that are difficult to access. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) */ - new(properties?: IntegratedMeshLayerProperties): IntegratedMeshLayer; + new (properties?: IntegratedMeshLayerProperties): IntegratedMeshLayer; fromJSON(json: any): IntegratedMeshLayer; } @@ -9135,52 +9494,49 @@ declare namespace __esri { interface IntegratedMeshLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { /** * Specifies how the mesh is placed on the vertical axis (z). This property only affects [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) when using the `absolute-height` mode. Integrated mesh layers always render in front of the ground surface, so setting negative offset values will not render them below the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) */ elevationInfo?: IntegratedMeshLayerElevationInfo; } - export interface IntegratedMeshLayerElevationInfo extends Object { /** - * Defines how the mesh is placed on the vertical axis (z). Currently only `absolute-height` is supported. - * + * Defines how the mesh is placed on the vertical axis (z). Currently only `absolute-height` is supported. + * * Mode | Description * ------|------------ - * absolute-height | The mesh is placed at an absolute height above sea level. This height is determined by summing up the `offset` value and the mesh's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for an IntegratedMeshLayer. - * - * + * absolute-height | The mesh is placed at an absolute elevation (z-value) above sea level. This z-value is determined by summing up the `offset` value and the mesh's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for an IntegratedMeshLayer. + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) */ mode: string; /** * An elevation offset, which is added to the vertical position of the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) - * + * * @default 0 */ offset?: number; /** * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) - * + * * @default meters */ unit?: string; } export interface IntegratedMeshLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface IntegratedMeshLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9189,18 +9545,17 @@ declare namespace __esri { interface KMLLayer extends Layer, PortalLayer, ScaleRangeLayer { /** * A collection of [KMLSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#sublayers) */ sublayers: Collection; /** * The publicly accessible URL for a .kml or .kmz file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#url) */ url: string; - on(name: "layerview-create", eventHandler: KMLLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: KMLLayerLayerviewDestroyEventHandler): IHandle; @@ -9209,11 +9564,11 @@ declare namespace __esri { interface KMLLayerConstructor { /** * The KMLLayer class is used to create a layer based on a KML file (.kml, .kmz). KML is an XML-based file format used to represent geographic features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) */ - new(properties?: KMLLayerProperties): KMLLayer; + new (properties?: KMLLayerProperties): KMLLayer; fromJSON(json: any): KMLLayer; } @@ -9223,27 +9578,25 @@ declare namespace __esri { interface KMLLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { /** * A collection of [KMLSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The publicly accessible URL for a .kml or .kmz file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#url) */ url?: string; } export interface KMLLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface KMLLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9252,74 +9605,74 @@ declare namespace __esri { interface Layer extends Accessor, Loadable, Evented { /** * The full extent of the layer. By default, this is worldwide. This property may be used to set the extent of the view to match a layer's extent so that its features appear to fill the view. See the sample snippet below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fullExtent) */ fullExtent: Extent; /** * The unique ID assigned to the layer. If not set by the developer, it is automatically generated when the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) */ id: string; /** - * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. - * + * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. + * * Value | Description * ------|------------ * show | The layer is visible in the table of contents. * hide | The layer is hidden in the table of contents. * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), hide the children layers from the table of contents. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) - * + * * @default show */ listMode: string; /** * Indicates whether the layer's resources have loaded. When `true`, all the properties of the object can be accessed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent transparent and `1` is completely opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#opacity) - * + * * @default 1 */ opacity: number; /** * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widgets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#title) */ 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 | 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) */ readonly type: string; /** * Indicates if the layer is visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). When `false`, the layer may still be added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance that is referenced in a view, but its features will not be visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#visible) - * + * * @default true */ visible: boolean; /** * Fetches custom attribution data for the layer when it becomes available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fetchAttributionData) - * - * + * + * */ fetchAttributionData(): IPromise; } @@ -9327,32 +9680,31 @@ declare namespace __esri { interface LayerConstructor { /** * The layer is the most fundamental component of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). It is a collection of spatial data in the form of vector graphics or raster images that represent real-world phenomena. Layers may contain discrete features that store vector data or continuous cells/pixels that store raster data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) */ - new(properties?: LayerProperties): Layer; - + new (properties?: LayerProperties): Layer; /** * Creates a new layer instance from an ArcGIS Server URL. Depending on the URL, the returned layer type may be a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html), [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) or [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). This is useful when you work with various ArcGIS Server URLs, but you don't necessarily know which layer type(s) they create. This method creates the appropriate layer type for you. In case of a feature service or a scene service, when the URL points to the service and the service has multiple layers, the returned promise will resolve to a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServerUrl) - * + * * @param params Input parameters for creating the layer. * @param params.url The ArcGIS Server URL used to create the layer. * @param params.properties Set any of the layer's properties here for constructing the layer instance (e.g. popupTemplate, renderer, etc.). - * + * */ fromArcGISServerUrl(params: LayerFromArcGISServerUrlParams): IPromise; /** * Creates a new layer instance of the appropriate layer class from an ArcGIS Online or ArcGIS Enterprise [portal item](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). If the item points to a feature service with multiple layers, then a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is created. If the item points to a service with a single layer, then it resolves to a layer of the same type of class as the service. See also: [isLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#isLayer) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromPortalItem) - * + * * @param params The parameters for loading the portal item. * @param params.portalItem The object representing an ArcGIS Online or ArcGIS Enterprise portal item from which to load the layer. - * + * */ fromPortalItem(params: LayerFromPortalItemParams): IPromise; } @@ -9362,95 +9714,164 @@ declare namespace __esri { interface LayerProperties extends LoadableProperties { /** * The full extent of the layer. By default, this is worldwide. This property may be used to set the extent of the view to match a layer's extent so that its features appear to fill the view. See the sample snippet below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fullExtent) */ fullExtent?: ExtentProperties; /** * The unique ID assigned to the layer. If not set by the developer, it is automatically generated when the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) */ id?: string; /** - * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. - * + * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. + * * Value | Description * ------|------------ * show | The layer is visible in the table of contents. * hide | The layer is hidden in the table of contents. * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), hide the children layers from the table of contents. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) - * + * * @default show */ listMode?: string; /** * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent transparent and `1` is completely opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#opacity) - * + * * @default 1 */ opacity?: number; /** * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widgets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#title) */ title?: string; /** * Indicates if the layer is visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). When `false`, the layer may still be added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance that is referenced in a view, but its features will not be visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#visible) - * + * * @default true */ visible?: boolean; } - export interface LayerFromArcGISServerUrlParams extends Object { /** * The ArcGIS Server URL used to create the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServerUrl) */ url: string; /** * Set any of the layer's properties here for constructing the layer instance (e.g. popupTemplate, renderer, etc.). - * + * * [Read more...](properties.html) */ properties?: any; } - export interface LayerFromPortalItemParams extends Object { /** * The object representing an ArcGIS Online or ArcGIS Enterprise portal item from which to load the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromPortalItem) */ portalItem: PortalItem; } - interface MapImageLayer extends Layer, SublayersOwner, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer, ScaleRangeLayer, RefreshableLayer { + interface MapImageLayer + extends Layer, + SublayersOwner, + ArcGISMapService, + 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; + /** + * The output dots per inch (DPI) of the MapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#dpi) + * + * @default 96 + */ + dpi: number; + /** + * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#gdbVersion) + */ + gdbVersion: string; + /** + * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageFormat) + * + * @default png24 + */ + imageFormat: string; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageMaxHeight) + * + * @default 2048 + */ + imageMaxHeight: number; + /** + * Indicates the maximum width of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageMaxWidth) + * + * @default 2048 + */ + imageMaxWidth: number; + /** + * Indicates whether the background of the image exported by the service is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageTransparency) + * + * @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-MapImageLayer.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). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#createExportImageParameters) + * + * @param extent The extent of the exported image + * @param width The width of the exported image + * @param height The height of the exported image + * @param options The parameter options is an object with the following properties. + * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. + * @param options.pixelRatio The pixel ratio to apply to the dpi of the exported image. + * + */ + createExportImageParameters( + extent: Extent, + width: number, + height: number, + options?: MapImageLayerCreateExportImageParametersOptions + ): any; on(name: "layerview-create", eventHandler: MapImageLayerLayerviewCreateEventHandler): IHandle; @@ -9460,42 +9881,105 @@ declare namespace __esri { interface MapImageLayerConstructor { /** * MapImageLayer allows you to display and analyze data from [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) defined in a [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm), exporting images instead of features. Map service images are dynamically generated on the server based on a request, which includes an LOD (level of detail), a bounding box, dpi, spatial reference and other options. The exported image is of the entire map extent specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) */ - new(properties?: MapImageLayerProperties): MapImageLayer; + new (properties?: MapImageLayerProperties): MapImageLayer; fromJSON(json: any): MapImageLayer; } export const MapImageLayer: MapImageLayerConstructor; - interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISDynamicMapServiceProperties, DynamicLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface MapImageLayerProperties + extends LayerProperties, + ArcGISMapServiceProperties, + DynamicLayerProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { + /** + * The output dots per inch (DPI) of the MapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#dpi) + * + * @default 96 + */ + dpi?: number; + /** + * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#gdbVersion) + */ + gdbVersion?: string; + /** + * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageFormat) + * + * @default png24 + */ + imageFormat?: string; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageMaxHeight) + * + * @default 2048 + */ + imageMaxHeight?: number; + /** + * Indicates the maximum width of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageMaxWidth) + * + * @default 2048 + */ + imageMaxWidth?: number; + /** + * Indicates whether the background of the image exported by the service is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageTransparency) + * + * @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-MapImageLayer.html#sublayers) */ sublayers?: CollectionProperties; } export interface MapImageLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface MapImageLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - interface MapNotesLayer extends Layer, PortalLayer, ScaleRangeLayer { + export interface MapImageLayerCreateExportImageParametersOptions extends Object { + /** + * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#createExportImageParameters) + */ + rotation?: number; + /** + * The pixel ratio to apply to the dpi of the exported image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#createExportImageParameters) + */ + pixelRatio?: number; + } + interface MapNotesLayer extends Layer, PortalLayer, ScaleRangeLayer { on(name: "layerview-create", eventHandler: MapNotesLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: MapNotesLayerLayerviewDestroyEventHandler): IHandle; @@ -9504,30 +9988,26 @@ declare namespace __esri { interface MapNotesLayerConstructor { /** * The MapNotesLayer is used to create layers based on Map Notes within a WebMap or PortalItem. Map notes are part of web maps, and are typically created with ArcGIS Online MapViewer. For additional information, please refer to the ArcGIS Online documentation on how to [Add Map notes](http://doc.arcgis.com/en/arcgis-online/create-maps/add-layers.htm#ESRI_SECTION1_0C90A3B63ABD49D5B9535055991F4684). Within the [web map specification](https://developers.arcgis.com/web-map-specification/), map notes are a special type of [FeatureCollections](https://developers.arcgis.com/web-map-specification/objects/featureCollection/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapNotesLayer.html) */ - new(properties?: MapNotesLayerProperties): MapNotesLayer; + new (properties?: MapNotesLayerProperties): MapNotesLayer; fromJSON(json: any): MapNotesLayer; } export const MapNotesLayer: MapNotesLayerConstructor; - interface MapNotesLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { - - } + interface MapNotesLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties {} export interface MapNotesLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface MapNotesLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9536,28 +10016,26 @@ declare namespace __esri { interface ArcGISCachedService { /** * The copyright text as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#copyright) */ copyright: string; /** * The spatial reference of the layer as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#spatialReference) */ readonly spatialReference: SpatialReference; /** * Contains information about the tiling scheme for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#tileInfo) */ tileInfo: TileInfo; } interface ArcGISCachedServiceConstructor { - - - new(properties?: ArcGISCachedServiceProperties): ArcGISCachedService; + new (properties?: ArcGISCachedServiceProperties): ArcGISCachedService; fromJSON(json: any): ArcGISCachedService; } @@ -9567,315 +10045,183 @@ declare namespace __esri { interface ArcGISCachedServiceProperties { /** * The copyright text as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#copyright) */ copyright?: string; /** * Contains information about the tiling scheme for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#tileInfo) */ tileInfo?: TileInfoProperties; } - interface ArcGISDynamicMapService { - /** - * The output dots per inch (DPI) of the MapImageLayer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#dpi) - * - * @default 96 - */ - dpi: number; - /** - * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#gdbVersion) - */ - gdbVersion: string; - /** - * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageFormat) - * - * @default png24 - */ - imageFormat: string; - /** - * Indicates the maximum height of the image exported by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxHeight) - * - * @default 2048 - */ - imageMaxHeight: number; - /** - * Indicates the maximum width of the image exported by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxWidth) - * - * @default 2048 - */ - imageMaxWidth: number; - /** - * Indicates whether the background of the image exported by the service is transparent. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageTransparency) - * - * @default true - */ - imageTransparency: boolean; - - /** - * 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). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createExportImageParameters) - * - * @param extent The extent of the exported image - * @param width The width of the exported image - * @param height The height of the exported image - * @param options The parameter options is an object with the following properties. - * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * - */ - createExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceCreateExportImageParametersOptions): any; - } - - interface ArcGISDynamicMapServiceConstructor { - - - new(): ArcGISDynamicMapService; - } - - export const ArcGISDynamicMapService: ArcGISDynamicMapServiceConstructor; - - interface ArcGISDynamicMapServiceProperties { - /** - * The output dots per inch (DPI) of the MapImageLayer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#dpi) - * - * @default 96 - */ - dpi?: number; - /** - * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#gdbVersion) - */ - gdbVersion?: string; - /** - * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageFormat) - * - * @default png24 - */ - imageFormat?: string; - /** - * Indicates the maximum height of the image exported by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxHeight) - * - * @default 2048 - */ - imageMaxHeight?: number; - /** - * Indicates the maximum width of the image exported by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxWidth) - * - * @default 2048 - */ - imageMaxWidth?: number; - /** - * Indicates whether the background of the image exported by the service is transparent. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageTransparency) - * - * @default true - */ - imageTransparency?: boolean; - } - - - export interface ArcGISDynamicMapServiceCreateExportImageParametersOptions extends Object { - /** - * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createExportImageParameters) - */ - rotation?: number; - } - interface ArcGISImageService { /** * The compression quality value. This controls how much loss the image will be subjected to. Only valid when using `jpg` [image format](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionQuality) */ compressionQuality: number; /** * The output image compression tolerance value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionTolerance) - * + * * @default 0.01 */ compressionTolerance: number; /** * The copyright text as defined by the image service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#copyright) */ copyright: string; /** * The SQL where clause used to filter rasters on the client. Only the rasters that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#definitionExpression) */ definitionExpression: string; /** * An array of fields in the layer for which a [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) has been defined. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#domainFields) */ domainFields: Field[]; /** * An array of fields in the layer. Each field represents an attribute that may contain a value for each raster in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fields) */ fields: Field[]; /** * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Possible Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format) - * + * * @default jpgpng */ format: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fullExtent) */ fullExtent: Extent; /** * Indicates if the Image Service has [multidimensionalInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasMultidimensions) */ hasMultidimensions: boolean; /** * Indicates if the Image Service has a [raster attribute table](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable). If `true`, the raster attribute table can be accessed with the [rasterAttributeTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) property after the layer has [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasRasterAttributeTable) */ hasRasterAttributeTable: boolean; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxHeight) - * + * * @default 4100 */ imageMaxHeight: number; /** * Indicates the maximum width of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxWidth) - * + * * @default 15000 */ imageMaxWidth: number; /** * Defines how overlapping images should be mosaicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule) */ mosaicRule: MosaicRule; /** * The multidimensional information associated with the service. This will have a value if `serviceInfo` has `hasMultidimensionalInfo = true`. If defined, multidimensional information contains various "dimensions" of data for a particular value, such as time, depth, altitude, etc. Defining slices of particular dimensions in the layer is handled with the [multidimensionalDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) property of the [mosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo) */ multidimensionalInfo: any; /** * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelType) */ pixelType: string; /** * The popup template for the layer. When set on the layer, the popupTemplate allows users to access attributes and display their values using text and/or charts in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a pixel is clicked. See [this sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-popup/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#popupTemplate) */ popupTemplate: PopupTemplate; /** * The raster attribute table associated with the service. To access the raster attribute table, the layer must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) */ rasterAttributeTable: any; /** * Prefix used to define the fields from the raster attribute table. It's primarily used for [popups](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTableFieldPrefix) - * + * * @default Raster. */ rasterAttributeTableFieldPrefix: string; /** * A complete list of fields that consists of fields from the layer, pixel value fields and the attribute table fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterFields) */ rasterFields: Field[]; /** * Specifies the rule for how the requested image should be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#renderingRule) */ renderingRule: RasterFunction; /** * The spatial reference of the image service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#spatialReference) */ readonly spatialReference: SpatialReference; /** * The URL to the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#url) */ url: string; /** * The version of ArcGIS Server in which the image service is published. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#version) */ readonly version: number; /** * Returns an image using the [export REST operation](https://developers.arcgis.com/rest/services-reference/export-image.htm) that displays data from an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fetchImage) - * + * * @param extent The extent of the image to export. * @param width The width of the image in pixels. * @param height The height of the image in pixels. - * + * */ fetchImage(extent: Extent, width: number, height: number): IPromise; } interface ArcGISImageServiceConstructor { - - - new(properties?: ArcGISImageServiceProperties): ArcGISImageService; + new (properties?: ArcGISImageServiceProperties): ArcGISImageService; fromJSON(json: any): ArcGISImageService; } @@ -9885,137 +10231,137 @@ declare namespace __esri { interface ArcGISImageServiceProperties { /** * The compression quality value. This controls how much loss the image will be subjected to. Only valid when using `jpg` [image format](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionQuality) */ compressionQuality?: number; /** * The output image compression tolerance value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionTolerance) - * + * * @default 0.01 */ compressionTolerance?: number; /** * The copyright text as defined by the image service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#copyright) */ copyright?: string; /** * The SQL where clause used to filter rasters on the client. Only the rasters that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#definitionExpression) */ definitionExpression?: string; /** * An array of fields in the layer for which a [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) has been defined. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#domainFields) */ domainFields?: FieldProperties[]; /** * An array of fields in the layer. Each field represents an attribute that may contain a value for each raster in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fields) */ fields?: FieldProperties[]; /** * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Possible Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format) - * + * * @default jpgpng */ format?: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fullExtent) */ fullExtent?: ExtentProperties; /** * Indicates if the Image Service has [multidimensionalInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasMultidimensions) */ hasMultidimensions?: boolean; /** * Indicates if the Image Service has a [raster attribute table](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable). If `true`, the raster attribute table can be accessed with the [rasterAttributeTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) property after the layer has [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasRasterAttributeTable) */ hasRasterAttributeTable?: boolean; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxHeight) - * + * * @default 4100 */ imageMaxHeight?: number; /** * Indicates the maximum width of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxWidth) - * + * * @default 15000 */ imageMaxWidth?: number; /** * Defines how overlapping images should be mosaicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule) */ mosaicRule?: MosaicRuleProperties; /** * The multidimensional information associated with the service. This will have a value if `serviceInfo` has `hasMultidimensionalInfo = true`. If defined, multidimensional information contains various "dimensions" of data for a particular value, such as time, depth, altitude, etc. Defining slices of particular dimensions in the layer is handled with the [multidimensionalDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) property of the [mosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo) */ multidimensionalInfo?: any; /** * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelType) */ pixelType?: string; /** * The popup template for the layer. When set on the layer, the popupTemplate allows users to access attributes and display their values using text and/or charts in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a pixel is clicked. See [this sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-popup/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#popupTemplate) */ popupTemplate?: PopupTemplateProperties; /** * The raster attribute table associated with the service. To access the raster attribute table, the layer must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) */ rasterAttributeTable?: any; /** * Prefix used to define the fields from the raster attribute table. It's primarily used for [popups](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTableFieldPrefix) - * + * * @default Raster. */ rasterAttributeTableFieldPrefix?: string; /** * A complete list of fields that consists of fields from the layer, pixel value fields and the attribute table fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterFields) */ rasterFields?: FieldProperties[]; /** * Specifies the rule for how the requested image should be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#renderingRule) */ renderingRule?: RasterFunctionProperties; /** * The URL to the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#url) */ url?: string; @@ -10024,54 +10370,52 @@ declare namespace __esri { interface ArcGISMapService { /** * Indicates the layer's supported capabilities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ readonly capabilities: ArcGISMapServiceCapabilities; /** * The copyright text as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) */ copyright: string; /** * The full extent of the layer as defined by the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#fullExtent) */ fullExtent: Extent; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The spatial reference of the layer as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#spatialReference) */ readonly spatialReference: SpatialReference; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#token) */ readonly token: string; /** * The version of ArcGIS Server in which the map service is published. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#version) */ readonly version: number; } interface ArcGISMapServiceConstructor { - - - new(properties?: ArcGISMapServiceProperties): ArcGISMapService; + new (properties?: ArcGISMapServiceProperties): ArcGISMapService; fromJSON(json: any): ArcGISMapService; } @@ -10081,109 +10425,105 @@ declare namespace __esri { interface ArcGISMapServiceProperties { /** * The copyright text as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) */ copyright?: string; /** * The full extent of the layer as defined by the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#fullExtent) */ fullExtent?: ExtentProperties; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; } - export interface ArcGISMapServiceCapabilities extends Object { /** * Indicates options supported by the exportMap operation. Will be `null` if the `supportsExportMap` is `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ exportMap: ArcGISMapServiceCapabilitiesExportMap; /** * Indicates options supported by the exportTiles operation. Will be `null` if the `supportsExportTiles` is `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ exportTiles: ArcGISMapServiceCapabilitiesExportTiles; /** * Indicates operations that can be performed on the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ operations: ArcGISMapServiceCapabilitiesOperations; } - export interface ArcGISMapServiceCapabilitiesExportMap extends Object { /** * 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) */ supportsDynamicLayers: boolean; /** * Indicates if sublayers [visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) can be changed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsSublayerVisibility: boolean; /** * Indicates if sublayers [definition expression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) can be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsSublayerDefinitionExpression: boolean; } - export interface ArcGISMapServiceCapabilitiesExportTiles extends Object { /** * Specifies the maximum number of tiles that can be exported to a cache dataset or a tile package. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ maxExportTilesCount: number; } - export interface ArcGISMapServiceCapabilitiesOperations extends Object { /** * Indicates if features in the sublayers can be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#queryFeatures). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsQuery: boolean; /** * Indicates if the service can generate images. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsExportMap: boolean; /** * Indicates if the tiles from the service can be exported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsExportTiles: boolean; /** * Indicates if the service exposes a tile map that describes the presence of tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsTileMap: boolean; @@ -10192,16 +10532,14 @@ declare namespace __esri { interface PortalLayer { /** * The portal item from which the layer is loaded. If the portal item references a Feature Service or Scene Service, then you can specify a single layer to load with the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#layerId) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#portalItem) */ portalItem: PortalItem; } interface PortalLayerConstructor { - - - new(properties?: PortalLayerProperties): PortalLayer; + new (properties?: PortalLayerProperties): PortalLayer; fromJSON(json: any): PortalLayer; } @@ -10211,7 +10549,7 @@ declare namespace __esri { interface PortalLayerProperties { /** * The portal item from which the layer is loaded. If the portal item references a Feature Service or Scene Service, then you can specify a single layer to load with the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#layerId) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#portalItem) */ portalItem?: PortalItemProperties; @@ -10220,27 +10558,25 @@ declare namespace __esri { interface RefreshableLayer { /** * Refresh interval of the layer in minutes. Minimum refresh interval is 0.1 minute (6 seconds). Value of `0` indicates no refresh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refreshInterval) - * + * * @default 0 */ refreshInterval: number; /** * Fetches all the data for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refresh) - * - * + * + * */ refresh(): void; } interface RefreshableLayerConstructor { - - - new(): RefreshableLayer; + new (): RefreshableLayer; } export const RefreshableLayer: RefreshableLayerConstructor; @@ -10248,9 +10584,9 @@ declare namespace __esri { interface RefreshableLayerProperties { /** * Refresh interval of the layer in minutes. Minimum refresh interval is 0.1 minute (6 seconds). Value of `0` indicates no refresh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refreshInterval) - * + * * @default 0 */ refreshInterval?: number; @@ -10259,26 +10595,24 @@ declare namespace __esri { interface ScaleRangeLayer { /** * 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) - * + * * @default 0 */ maxScale: number; /** * 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) - * + * * @default 0 */ minScale: number; } interface ScaleRangeLayerConstructor { - - - new(): ScaleRangeLayer; + new (): ScaleRangeLayer; } export const ScaleRangeLayer: ScaleRangeLayerConstructor; @@ -10286,17 +10620,17 @@ declare namespace __esri { interface ScaleRangeLayerProperties { /** * 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) - * + * * @default 0 */ maxScale?: number; /** * 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) - * + * * @default 0 */ minScale?: number; @@ -10305,51 +10639,49 @@ declare namespace __esri { interface SceneService { /** * The copyright text as defined by the scene service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#copyright) */ copyright: string; /** - * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single SceneLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single layer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property. * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) directly to the Scene Service. - * - * + * + * * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) */ layerId: number; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#spatialReference) */ spatialReference: SpatialReference; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#token) */ readonly token: string; /** * The URL of the REST endpoint of the layer or scene service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. The layer may be specified using the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) property when the url points directly to a service and not a specific layer. If [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) is not specified, then it will default to the first layer in the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) */ url: string; /** * The version of the scene service specification used for this service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) */ readonly version: SceneServiceVersion; } interface SceneServiceConstructor { - - - new(properties?: SceneServiceProperties): SceneService; + new (properties?: SceneServiceProperties): SceneService; fromJSON(json: any): SceneService; } @@ -10359,52 +10691,51 @@ declare namespace __esri { interface SceneServiceProperties { /** * The copyright text as defined by the scene service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#copyright) */ copyright?: string; /** - * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single SceneLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single layer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property. * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) directly to the Scene Service. - * - * + * + * * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) */ layerId?: number; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * The URL of the REST endpoint of the layer or scene service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. The layer may be specified using the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) property when the url points directly to a service and not a specific layer. If [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) is not specified, then it will default to the first layer in the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) */ url?: string; } - export interface SceneServiceVersion extends Object { /** * The major version of the scene layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) */ major: number; /** * The minor version of the scene layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) */ minor: number; /** * The complete version string of the scene layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) */ versionString: string; @@ -10413,93 +10744,215 @@ declare namespace __esri { 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; + new (): SublayersOwner; } export const SublayersOwner: SublayersOwnerConstructor; interface OpenStreetMapLayer extends WebTileLayer { - on(name: "layerview-create", eventHandler: OpenStreetMapLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: OpenStreetMapLayerLayerviewDestroyEventHandler): IHandle; } interface OpenStreetMapLayerConstructor { - - - new(properties?: OpenStreetMapLayerProperties): OpenStreetMapLayer; + new (properties?: OpenStreetMapLayerProperties): OpenStreetMapLayer; } export const OpenStreetMapLayer: OpenStreetMapLayerConstructor; - interface OpenStreetMapLayerProperties extends WebTileLayerProperties { - - } + interface OpenStreetMapLayerProperties extends WebTileLayerProperties {} export interface OpenStreetMapLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface OpenStreetMapLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } + interface PointCloudFilter extends Accessor, JSONSupport { + /** + * The field used for applying the filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html#field) + */ + field: string; + /** + * The type of filter. **Possible values**: value | bitfield | return + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html#type) + */ + readonly type: string; + } + + interface PointCloudFilterConstructor { + /** + * Point cloud filters are used to hide points that do not satisfy the filter criteria. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html) + */ + + new (properties?: PointCloudFilterProperties): PointCloudFilter; + + fromJSON(json: any): PointCloudFilter; + } + + export const PointCloudFilter: PointCloudFilterConstructor; + + interface PointCloudFilterProperties { + /** + * The field used for applying the filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html#field) + */ + field?: string; + } + + interface PointCloudReturnFilter extends PointCloudFilter { + /** + * An array of return types used to filter points. Possible values for the return types are: + * * `firstOfMany`: the point was the first to be collected in a series of many returns + * * `last`: the last point in a series of many returns or a single point + * * `lastOfMany`: the last point in a series of many returns + * * `single`: all the points that were collected from laser pulses with a single return + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html#includedReturns) + */ + includedReturns: string[]; + } + + interface PointCloudReturnFilterConstructor { + /** + * Laser pulses emitted from a lidar system can have several returns depending on the surfaces that they encounter. The return number is stored within each point in the `RETURNS` field. For example, the first return is associated with the highest point in the landscape. In some cases the laser pulse returns only one point representing the ground. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html) + */ + + new (properties?: PointCloudReturnFilterProperties): PointCloudReturnFilter; + + fromJSON(json: any): PointCloudReturnFilter; + } + + export const PointCloudReturnFilter: PointCloudReturnFilterConstructor; + + interface PointCloudReturnFilterProperties extends PointCloudFilterProperties { + /** + * An array of return types used to filter points. Possible values for the return types are: + * * `firstOfMany`: the point was the first to be collected in a series of many returns + * * `last`: the last point in a series of many returns or a single point + * * `lastOfMany`: the last point in a series of many returns + * * `single`: all the points that were collected from laser pulses with a single return + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html#includedReturns) + */ + includedReturns?: string[]; + } + + interface PointCloudValueFilter extends PointCloudFilter { + /** + * Whether points should be included or excluded from the filter. **Possible values:** include | exclude + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#mode) + * + * @default "exclude" + */ + mode: string; + /** + * An array of numeric values representing the classification codes that the filter should apply. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#values) + */ + values: number[]; + } + + interface PointCloudValueFilterConstructor { + /** + * Every lidar point can have a classification that defines the type of surface that reflected the laser pulse. The different categories (for example building, high vegetation, ground) are defined using numeric integer codes in the LAS files. The full list of categories including the corresponding codes can be found in the LAS specification. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html) + */ + + new (properties?: PointCloudValueFilterProperties): PointCloudValueFilter; + + fromJSON(json: any): PointCloudValueFilter; + } + + export const PointCloudValueFilter: PointCloudValueFilterConstructor; + + interface PointCloudValueFilterProperties extends PointCloudFilterProperties { + /** + * Whether points should be included or excluded from the filter. **Possible values:** include | exclude + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#mode) + * + * @default "exclude" + */ + mode?: string; + /** + * An array of numeric values representing the classification codes that the filter should apply. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#values) + */ + values?: number[]; + } + interface PointCloudLayer extends Layer, SceneService, PortalLayer { /** * Specifies how points are placed on the vertical axis (z). This property only affects [PointCloudLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) when using the `absolute-height` mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) */ elevationInfo: PointCloudLayerElevationInfo; /** * An array of fields accessible in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#fields) */ fields: Field[]; + /** + * An array of [pointCloudFilters](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html) used to filter points. Only the points that satisfy all the filters are displayed in the view. There are two types of filters that can be set: [PointCloudValueFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html) filters points based on classification values and [PointCloudReturnFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html) filters points based on return values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#filters) + */ + filters: PointCloudFilter[]; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The renderer assigned to the layer. The renderer defines how to visualize each point in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#renderer) */ renderer: PointCloudRenderer; - on(name: "layerview-create", eventHandler: PointCloudLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: PointCloudLayerLayerviewDestroyEventHandler): IHandle; @@ -10508,11 +10961,11 @@ declare namespace __esri { interface PointCloudLayerConstructor { /** * The PointCloudLayer is designed for visualizing large collections of points in a [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-PointCloudLayer.html) */ - new(properties?: PointCloudLayerProperties): PointCloudLayer; + new (properties?: PointCloudLayerProperties): PointCloudLayer; fromJSON(json: any): PointCloudLayer; } @@ -10522,72 +10975,75 @@ declare namespace __esri { interface PointCloudLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { /** * Specifies how points are placed on the vertical axis (z). This property only affects [PointCloudLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) when using the `absolute-height` mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) */ elevationInfo?: PointCloudLayerElevationInfo; /** * An array of fields accessible in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#fields) */ fields?: FieldProperties[]; + /** + * An array of [pointCloudFilters](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html) used to filter points. Only the points that satisfy all the filters are displayed in the view. There are two types of filters that can be set: [PointCloudValueFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html) filters points based on classification values and [PointCloudReturnFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html) filters points based on return values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#filters) + */ + filters?: PointCloudFilterProperties[]; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The renderer assigned to the layer. The renderer defines how to visualize each point in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#renderer) */ renderer?: PointCloudRendererProperties; } export interface PointCloudLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface PointCloudLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface PointCloudLayerElevationInfo extends Object { /** - * Defines how the points are placed on the vertical axis (z). Currently only `absolute-height` mode is supported. - * + * Defines how the points are placed on the vertical axis (z). Currently only `absolute-height` mode is supported. + * * Mode | Description * ------|------------ - * absolute-height | Points are placed at an absolute height above sea level. This height is determined by summing up the `offset` value and the point's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). - * - * + * absolute-height | Points are placed at an absolute elevation (z-value) above sea level. This z-value is determined by summing up the `offset` value and the point's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) */ mode: string; /** * An elevation offset, which is added to the vertical position of each point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) - * + * * @default 0 */ offset?: number; /** * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) - * + * * @default meters */ unit?: string; @@ -10596,157 +11052,156 @@ declare namespace __esri { interface SceneLayer extends Layer, SceneService, PortalLayer { /** * 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 only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. 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. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#definitionExpression) */ definitionExpression: string; /** * Specifies how graphics are placed on the vertical axis (z). 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. This property only affects 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) when using the `absolute-height` mode. [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries support all the elevation modes listed below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) */ 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/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) */ featureReduction: SceneLayerFeatureReduction; /** * An array of fields accessible in the layer. Depending on the scene service, fields may have limited support for certain capabilities. Use [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) to query the contexts (rendering, labeling, popups or querying) for which a particular field may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) */ fields: Field[]; /** * The geometry type of features in the layer. **Possible Values:** point | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) */ geometryType: string; /** - * 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. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. + * 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. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. * > **Known Limitations** This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. Each point can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** * 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-SceneLayer.html#labelingInfo) property. This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The name of the field containing each graphic's Object ID. If this is not explicitly specified, this is automatically derived from the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) of the service by taking the first field of type `oid`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#objectIdField) */ objectIdField: string; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * The popup template for the layer. When set on the layer, 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 a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer) */ 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/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) + * 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) - * + * * @default true */ screenSizePerspectiveEnabled: boolean; /** * Creates a query object that can be used to fetch features that satisfy the layer's current definition expression. The query should only be used on the layer and not on the layer view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#createQuery) - * - * + * + * */ createQuery(): Query; /** - * Gets field usage information. The usage of a field depends on whether it is stored as part of the scene service cache. The returned object contains the following usage information: - * + * Gets field usage information. The usage of a field depends on whether it is stored as part of the scene service cache. The returned object contains the following usage information: + * * Property | Type | Description * ----------------------|---------|------------ * supportsRenderer | boolean | Indicates that a field can be used in a renderer (e.g. in visual variables), [see renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer). * supportsLabelingInfo | boolean | Indicates that a field can be used for labeling, [see labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo). * supportsPopupTemplate | boolean | Indicates that a field can be used in a popup template, [see popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate). * supportsLayerQuery | boolean | Indicates that a field can be used in layer queries, [see queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) - * + * * @param fieldName The name of the field to get usage info for. - * + * */ getFieldUsageInfo(fieldName: string): any; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns the 2D [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. At the moment the 3D Extent can be returned by using [SceneLayerView.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryExtent), but this will return the 3D extent only for features currently in the view. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryExtent) - * + * * @param params Specifies the query parameters. - * + * */ queryExtent(params?: Query): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns the number of the features that satisfy the query. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatureCount) - * + * * @param params Specifies the query parameters. - * + * */ queryFeatureCount(params?: Query): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures) - * + * * @param params Specifies the query parameters. - * + * */ queryFeatures(params?: Query): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns an array of the ObjectIDs of features that satisfy the input query. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryObjectIds) - * + * * @param params Specifies the query parameters. - * + * */ queryObjectIds(params?: Query): IPromise; - on(name: "layerview-create", eventHandler: SceneLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: SceneLayerLayerviewDestroyEventHandler): IHandle; @@ -10755,11 +11210,11 @@ declare namespace __esri { interface SceneLayerConstructor { /** * The SceneLayer is a layer type designed for on-demand streaming and displaying large amounts of data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). SceneLayers support two geometry types: [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and 3D Objects (e.g. Buildings). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) */ - new(properties?: SceneLayerProperties): SceneLayer; + new (properties?: SceneLayerProperties): SceneLayer; fromJSON(json: any): SceneLayer; } @@ -10769,148 +11224,144 @@ declare namespace __esri { interface SceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { /** * 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 only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. 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. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#definitionExpression) */ definitionExpression?: string; /** * Specifies how graphics are placed on the vertical axis (z). 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. This property only affects 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) when using the `absolute-height` mode. [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries support all the elevation modes listed below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) */ 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/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) */ featureReduction?: SceneLayerFeatureReduction; /** * An array of fields accessible in the layer. Depending on the scene service, fields may have limited support for certain capabilities. Use [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) to query the contexts (rendering, labeling, popups or querying) for which a particular field may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) */ fields?: FieldProperties[]; /** * The geometry type of features in the layer. **Possible Values:** point | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) */ geometryType?: string; /** - * 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. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. + * 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. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. * > **Known Limitations** This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. Each point can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** * 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-SceneLayer.html#labelingInfo) property. This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The name of the field containing each graphic's Object ID. If this is not explicitly specified, this is automatically derived from the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) of the service by taking the first field of type `oid`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#objectIdField) */ objectIdField?: string; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * The popup template for the layer. When set on the layer, 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 a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer) */ 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/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) + * 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) - * + * * @default true */ screenSizePerspectiveEnabled?: boolean; } export interface SceneLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface SceneLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface SceneLayerElevationInfo extends Object { /** - * Defines how the graphic is placed with respect to the terrain surface. See the table below for a list of possible values. - * + * Defines how the graphic is placed with respect to the terrain surface. 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 [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 | The graphic is placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing up the terrain elevation, the `offset` value and the geometry's z-value (if present). This 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 summing up the `offset` value and the geometry's z-value (if present). It doesn't take the elevation of the terrain into account. This is the default value for features with 3D Object geometries and [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#hasZ) is `true`. + * absolute-height | Graphics are placed at an absolute elevation (z-value) above sea level. This z-value is determined by summing up the `offset` value and the geometry's z-value (if present). It doesn't take the elevation of the terrain into account. This is the default value for features with 3D Object geometries and [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#hasZ) is `true`. * relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayer](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 present, z-values will be ignored. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) */ mode: string; /** * An elevation offset which is added to the vertical position of the graphic. When `mode = "on-the-ground"`, this property has no effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) - * + * * @default 0 */ offset?: number; /** * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) - * + * * @default meters */ unit?: string; } - export interface SceneLayerFeatureReduction extends Object { /** * Type of the decluttering method. The only supported type at the moment is `"selection"`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) */ type: string; @@ -10919,42 +11370,41 @@ declare namespace __esri { interface StreamLayer extends FeatureLayer { /** * Contains the attribute and spatial filters used to filter messages sent to the client by a Stream Service. This property can be set in the constructor but is `read-only` after the layer is created. To change the filter after the layer is created, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) */ readonly filter: StreamLayerFilter; /** * An extent object used to filter features. Only features intersecting the extent are displayed in the view. Instead of using this property, use [StreamLayer.filter.geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) when creating the service or [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) when changing the spatial filter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#geometryDefinition) */ geometryDefinition: Extent; /** * 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) */ maximumTrackPoints: number; /** * Options for purging stale features. Use these options to avoid overloading the browser with graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) */ 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 will be removed automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) - * + * * @param filterChanges Updates the spatial and attribute [filters](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) on the layer and all of its associated views. If `null`, all filters are cleared. * @param filterChanges.geometry A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view(s). If `null`, the spatial filter is cleared. * @param filterChanges.where A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. - * + * */ updateFilter(filterChanges: StreamLayerUpdateFilterFilterChanges): IPromise; - on(name: "layerview-create", eventHandler: StreamLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: StreamLayerLayerviewDestroyEventHandler): IHandle; @@ -10963,11 +11413,11 @@ declare namespace __esri { interface StreamLayerConstructor { /** * The stream layer extends the feature layer to add the ability to connect to a stream of data using HTML5 WebSockets. It connects to a server that emits geographic features continuously. While the feature layer is used to map relatively static data, the stream layer is suitable when you would like to map dynamic streams of data that are unbounded and continuous. When a stream layer is added to a map, users are able to see real-time updates pushed out by the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) */ - new(properties?: StreamLayerProperties): StreamLayer; + new (properties?: StreamLayerProperties): StreamLayer; fromJSON(json: any): StreamLayer; } @@ -10977,121 +11427,227 @@ declare namespace __esri { interface StreamLayerProperties extends FeatureLayerProperties { /** * Contains the attribute and spatial filters used to filter messages sent to the client by a Stream Service. This property can be set in the constructor but is `read-only` after the layer is created. To change the filter after the layer is created, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) */ filter?: StreamLayerFilter; /** * An extent object used to filter features. Only features intersecting the extent are displayed in the view. Instead of using this property, use [StreamLayer.filter.geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) when creating the service or [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) when changing the spatial filter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#geometryDefinition) */ geometryDefinition?: ExtentProperties; /** * 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) */ maximumTrackPoints?: number; /** * Options for purging stale features. Use these options to avoid overloading the browser with graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) */ purgeOptions?: StreamLayerPurgeOptions; } export interface StreamLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface StreamLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface StreamLayerFilter extends Object { /** * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) */ geometry?: Extent; /** * A SQL where clause used to filter features by attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) */ where?: string; } - export interface StreamLayerPurgeOptions extends Object { /** * The maximum number of features to display. Excess features are purged from the beginning of the graphics array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) */ displayCount: number; /** * The maximum time in minutes that a feature should be kept. After this time, the feature is removed from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) */ age: number; } - export interface StreamLayerUpdateFilterFilterChanges extends Object { /** * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view(s). If `null`, the spatial filter is cleared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) */ geometry: Extent; /** * A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) */ where: string; } + interface AttachmentInfo extends Accessor, JSONSupport { + /** + * 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-layers-support-AttachmentInfo.html#contentType) + */ + contentType: string; + /** + * The identifier for the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#id) + */ + id: number; + /** + * Keywords used for the attachments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#keywords) + */ + keywords: string; + /** + * String value indicating the name of the file attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#name) + */ + name: string; + /** + * The parent or the feature object id of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#parentObjectId) + */ + parentObjectId: number; + /** + * The file size of the attachment. This is specified in bytes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#size) + */ + size: number; + /** + * The URL of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#url) + */ + url: string; + + /** + * Creates a deep clone of the AttachmentInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#clone) + * + * + */ + clone(): AttachmentInfo; + } + + interface AttachmentInfoConstructor { + /** + * The AttachmentInfo class returns information about attachments associated with a feature. The contents of the attachment are streamed to the client. Attachments are available if the [FeatureLayer's capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html) + */ + + new (properties?: AttachmentInfoProperties): AttachmentInfo; + + fromJSON(json: any): AttachmentInfo; + } + + export const AttachmentInfo: AttachmentInfoConstructor; + + interface AttachmentInfoProperties { + /** + * 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-layers-support-AttachmentInfo.html#contentType) + */ + contentType?: string; + /** + * The identifier for the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#id) + */ + id?: number; + /** + * Keywords used for the attachments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#keywords) + */ + keywords?: string; + /** + * String value indicating the name of the file attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#name) + */ + name?: string; + /** + * The parent or the feature object id of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#parentObjectId) + */ + parentObjectId?: number; + /** + * The file size of the attachment. This is specified in bytes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#size) + */ + size?: number; + /** + * The URL of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#url) + */ + url?: string; + } + interface CodedValueDomain extends Domain { /** * An array of the coded values in the domain. See the object specification table below for the properties each item in the array should contain. - * + * * [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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#getName) - * + * * @param code The code associated with the desired name. - * + * */ getName(code: string | number): string; } interface CodedValueDomainConstructor { - - - new(properties?: CodedValueDomainProperties): CodedValueDomain; + new (properties?: CodedValueDomainProperties): CodedValueDomain; fromJSON(json: any): CodedValueDomain; } @@ -11101,98 +11657,125 @@ declare namespace __esri { interface CodedValueDomainProperties extends DomainProperties { /** * An array of the coded values in the domain. See the object specification table below for the properties each item in the array should contain. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) */ codedValues?: CodedValueDomainCodedValues[]; } - export interface CodedValueDomainCodedValues extends Object { /** * The name of the coded value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) */ name: string; /** * The value of the code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) */ code: string | number; } - interface DimensionalDefinition { + interface DimensionalDefinition extends Accessor, JSONSupport { /** * The dimension associated with the variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#dimensionName) */ dimensionName: string; /** * Indicates whether the values indicate slices (rather than ranges). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#isSlice) - * + * * @default false */ isSlice: boolean; /** * An array of tuples [min, max] each defining a range of valid values along the specified dimension. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#values) */ values: any[]; /** - * The variable name by which to filter. - * + * The required variable name by which to filter. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#variableName) */ variableName: string; /** - * Returns a serialized JSON object representation of the dimensional definition in the format of the ArcGIS Platform. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#toJSON) - * - * + * Creates a clone of the DimensionalDefinition object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#clone) + * + * */ - toJSON(): any; + clone(): DimensionalDefinition; } interface DimensionalDefinitionConstructor { /** * A dimensional definition defines a filter based on one variable and one dimension. You can filter with one or multiple dimensional slices. Instances of this class are typically used when filtering data based on [slices](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#isSlice) or ranges in one or more dimensions with [MosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html) */ + new (properties?: DimensionalDefinitionProperties): DimensionalDefinition; - new(properties?: any): DimensionalDefinition; + fromJSON(json: any): DimensionalDefinition; } export const DimensionalDefinition: DimensionalDefinitionConstructor; + interface DimensionalDefinitionProperties { + /** + * The dimension associated with the variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#dimensionName) + */ + dimensionName?: string; + /** + * Indicates whether the values indicate slices (rather than ranges). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#isSlice) + * + * @default false + */ + isSlice?: boolean; + /** + * An array of tuples [min, max] each defining a range of valid values along the specified dimension. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#values) + */ + values?: any[]; + /** + * The required variable name by which to filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#variableName) + */ + variableName?: string; + } + interface Domain extends Accessor, JSONSupport { /** * The domain name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#name) */ name: string; /** * The domain type. **Possible Values:** range | coded-value | inherited - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#type) */ type: string; } interface DomainConstructor { - - - new(properties?: DomainProperties): Domain; + new (properties?: DomainProperties): Domain; fromJSON(json: any): Domain; } @@ -11202,13 +11785,13 @@ declare namespace __esri { interface DomainProperties { /** * The domain name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#name) */ name?: string; /** * The domain type. **Possible Values:** range | coded-value | inherited - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#type) */ type?: string; @@ -11217,80 +11800,76 @@ declare namespace __esri { interface ElevationSampler { /** * Registers an event handler on the instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html#events-summary) for a list of listened events. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html#on) - * + * * @param type The name of the event or the events to listen for. * @param handler? The function to call when the event is fired, if modifiers were specified. - * + * */ on(type: string | string[], handler?: Function): any; /** * Query elevation for a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometry. A query will return a new geometry for which the z-values for each coordinate in the geometry are obtained from the elevation sampler. If the geometry used for the query is outside of the elevation sampler extent, then the returned geometry has `0` as z-values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html#queryElevation) - * + * * @param geometry The geometry to use for sampling elevation data. - * + * */ queryElevation(geometry: Point | Multipoint | Polyline): Point | Multipoint | Polyline; - on(name: "changed", eventHandler: ElevationSamplerChangedEventHandler): IHandle; } interface ElevationSamplerConstructor { /** * A cache of elevation values created from an elevation service or the [GroundView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-GroundView.html) used for synchronously querying elevation information for geometries. This class does not have a constructor. You can create an instance of this class by using [ElevationLayer.createElevationSampler()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler) or [Ground.createElevationSampler()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#createElevationSampler) methods. The elevation sampler created from the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) will sample data from the first elevation layer that has data available. To control the layer used for elevation sampling and the sampling resolution, use [ElevationLayer.createElevationSampler()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html) */ - new(): ElevationSampler; + new (): ElevationSampler; } export const ElevationSampler: ElevationSamplerConstructor; - export interface ElevationSamplerChangedEvent { - } + export interface ElevationSamplerChangedEvent {} interface FeatureTemplate extends Accessor, JSONSupport { /** * Description of the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description) */ description: string; /** * Name of the default drawing tool defined for the template to create a feature. **Possible Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#drawingTool) */ drawingTool: string; /** * Name of the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name) */ name: string; /** * An instance of the prototypical feature described by the [feature template](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html). It specifies default values for the attribute fields and does not contain geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#prototype) */ prototype: any; /** * An object used to create a thumbnail image that represents a feature type in the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ thumbnail: FeatureTemplateThumbnail; } interface FeatureTemplateConstructor { - - - new(properties?: FeatureTemplateProperties): FeatureTemplate; + new (properties?: FeatureTemplateProperties): FeatureTemplate; fromJSON(json: any): FeatureTemplate; } @@ -11300,59 +11879,58 @@ declare namespace __esri { interface FeatureTemplateProperties { /** * Description of the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description) */ description?: string; /** * Name of the default drawing tool defined for the template to create a feature. **Possible Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#drawingTool) */ drawingTool?: string; /** * Name of the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name) */ name?: string; /** * An instance of the prototypical feature described by the [feature template](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html). It specifies default values for the attribute fields and does not contain geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#prototype) */ prototype?: any; /** * An object used to create a thumbnail image that represents a feature type in the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ thumbnail?: FeatureTemplateThumbnail; } - export interface FeatureTemplateThumbnail extends Object { /** * The MIME type of the image. **Possible Values:** image | png | jpg | jpeg - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ contentType: any; /** * The [base64EncodedImageData](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding) presenting the thumbnail image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ imageData: string; /** * The height of the thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ height: number; /** * The width of the thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ width: number; @@ -11361,34 +11939,32 @@ declare namespace __esri { interface FeatureType extends Accessor, JSONSupport { /** * Domains associated with the feature type. It is an object where the name of each property corresponds with the name of a field containing a domain. If a field's domain is an instance of [InheritedDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-InheritedDomain.html), the application will use the domain defined for the field from the layer. If the domain is an instance of [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) then the domain is defined specifically for the given feature type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#domains) */ domains: any; /** * The feature type identifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#id) */ id: number | string; /** * The feature type name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#name) */ name: string; /** * Array of [feature templates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) associated with the feature type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#templates) */ templates: FeatureTemplate[]; } interface FeatureTypeConstructor { - - - new(properties?: FeatureTypeProperties): FeatureType; + new (properties?: FeatureTypeProperties): FeatureType; fromJSON(json: any): FeatureType; } @@ -11398,25 +11974,25 @@ declare namespace __esri { interface FeatureTypeProperties { /** * Domains associated with the feature type. It is an object where the name of each property corresponds with the name of a field containing a domain. If a field's domain is an instance of [InheritedDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-InheritedDomain.html), the application will use the domain defined for the field from the layer. If the domain is an instance of [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) then the domain is defined specifically for the given feature type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#domains) */ domains?: any; /** * The feature type identifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#id) */ id?: number | string; /** * The feature type name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#name) */ name?: string; /** * Array of [feature templates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) associated with the feature type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#templates) */ templates?: FeatureTemplateProperties[]; @@ -11425,74 +12001,86 @@ declare namespace __esri { interface Field extends Accessor, JSONSupport { /** * 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; + type: + | "small-integer" + | "integer" + | "single" + | "double" + | "long" + | "string" + | "date" + | "oid" + | "geometry" + | "blob" + | "raster" + | "guid" + | "global-id" + | "xml"; } interface FieldConstructor { - - - new(properties?: FieldProperties): Field; + new (properties?: FieldProperties): Field; fromJSON(json: any): Field; } @@ -11502,152 +12090,164 @@ declare namespace __esri { interface FieldProperties { /** * 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; + type?: + | "small-integer" + | "integer" + | "single" + | "double" + | "long" + | "string" + | "date" + | "oid" + | "geometry" + | "blob" + | "raster" + | "guid" + | "global-id" + | "xml"; } interface ImageParameters extends Accessor { /** * Dots per inch setting for an module:esri/layersMapImageLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#dpi) - * + * * @default 96 */ dpi: number; /** * Extent of map to be exported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#extent) */ extent: Extent; /** * Map image format. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#format) - * + * * @default png8 */ format: string; /** * Requested image height in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#height) */ height: number; /** * Spatial reference of exported map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#imageSpatialReference) */ imageSpatialReference: SpatialReference; /** * Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. Layer definitions with semicolons or colons are supported if using a map service published using ArcGIS Server 10 or later. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerDefinitions) */ layerDefinitions: string[]; /** * A list of layer IDs, that represent which layers to include in the exported map. Use in combination with [layerOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) to specify how layer visibility is handled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerIds) */ layerIds: number[]; /** * The option for displaying or hiding the layer. **Possible Values:** show | hide | include | exclude - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) */ layerOption: string; /** * Indicates whether or not the background of the dynamic image is transparent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#transparent) - * + * * @default true */ transparent: boolean; /** * Requested image width in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#width) */ width: number; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface ImageParametersConstructor { - - - new(properties?: ImageParametersProperties): ImageParameters; + new (properties?: ImageParametersProperties): ImageParameters; } export const ImageParameters: ImageParametersConstructor; @@ -11655,67 +12255,67 @@ declare namespace __esri { interface ImageParametersProperties { /** * Dots per inch setting for an module:esri/layersMapImageLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#dpi) - * + * * @default 96 */ dpi?: number; /** * Extent of map to be exported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#extent) */ extent?: ExtentProperties; /** * Map image format. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#format) - * + * * @default png8 */ format?: string; /** * Requested image height in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#height) */ height?: number; /** * Spatial reference of exported map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#imageSpatialReference) */ imageSpatialReference?: SpatialReferenceProperties; /** * Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. Layer definitions with semicolons or colons are supported if using a map service published using ArcGIS Server 10 or later. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerDefinitions) */ layerDefinitions?: string[]; /** * A list of layer IDs, that represent which layers to include in the exported map. Use in combination with [layerOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) to specify how layer visibility is handled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerIds) */ layerIds?: number[]; /** * The option for displaying or hiding the layer. **Possible Values:** show | hide | include | exclude - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) */ layerOption?: string; /** * Indicates whether or not the background of the dynamic image is transparent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#transparent) - * + * * @default true */ transparent?: boolean; /** * Requested image width in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#width) */ width?: number; @@ -11724,75 +12324,69 @@ 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 { - - - new(properties?: InheritedDomainProperties): InheritedDomain; + new (properties?: InheritedDomainProperties): InheritedDomain; fromJSON(json: any): InheritedDomain; } export const InheritedDomain: InheritedDomainConstructor; - interface InheritedDomainProperties extends DomainProperties { - - } + interface InheritedDomainProperties extends DomainProperties {} interface KMLSublayer extends Accessor, JSONSupport { /** * Description for the KML sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#description) */ description: string; /** * The id for the KML sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#id) */ id: number; /** * The [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#layer) */ layer: KMLLayer; /** * Network link info for the current layer. A link info object with properties that describe the network link. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#networkLink) */ networkLink: any; /** * A collection of [KMLSublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#sublayers) */ sublayers: Collection; /** * The title of the KML sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#title) */ title: string; /** * Indicates if the sublayer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#visible) */ visible: boolean; } interface KMLSublayerConstructor { - - - new(properties?: KMLSublayerProperties): KMLSublayer; + new (properties?: KMLSublayerProperties): KMLSublayer; fromJSON(json: any): KMLSublayer; } @@ -11802,43 +12396,43 @@ declare namespace __esri { interface KMLSublayerProperties { /** * Description for the KML sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#description) */ description?: string; /** * The id for the KML sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#id) */ id?: number; /** * The [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#layer) */ layer?: KMLLayerProperties; /** * Network link info for the current layer. A link info object with properties that describe the network link. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#networkLink) */ networkLink?: any; /** * A collection of [KMLSublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The title of the KML sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#title) */ title?: string; /** * Indicates if the sublayer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#visible) */ visible?: boolean; @@ -11847,70 +12441,70 @@ declare namespace __esri { interface LabelClass extends Accessor, JSONSupport { /** * Defines the content of label text for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). If working with [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), use [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) instead. Attribute values may be included in labels using SQL syntax. To include an attribute value in a label, wrap the name of the field in square brackets `[]`. See the example snippet below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) */ labelExpression: string; /** * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ labelExpressionInfo: LabelClassLabelExpressionInfo; /** - * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal - * > **Known Limitations** + * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal + * > **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. - * + * * [Polylines](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) only support `center-along` label placement in 2D MapViews. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) - * + * * @default null */ labelPlacement: string; /** * 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) - * + * * @default 0 */ maxScale: number; /** * 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) - * + * * @default 0 */ minScale: number; /** * Defines the symbol used for rendering the label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#symbol) */ symbol: TextSymbol | LabelSymbol3D; /** * Indicates whether to use domain names if the fields in the [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) or [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) have domains. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#useCodedValues) */ useCodedValues: boolean; /** - * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. - * > **Known Limitations** Only very basic SQL is currently supported. - * + * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * > **Known Limitations** Only very basic SQL is currently supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) */ where: string; /** * Creates a deep clone of the LabelClass. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#clone) - * - * + * + * */ clone(): LabelClass; } @@ -11918,11 +12512,11 @@ declare namespace __esri { interface LabelClassConstructor { /** * Defines label expressions, symbols, scale ranges, label priorities, and label placement options for labels on a layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) */ - new(properties?: LabelClassProperties): LabelClass; + new (properties?: LabelClassProperties): LabelClass; fromJSON(json: any): LabelClass; } @@ -11932,76 +12526,75 @@ declare namespace __esri { interface LabelClassProperties { /** * Defines the content of label text for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). If working with [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), use [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) instead. Attribute values may be included in labels using SQL syntax. To include an attribute value in a label, wrap the name of the field in square brackets `[]`. See the example snippet below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) */ labelExpression?: string; /** * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ labelExpressionInfo?: LabelClassLabelExpressionInfo; /** - * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal - * > **Known Limitations** + * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal + * > **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. - * + * * [Polylines](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) only support `center-along` label placement in 2D MapViews. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) - * + * * @default null */ labelPlacement?: string; /** * 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) - * + * * @default 0 */ maxScale?: number; /** * 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) - * + * * @default 0 */ minScale?: number; /** * Defines the symbol used for rendering the label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#symbol) */ symbol?: TextSymbolProperties | LabelSymbol3DProperties; /** * Indicates whether to use domain names if the fields in the [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) or [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) have domains. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#useCodedValues) */ useCodedValues?: boolean; /** - * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. - * > **Known Limitations** Only very basic SQL is currently supported. - * + * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * > **Known Limitations** Only very basic SQL is currently supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) */ where?: string; } - export interface LabelClassLabelExpressionInfo extends Object { /** * The SQL expression defining the content of the label text. **Deprecated as of v4.5. Use `expression` instead.** - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ value?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that evaluates to a string used to label features in the layer. The most simple expressions return field values. For example, to label a layer of cities with their names, simply reference the field value with the global variable: `$feature.CITY_NAME`. Expressions can be more sophisticated and use logical functions. This may be useful if you want to use classed labels. For example, the following expression appends `city` to the end of the label if the feature's population field contains a number greater than 10,000. Otherwise, `town` is appended to the end of the label. Additionally, you can use `TextFormatting.NewLine` to add a new line to the label. `IIF($feature.POPULATION > 10000, $feature.NAME + ' city', $feature.NAME + ' town')` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ expression: string; @@ -12010,34 +12603,32 @@ declare namespace __esri { interface LOD extends Accessor, JSONSupport { /** * ID for each level. The top most level is `0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#level) */ level: number; /** * String to be used when constructing a URL to access a tile from this LOD. If `levelValue` is not defined, level will be used for the tile access URL. This property is useful when an LOD object represents a WMTS TileMatrix with non-numeric matrix identifiers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#levelValue) */ levelValue: string; /** * Resolution in map units of each pixel in a tile for each level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#resolution) */ resolution: number; /** * Scale for each level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#scale) */ scale: number; } interface LODConstructor { - - - new(properties?: LODProperties): LOD; + new (properties?: LODProperties): LOD; fromJSON(json: any): LOD; } @@ -12047,25 +12638,25 @@ declare namespace __esri { interface LODProperties { /** * ID for each level. The top most level is `0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#level) */ level?: number; /** * String to be used when constructing a URL to access a tile from this LOD. If `levelValue` is not defined, level will be used for the tile access URL. This property is useful when an LOD object represents a WMTS TileMatrix with non-numeric matrix identifiers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#levelValue) */ levelValue?: string; /** * Resolution in map units of each pixel in a tile for each level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#resolution) */ resolution?: number; /** * Scale for each level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#scale) */ scale?: number; @@ -12074,56 +12665,54 @@ declare namespace __esri { interface MapImage extends Accessor, JSONSupport { /** * The extent of the exported map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#extent) */ extent: Extent; /** * The requested image height in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#height) */ height: number; /** * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Possible Values:** gif | jpg | png | bmp - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#href) */ href: string; /** * The opacity of the image. Value can be any number between `0` and `1` where `0` is 100% transparent, `0.5` is 50% transparent and `1` is fully opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#opacity) - * + * * @default 1 */ opacity: number; /** * Scale of the requested dynamic map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#scale) */ scale: number; /** * Indicates if the requested image is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#visible) - * + * * @default true */ visible: boolean; /** * The requested image width in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#width) */ width: number; } interface MapImageConstructor { - - - new(properties?: MapImageProperties): MapImage; + new (properties?: MapImageProperties): MapImage; fromJSON(json: any): MapImage; } @@ -12133,47 +12722,47 @@ declare namespace __esri { interface MapImageProperties { /** * The extent of the exported map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#extent) */ extent?: ExtentProperties; /** * The requested image height in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#height) */ height?: number; /** * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Possible Values:** gif | jpg | png | bmp - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#href) */ href?: string; /** * The opacity of the image. Value can be any number between `0` and `1` where `0` is 100% transparent, `0.5` is 50% transparent and `1` is fully opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#opacity) - * + * * @default 1 */ opacity?: number; /** * Scale of the requested dynamic map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#scale) */ scale?: number; /** * Indicates if the requested image is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#visible) - * + * * @default true */ visible?: boolean; /** * The requested image width in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#width) */ width?: number; @@ -12182,76 +12771,85 @@ declare namespace __esri { interface MosaicRule extends Accessor, JSONSupport { /** * Indicates whether the sort should be ascending. This property applies to all mosaic [methods](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) where an ordering is defined except `seamline`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#ascending) - * + * * @default true */ ascending: boolean; /** * An array of raster Ids. All the rasters with the given list of raster Ids are selected to participate in the mosaic. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel size range of the locked rasters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#lockRasterIds) */ lockRasterIds: number[]; /** * The mosaic method determines how the selected rasters are ordered. **Possible Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) */ - method: string; + method: "none" | "center" | "nadir" | "viewpoint" | "attribute" | "lock-raster" | "northwest" | "seamline"; /** * A multiple dimensional service can have multiple dimensions for one or more variables. Use multiDimensionalDefinitions to filter data based on a slice or range of data. For example, a single ImageryLayer may have a `depth` dimension storing sea temperatures for the same pixel location at various depths. Another dimension could be `time`, where the same pixel stores multiple values based on a window of time. This property can be used to filter and display ImageryLayer pixels for specific "slices" in those dimensions (e.g. display sea temperature at 1000m below sea level for a specific week in the year). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) */ multidimensionalDefinition: DimensionalDefinition[]; /** * Defines a selection using a set of ObjectIDs. This property applies to all mosaic methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#objectIds) */ objectIds: number[]; /** * Defines the mosaic operation used to resolve overlapping pixels. **Possible Values:** first | last | min | max | mean | blend - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#operation) */ - operation: string; + operation: "first" | "last" | "min" | "max" | "mean" | "blend"; /** * The name of the attribute field that is used with a constant sortValue to define the mosaicking order when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. The ordering is defined by the absolute value of the difference between the specified sort field value and the sort base value. For example, if the sort field is `Month` and the sort value is `7 (July)`, then the ordering is defined by `ABS(Month -7)`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortField) */ sortField: string; /** * A constant value defining a reference or base value for the sort field when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortValue) */ sortValue: string; /** * Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#viewpoint) */ viewpoint: Point; /** * The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#where) */ where: string; + + /** + * Creates a clone of the MosaicRule object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#clone) + * + * + */ + clone(): MosaicRule; } interface MosaicRuleConstructor { /** * Specifies the mosaic rule when defining how individual images should be mosaicked. It specifies selection, mosaic method, sort order, overlapping pixel resolution, etc. Mosaic rules are for mosaicking rasters in the mosaic dataset. A mosaic rule is used to define: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html) */ - new(properties?: MosaicRuleProperties): MosaicRule; + new (properties?: MosaicRuleProperties): MosaicRule; fromJSON(json: any): MosaicRule; } @@ -12261,63 +12859,63 @@ declare namespace __esri { interface MosaicRuleProperties { /** * Indicates whether the sort should be ascending. This property applies to all mosaic [methods](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) where an ordering is defined except `seamline`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#ascending) - * + * * @default true */ ascending?: boolean; /** * An array of raster Ids. All the rasters with the given list of raster Ids are selected to participate in the mosaic. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel size range of the locked rasters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#lockRasterIds) */ lockRasterIds?: number[]; /** * The mosaic method determines how the selected rasters are ordered. **Possible Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) */ - method?: string; + method?: "none" | "center" | "nadir" | "viewpoint" | "attribute" | "lock-raster" | "northwest" | "seamline"; /** * A multiple dimensional service can have multiple dimensions for one or more variables. Use multiDimensionalDefinitions to filter data based on a slice or range of data. For example, a single ImageryLayer may have a `depth` dimension storing sea temperatures for the same pixel location at various depths. Another dimension could be `time`, where the same pixel stores multiple values based on a window of time. This property can be used to filter and display ImageryLayer pixels for specific "slices" in those dimensions (e.g. display sea temperature at 1000m below sea level for a specific week in the year). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) */ - multidimensionalDefinition?: DimensionalDefinition[]; + multidimensionalDefinition?: DimensionalDefinitionProperties[]; /** * Defines a selection using a set of ObjectIDs. This property applies to all mosaic methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#objectIds) */ objectIds?: number[]; /** * Defines the mosaic operation used to resolve overlapping pixels. **Possible Values:** first | last | min | max | mean | blend - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#operation) */ - operation?: string; + operation?: "first" | "last" | "min" | "max" | "mean" | "blend"; /** * The name of the attribute field that is used with a constant sortValue to define the mosaicking order when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. The ordering is defined by the absolute value of the difference between the specified sort field value and the sort base value. For example, if the sort field is `Month` and the sort value is `7 (July)`, then the ordering is defined by `ABS(Month -7)`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortField) */ sortField?: string; /** * A constant value defining a reference or base value for the sort field when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortValue) */ sortValue?: string; /** * Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#viewpoint) */ viewpoint?: PointProperties; /** * The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#where) */ where?: string; @@ -12326,46 +12924,44 @@ declare namespace __esri { interface PixelBlock extends Accessor { /** * The height (or number of rows) of the PixelBlock in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) */ height: number; /** * An array of numbers representing pixels to show and pixels to hide from the view. The length of this array is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). It's arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, .....]` where `p_xy` is the pixel value at the column `x` and row `y`. The mask is per pixel, not per band. Items in the mask array with a value of `0` indicates [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) to not display in the view at that index. Items with a value of `1` indicate to display the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) at there corresponding indices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#mask) */ mask: number[]; /** * A two dimensional array representing the pixels from the Image Service displayed on the client. The length of the first dimension is the same as the number of bands in the layer. The length of the second dimension is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). The length of each band is the same. The pixels in each band are arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, ...]` where `p_xy` is the pixel value at the column `x` and row `y`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) */ pixels: number[][]; /** * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixelType) */ pixelType: string; /** * An array of objects containing numeric statistical properties. Each object has the following specification if defined: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ statistics: PixelBlockStatistics[]; /** * The width (or number of columns) of the PixelBlock in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width) */ width: number; } interface PixelBlockConstructor { - - - new(properties?: PixelBlockProperties): PixelBlock; + new (properties?: PixelBlockProperties): PixelBlock; } export const PixelBlock: PixelBlockConstructor; @@ -12373,59 +12969,58 @@ declare namespace __esri { interface PixelBlockProperties { /** * The height (or number of rows) of the PixelBlock in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) */ height?: number; /** * An array of numbers representing pixels to show and pixels to hide from the view. The length of this array is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). It's arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, .....]` where `p_xy` is the pixel value at the column `x` and row `y`. The mask is per pixel, not per band. Items in the mask array with a value of `0` indicates [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) to not display in the view at that index. Items with a value of `1` indicate to display the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) at there corresponding indices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#mask) */ mask?: number[]; /** * A two dimensional array representing the pixels from the Image Service displayed on the client. The length of the first dimension is the same as the number of bands in the layer. The length of the second dimension is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). The length of each band is the same. The pixels in each band are arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, ...]` where `p_xy` is the pixel value at the column `x` and row `y`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) */ pixels?: number[][]; /** * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixelType) */ pixelType?: string; /** * An array of objects containing numeric statistical properties. Each object has the following specification if defined: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ statistics?: PixelBlockStatistics[]; /** * The width (or number of columns) of the PixelBlock in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width) */ width?: number; } - export interface PixelBlockStatistics extends Object { /** * The maximum pixel value in the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ maxValue?: number; /** * The minimum pixel value in the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ minValue?: number; /** * Value representing areas of no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ noDataValue?: number; @@ -12434,28 +13029,26 @@ declare namespace __esri { interface RangeDomain extends Domain { /** * The maximum valid value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#maxValue) */ maxValue: number; /** * The minimum valid value. - * + * * [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 { - - - new(properties?: RangeDomainProperties): RangeDomain; + new (properties?: RangeDomainProperties): RangeDomain; fromJSON(json: any): RangeDomain; } @@ -12465,13 +13058,13 @@ declare namespace __esri { interface RangeDomainProperties extends DomainProperties { /** * The maximum valid value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#maxValue) */ maxValue?: number; /** * The minimum valid value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#minValue) */ minValue?: number; @@ -12480,27 +13073,27 @@ declare namespace __esri { interface RasterFunction extends Accessor, JSONSupport { /** * The arguments for the raster function. The structure depends on the function specified. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their arguments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments) */ functionArguments: any; /** * The raster function name. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their arguments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionName) */ functionName: string; /** * Defines the pixel type of the output image. **Possible Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#outputPixelType) - * + * * @default unknown */ outputPixelType: string; /** * The variable name for the raster function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#variableName) */ variableName: any; @@ -12509,11 +13102,11 @@ declare namespace __esri { interface RasterFunctionConstructor { /** * Specifies processing to be done to the image service. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their [arguments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments). The following image shows a landcover ImageryLayer rendered with two chained client-side raster functions used to reclass pixel values (Remap) and assign each pixel a new color (Colormap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html) */ - new(properties?: RasterFunctionProperties): RasterFunction; + new (properties?: RasterFunctionProperties): RasterFunction; fromJSON(json: any): RasterFunction; } @@ -12523,27 +13116,27 @@ declare namespace __esri { interface RasterFunctionProperties { /** * The arguments for the raster function. The structure depends on the function specified. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their arguments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments) */ functionArguments?: any; /** * The raster function name. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their arguments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionName) */ functionName?: string; /** * Defines the pixel type of the output image. **Possible Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#outputPixelType) - * + * * @default unknown */ outputPixelType?: string; /** * The variable name for the raster function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#variableName) */ variableName?: any; @@ -12552,40 +13145,38 @@ 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). 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) */ 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) */ 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) */ keyField: string; /** * The name of the relationship. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#name) */ 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) */ relatedTableId: number; } interface RelationshipConstructor { - - - new(properties?: RelationshipProperties): Relationship; + new (properties?: RelationshipProperties): Relationship; } export const Relationship: RelationshipConstructor; @@ -12593,31 +13184,31 @@ 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). 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) */ 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) */ 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) */ keyField?: string; /** * The name of the relationship. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#name) */ 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) */ relatedTableId?: number; @@ -12626,149 +13217,149 @@ declare namespace __esri { interface Sublayer extends Accessor { /** * A SQL where clause used to filter features in the image. 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). Definition expressions may be set when a sublayer is constructed prior to it loading in the view or after it has been added to the MapImageLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) */ definitionExpression: string; /** * The sublayer's layer ID. When a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) is not defined on the layer, this value represents the id of the sublayer defined by the map service. If creating a [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) or a [MapDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#MapDataLayer) and adding it to the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) property of the sublayer, the value of this property can be anything set by the developer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) */ id: number; /** * 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) objects. Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) property of the sublayer must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** * Indicates if labels for the sublayer will be visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * 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 | TileLayer; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * 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 (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) */ minScale: number; /** * The level of opacity to set on the sublayer on a scale from 0.0 - 1.0 where `0` is fully transparent and `1.0` is fully opaque. If the [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) is set, the actual opacity value of the sublayer will be the value of [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) multiplied by the sublayer's opacity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#opacity) */ opacity: number; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** - * 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** + * 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 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) */ popupTemplate: PopupTemplate; /** - * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. - * > **Known Limitations** + * 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 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) */ renderer: Renderer; /** * An object that allows you to create a dynamic layer with data either from the map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) */ source: DynamicMapLayer | DynamicDataLayer; /** * If a sublayer contains sublayers, this property is 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 belonging to the given sublayer with sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) */ sublayers: Collection; /** * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This value can be defined in the map service or programmatically by the developer. It can also be useful for finding a specific sublayer. - * + * * [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) */ readonly url: string; /** * Indicates if the layer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) */ visible: boolean; /** * Creates a deep clone of the sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#clone) - * - * + * + * */ clone(): Sublayer; /** * A convenient method for creating a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) instance based on the Sublayer's configuration, including [dynamic sources](https://enterprise.arcgis.com/en/server/latest/publish-services/linux/about-dynamic-layers.htm). This allows you to take advantage of FeatureLayer capabilities not supported in Sublayer, such as the [Smart Mapping creator functions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer) - * - * + * + * */ createFeatureLayer(): FeatureLayer; /** * Creates a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) object with default values representing the layer's state, including filters (definition expression) on the layer's features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createQuery) - * - * + * + * */ createQuery(): Query; /** * Executes a [query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) against features in the sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.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. - * + * */ queryFeatures(params?: Query | QueryProperties): IPromise; } @@ -12776,11 +13367,11 @@ declare namespace __esri { interface SublayerConstructor { /** * 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) */ - new(properties?: SublayerProperties): Sublayer; + new (properties?: SublayerProperties): Sublayer; } export const Sublayer: SublayerConstructor; @@ -12788,142 +13379,142 @@ declare namespace __esri { interface SublayerProperties { /** * A SQL where clause used to filter features in the image. 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). Definition expressions may be set when a sublayer is constructed prior to it loading in the view or after it has been added to the MapImageLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) */ definitionExpression?: string; /** * The sublayer's layer ID. When a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) is not defined on the layer, this value represents the id of the sublayer defined by the map service. If creating a [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) or a [MapDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#MapDataLayer) and adding it to the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) property of the sublayer, the value of this property can be anything set by the developer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) */ id?: number; /** * 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) objects. Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) property of the sublayer must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** * Indicates if labels for the sublayer will be visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * 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 | TileLayerProperties; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * 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 (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) */ minScale?: number; /** * The level of opacity to set on the sublayer on a scale from 0.0 - 1.0 where `0` is fully transparent and `1.0` is fully opaque. If the [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) is set, the actual opacity value of the sublayer will be the value of [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) multiplied by the sublayer's opacity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#opacity) */ opacity?: number; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** - * 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** + * 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 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) */ popupTemplate?: PopupTemplateProperties; /** - * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. - * > **Known Limitations** + * 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 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) */ renderer?: RendererProperties; /** * An object that allows you to create a dynamic layer with data either from the map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) */ source?: DynamicMapLayer | DynamicDataLayer; /** * If a sublayer contains sublayers, this property is 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 belonging to the given sublayer with sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This value can be defined in the map service or programmatically by the developer. It can also be useful for finding a specific sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#title) */ title?: string; /** * Indicates if the layer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) */ visible?: boolean; } /** - * A dynamic data layer is a layer created on-the-fly with data stored in a [registered workspace](https://server.arcgis.com/en/server/latest/publish-services/windows/overview-register-data-with-arcgis-server.htm). This is data that can be rendered and queried on the fly, but that isn't explicitly exposed as a service sublayer. Depending on the type of data source, these layers are classified as one of the following: - * + * A dynamic data layer is a layer created on-the-fly with data stored in a [registered workspace](https://server.arcgis.com/en/server/latest/publish-services/windows/overview-register-data-with-arcgis-server.htm). This is data that can be rendered and queried on the fly, but that isn't explicitly exposed as a service sublayer. Depending on the type of data source, these layers are classified as one of the following: + * * Data source | Description * ------------|------------ * [TableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) | A feature class with geometries or table without geometries. When a table data source does not contain geometries, it may be used as one of the sources in a [join operation](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource). Feature class tables may be used on their own since they contain a geometry field. * [QueryTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) | A feature class or table that may be queried on the fly with a SQL where clause. This data source is useful for scenarios where you have a table containing unique geometries and another table with multiple records that match to each geometry. You can use the QueryTableDataSource to select only a subset of those matching records (so records in both tables have a one-to-one relationship with each other) and join them to the table with geometries. * [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) | A raster dataset used for visualization purposes only. * [JoinTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) | This data source consists of two data sources joined by a common attribute or key. The left table data source typically contains geometries, while the right source may be a table or query table without geometries. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ export interface DynamicDataLayer extends Object { /** * This value is always `data-layer` and is inferred when the `dataSource` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ type: string; /** * A table, feature class, or raster that resides in a registered workspace (either a folder or geodatabase). The data sources are not visible in the Services Directory by default. They may be viewed, published, and configured using the ArcGIS Server Manager. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ dataSource: TableDataSource | QueryTableDataSource | RasterDataSource | JoinTableDataSource; /** * Controls field visibility in the layer. Only specified fields will be visible. If `null`, all fields are visible in the dynamic layer. The specification for a field object is provided below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ fields: DynamicDataLayerFields[]; @@ -12931,25 +13522,25 @@ declare namespace __esri { /** * A dynamic map layer refers to a layer published in a map service that has dynamic layers enabled. This layer type may be used to create multiple [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) that point to the same service layer, but are assigned different definition expressions, renderers, and other properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) */ export interface DynamicMapLayer extends Object { /** * This value is always `map-layer` and is inferred when the `mapLayerId` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) */ type: string; /** * The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) of the service sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) */ mapLayerId: number; /** * An optional property for specifying the GDB version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) */ gdbVersion: string; @@ -12957,49 +13548,49 @@ declare namespace __esri { /** * The result of an on-the-fly join operation at runtime. Nested joins are supported. To use nested joins, set either `leftTableSource` or `rightTableSource` to `join-table`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ export interface JoinTableDataSource extends Object { /** * This value is always `join-table` and is inferred when other join table properties of this object are set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ type: string; /** * The field name used for joining or matching records in the left table to records in the right table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ leftTableKey: string; /** * The field name used for joining or matching records in the right table to records in the left table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ rightTableKey: string; /** * The left table for joining to the right table source. This can either be a dynamic map layer or a dynamic data layer. The dynamic data layer may contain another join data source used for nested joining. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ leftTableSource: DynamicMapLayer | DynamicDataLayer; /** * The right table for joining to the left table source. This can either be a dynamic map layer or a dynamic data layer. The dynamic data layer may contain another join data source used for nested joining. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ rightTableSource: DynamicMapLayer | DynamicDataLayer; /** - * The type of join that will be performed. - * + * The type of join that will be performed. + * * Possible Value | Description * ---------------|------------ * left-outer-join | Unmatched records in the left table source are preserved and joined with `null` values in the right table source. * left-inner-join | Records in the left table source are discarded if they are unmatched with records in the right table source. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ joinType: string; @@ -13007,43 +13598,43 @@ declare namespace __esri { /** * A query table is a feature class or table defined by a SQL query on the fly. Query layers allow both spatial and nonspatial information stored in a database to be easily integrated into map service operations. Since a query table uses SQL to directly query database tables and views, spatial information used by a query table is not required to be in a geodatabase. This data source is useful for scenarios where you have a table containing multiple records that match to a single geometry in either another table or a map service layer. You can use the QueryTableDataSource to select only a subset of those matching records and join them to the table with geometries so records in both tables have a one-to-one relationship with each other. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ export interface QueryTableDataSource extends Object { /** * This value is always `query-table` and is inferred when the `query` property of this object is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ type: string; /** * The workspace where the data resides (defined in ArcGIS Server Manager). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ workspaceId: string; /** * The SQL query used to filter records. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ query: string; /** * The field name(s) containing the unique IDs for each record in the table. This can be a comma separated list if the query table is used in a [JoinTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinDataTableSource). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ oidFields: string; /** * The spatial reference of the geometry of each feature in the table source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ spatialReference: SpatialReference; /** * The geometry type of each record in the table. **Possible Values:** point | multipoint | polyline | polygon | multipatch - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ geometryType: string; @@ -13051,25 +13642,25 @@ declare namespace __esri { /** * A file-based raster that resides in a registered raster workspace. The raster may only be displayed in the view, not queried or assigned a renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) */ export interface RasterDataSource extends Object { /** * This value is always `raster`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) */ type: string; /** * The workspace where the raster resides as defined in the ArcGIS Server Manager. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) */ workspaceId: string; /** * The name of the raster in the registered workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) */ dataSourceName: string; @@ -13077,47 +13668,46 @@ declare namespace __esri { /** * A table or feature class that resides in a registered workspace (either a folder or geodatabase). In the case of a geodatabase, if versioned, use `version` to switch to an alternate geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ export interface TableDataSource extends Object { /** * This value is always `table`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ type: string; /** * The workspace where the table resides as defined in the ArcGIS Server Manager. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ workspaceId: string; /** * The name of the table in the registered workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ dataSourceName: string; /** * References the geodatabase version if multiple versions exist in the geodatabase. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ gdbVersion: string; } - export interface DynamicDataLayerFields extends Object { /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ name: string; /** * The alias of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ alias: string; @@ -13126,83 +13716,80 @@ declare namespace __esri { interface TileInfo extends Accessor, JSONSupport { /** * The dots per inch (DPI) of the tiling scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#dpi) */ dpi: number; /** * Image format of the cached tiles. **Possible Values:** png | png24 | png32 | jpg | dib | tiff | emf | ps | pdf | gif | svg | svgz | mixed | lerc - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#format) */ format: string; /** * Indicates if the tiling scheme supports wrap around. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#isWrappable) */ isWrappable: boolean; /** * An array of levels of detail that define the tiling scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) */ lods: LOD[]; /** * The tiling scheme origin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#origin) */ origin: Point; /** * Size of tiles in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#size) */ size: number[]; /** * The spatial reference of the tiling schema. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#spatialReference) */ spatialReference: SpatialReference; /** * Utility method used to convert a scale value to its corresponding zoom value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#scaleToZoom) - * + * * @param scale The scale value to convert. - * + * */ scaleToZoom(scale: number): number; /** * Utility method used to convert a zoom value to its corresponding scale value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#zoomToScale) - * + * * @param zoom The zoom value to convert. - * + * */ zoomToScale(zoom: number): number; } interface TileInfoConstructor { - - - new(properties?: TileInfoProperties): TileInfo; - + new (properties?: TileInfoProperties): TileInfo; /** * A convenience method used to create a new TileInfo instance with preset properties like [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods). Optionally, properties such as `size`, `scales[]`, and a `[SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html)` can also be set to calculate [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) for each TileInfo. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) - * + * * @param options An object that contains the size, scales, and/or [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) used to compute the new TileInfo instance. * @param options.size The size of each tile in pixels. * @param options.spatialReference The spatial reference for the new TileInfo instance. If the spatial reference is not WGS84 nor WebMercator, the origin of the TileInfo is `0.0`. * @param options.scales An array of scale values to use for the TileInfo. If none are specified, the scales from the [ArcGIS Online basemaps](https://www.arcgis.com/home/group.html?id=702026e41f6641fb85da88efe79dc166#overview) are used from level 0 through 24. - * + * */ create(options?: TileInfoCreateOptions): TileInfo; @@ -13214,71 +13801,70 @@ declare namespace __esri { interface TileInfoProperties { /** * The dots per inch (DPI) of the tiling scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#dpi) */ dpi?: number; /** * Image format of the cached tiles. **Possible Values:** png | png24 | png32 | jpg | dib | tiff | emf | ps | pdf | gif | svg | svgz | mixed | lerc - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#format) */ format?: string; /** * Indicates if the tiling scheme supports wrap around. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#isWrappable) */ isWrappable?: boolean; /** * An array of levels of detail that define the tiling scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) */ lods?: LODProperties[]; /** * The tiling scheme origin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#origin) */ origin?: PointProperties; /** * Size of tiles in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#size) */ size?: number[]; /** * The spatial reference of the tiling schema. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; } - export interface TileInfoCreateOptions extends Object { /** * The size of each tile in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) - * + * * @default 256 */ size?: number; /** * The spatial reference for the new TileInfo instance. If the spatial reference is not WGS84 nor WebMercator, the origin of the TileInfo is `0.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) - * + * * @default WebMercator */ spatialReference?: SpatialReference; /** * An array of scale values to use for the TileInfo. If none are specified, the scales from the [ArcGIS Online basemaps](https://www.arcgis.com/home/group.html?id=702026e41f6641fb85da88efe79dc166#overview) are used from level 0 through 24. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) - * + * * @default The scales provided by ArcGIS Online basemaps */ scales?: number[]; @@ -13287,37 +13873,35 @@ declare namespace __esri { interface TileMatrixSet extends Accessor, JSONSupport { /** * The full extent of the TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#fullExtent) */ fullExtent: Extent; /** * The unique ID assigned to the TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#id) */ id: string; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#tileInfo) */ tileInfo: TileInfo; /** * Creates a deep clone of this TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#clone) - * - * + * + * */ clone(): TileMatrixSet; } interface TileMatrixSetConstructor { - - - new(properties?: TileMatrixSetProperties): TileMatrixSet; + new (properties?: TileMatrixSetProperties): TileMatrixSet; fromJSON(json: any): TileMatrixSet; } @@ -13327,19 +13911,19 @@ declare namespace __esri { interface TileMatrixSetProperties { /** * The full extent of the TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#fullExtent) */ fullExtent?: ExtentProperties; /** * The unique ID assigned to the TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#id) */ id?: string; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#tileInfo) */ tileInfo?: TileInfoProperties; @@ -13348,103 +13932,101 @@ declare namespace __esri { interface WMSSublayer extends Accessor { /** * Description for the WMS sublayer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#description) */ description: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#fullExtent) */ fullExtent: Extent; /** * The id for the WMS sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) */ id: number; /** * The [WMSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#layer) */ layer: WMSLayer; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * A string url pointing to a legend image for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendUrl) */ legendUrl: string; /** * Name of the WMS sublayer. This defaults to the value of the Name property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#name) */ name: string; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#popupEnabled) - * + * * @default false */ popupEnabled: boolean; /** * Indicates if the layer can be queried, i.e. the service supports GetFeatureInfo with either text/html or text/plain formats. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#queryable) - * + * * @default false */ queryable: boolean; /** * List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#spatialReferences) */ spatialReferences: number[]; /** * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#sublayers) */ sublayers: Collection; /** * The title of the WMS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#title) */ title: string; /** * Indicates if the layer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#visible) */ visible: boolean; /** * Creates a deep clone of the WMS sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#clone) - * - * + * + * */ clone(): WMSSublayer; } interface WMSSublayerConstructor { - - - new(properties?: WMSSublayerProperties): WMSSublayer; + new (properties?: WMSSublayerProperties): WMSSublayer; } export const WMSSublayer: WMSSublayerConstructor; @@ -13452,85 +14034,85 @@ declare namespace __esri { interface WMSSublayerProperties { /** * Description for the WMS sublayer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#description) */ description?: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#fullExtent) */ fullExtent?: ExtentProperties; /** * The id for the WMS sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) */ id?: number; /** * The [WMSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#layer) */ layer?: WMSLayerProperties; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * A string url pointing to a legend image for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendUrl) */ legendUrl?: string; /** * Name of the WMS sublayer. This defaults to the value of the Name property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#name) */ name?: string; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#popupEnabled) - * + * * @default false */ popupEnabled?: boolean; /** * Indicates if the layer can be queried, i.e. the service supports GetFeatureInfo with either text/html or text/plain formats. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#queryable) - * + * * @default false */ queryable?: boolean; /** * List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#spatialReferences) */ spatialReferences?: number[]; /** * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The title of the WMS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#title) */ title?: string; /** * Indicates if the layer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#visible) */ visible?: boolean; @@ -13539,43 +14121,41 @@ declare namespace __esri { interface WMTSStyle extends Accessor, JSONSupport { /** * Description for the WMTS style. This defaults to the value of the Abstract property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#description) */ description: string; /** * The unique ID assigned to the style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#id) */ id: string; /** * The URL to the legend which gets used in [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This defaults to the value of the LegendURL property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#legendUrl) */ legendUrl: string; /** * The title of the WMTS style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#title) */ title: string; /** * Creates a deep clone of the WMTSStyle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#clone) - * - * + * + * */ clone(): WMTSStyle; } interface WMTSStyleConstructor { - - - new(properties?: WMTSStyleProperties): WMTSStyle; + new (properties?: WMTSStyleProperties): WMTSStyle; fromJSON(json: any): WMTSStyle; } @@ -13585,25 +14165,25 @@ declare namespace __esri { interface WMTSStyleProperties { /** * Description for the WMTS style. This defaults to the value of the Abstract property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#description) */ description?: string; /** * The unique ID assigned to the style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#id) */ id?: string; /** * The URL to the legend which gets used in [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This defaults to the value of the LegendURL property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#legendUrl) */ legendUrl?: string; /** * The title of the WMTS style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#title) */ title?: string; @@ -13612,91 +14192,89 @@ declare namespace __esri { interface WMTSSublayer extends Accessor, JSONSupport { /** * Description for the WMTS sublayer. This defaults to the value of the Abstract property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#description) */ description: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#fullExtent) */ fullExtent: Extent; /** * The unique ID assigned to the sublayer. If not set by the developer, it is automatically generated when the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) */ id: string; /** * The map image format (MIME type) to request. Defaults to the first item in [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). Must be one of the supported [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormat) */ imageFormat: string; /** * Supported image formats as retrieved from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats) */ imageFormats: string[]; /** * The [WMTSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#layer) */ layer: WMTSLayer; /** * The [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html) to request. Defaults to the id of the first item in [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). Should be one of the supported [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styleId) */ styleId: string; /** * A collection of supported [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html)s as retrieved from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles) */ styles: Collection; /** * The [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) */ tileMatrixSet: TileMatrixSet; /** * The id of the [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the id of the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSetId) */ tileMatrixSetId: string; /** * A collection of supported [TileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSets) */ tileMatrixSets: Collection; /** * The title of the WMTS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#title) */ title: string; /** * Creates a deep clone of the WMTS sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#clone) - * - * + * + * */ clone(): WMTSSublayer; } interface WMTSSublayerConstructor { - - - new(properties?: WMTSSublayerProperties): WMTSSublayer; + new (properties?: WMTSSublayerProperties): WMTSSublayer; fromJSON(json: any): WMTSSublayer; } @@ -13706,94 +14284,101 @@ declare namespace __esri { interface WMTSSublayerProperties { /** * Description for the WMTS sublayer. This defaults to the value of the Abstract property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#description) */ description?: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#fullExtent) */ fullExtent?: ExtentProperties; /** * The unique ID assigned to the sublayer. If not set by the developer, it is automatically generated when the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) */ id?: string; /** * The map image format (MIME type) to request. Defaults to the first item in [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). Must be one of the supported [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormat) */ imageFormat?: string; /** * Supported image formats as retrieved from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats) */ imageFormats?: string[]; /** * The [WMTSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#layer) */ layer?: WMTSLayerProperties; /** * The [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html) to request. Defaults to the id of the first item in [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). Should be one of the supported [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styleId) */ styleId?: string; /** * A collection of supported [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html)s as retrieved from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles) */ styles?: CollectionProperties; /** * The [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) */ tileMatrixSet?: TileMatrixSetProperties; /** * The id of the [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the id of the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSetId) */ tileMatrixSetId?: string; /** * A collection of supported [TileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSets) */ tileMatrixSets?: CollectionProperties; /** * The title of the WMTS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#title) */ title?: string; } - interface TileLayer extends Layer, SublayersOwner, 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; @@ -13803,55 +14388,54 @@ declare namespace __esri { * * [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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#tileServers) */ tileServers: string[]; /** * For [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) the type is `tile`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#type) */ readonly type: "tile"; /** * The URL of the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#url) */ url: string; /** * This method fetches a tile for the given level, row and column present in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) - * + * * @param level Level of detail 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 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.timestamp Number to append to the tile request to prevent fetching the tile from the browser cache. - * + * */ fetchTile(level: number, row: number, col: number, options?: TileLayerFetchTileOptions): IPromise; /** * This method returns a URL to a tile for a given level, row and column. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#getTileUrl) - * + * * @param level The requested tile's level. * @param row The requested tile's row. * @param col The requested tile's column. - * + * */ getTileUrl(level: number, row: number, col: number): string; - on(name: "layerview-create", eventHandler: TileLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: TileLayerLayerviewDestroyEventHandler): IHandle; @@ -13860,58 +14444,60 @@ declare namespace __esri { interface TileLayerConstructor { /** * The TileLayer allows you work with a cached [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm) exposed by the ArcGIS Server REST API and add it to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) as a tile layer. A cached service accesses tiles from a cache instead of dynamically rendering images. Because they are cached, tiled layers render faster than [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). To create an instance of TileLayer, you must reference the URL of the cached map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) */ - new(properties?: TileLayerProperties): TileLayer; + new (properties?: TileLayerProperties): TileLayer; fromJSON(json: any): TileLayer; } export const TileLayer: TileLayerConstructor; - interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, PortalLayerProperties { + interface TileLayerProperties + extends LayerProperties, + ArcGISMapServiceProperties, + ArcGISCachedServiceProperties, + RefreshableLayerProperties, + ScaleRangeLayerProperties, + PortalLayerProperties { /** * An array of tile servers used for changing map tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#tileServers) */ tileServers?: string[]; /** * The URL of the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#url) */ url?: string; } export interface TileLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface TileLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface TileLayerFetchTileOptions extends Object { /** * Number to append to the tile request to prevent fetching the tile from the browser cache. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) */ timestamp?: boolean; } interface UnknownLayer extends Layer { - on(name: "layerview-create", eventHandler: UnknownLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: UnknownLayerLayerviewDestroyEventHandler): IHandle; @@ -13920,61 +14506,50 @@ declare namespace __esri { interface UnknownLayerConstructor { /** * Represents a layer whose type could not be determined. For example, when loading a layer from a URL and the layer type cannot be determined, then it is represented as an instance of this class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-UnknownLayer.html) */ - new(properties?: UnknownLayerProperties): UnknownLayer; + new (properties?: UnknownLayerProperties): UnknownLayer; } export const UnknownLayer: UnknownLayerConstructor; - interface UnknownLayerProperties extends LayerProperties { - - } + interface UnknownLayerProperties extends LayerProperties {} export interface UnknownLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface UnknownLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } interface UnsupportedLayer extends Layer { - on(name: "layerview-create", eventHandler: UnsupportedLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: UnsupportedLayerLayerviewDestroyEventHandler): IHandle; } interface UnsupportedLayerConstructor { - - - new(properties?: UnsupportedLayerProperties): UnsupportedLayer; + new (properties?: UnsupportedLayerProperties): UnsupportedLayer; } export const UnsupportedLayer: UnsupportedLayerConstructor; - interface UnsupportedLayerProperties extends LayerProperties { - - } + interface UnsupportedLayerProperties extends LayerProperties {} export interface UnsupportedLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface UnsupportedLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -13983,69 +14558,117 @@ declare namespace __esri { interface VectorTileLayer extends Layer, ScaleRangeLayer { /** * 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-VectorTileLayer.html#attributionDataUrl) */ readonly attributionDataUrl: string; /** * Indicates the layer's supported capabilities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ readonly capabilities: VectorTileLayerCapabilities; /** * The current style information of the VectorTileLayer. See the object specification below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ readonly currentStyleInfo: VectorTileLayerCurrentStyleInfo; /** * The portal item from which the layer is loaded. This will load the layer from the portal item, not the vector tile service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#portalItem) */ portalItem: PortalItem; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#spatialReference) */ spatialReference: SpatialReference; /** * A style JSON object of vector tiles that will be used to render the layer. If initializing the layer with a style JSON object, the tiles are fetched from the tile servers specified in the style object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#style) */ style: any; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#tileInfo) */ tileInfo: TileInfo; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#token) */ readonly token: string; /** * The URL to the vector tile service, or the URL to the style resource of vector tiles that will be used to render the layer. If specifying a URL to a style, the tiles are fetched from the tile servers specified in the style object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#url) */ url: string; + /** + * Returns an instance of [layout](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-layout) properties for the specified [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#getLayoutProperties) + * + * @param layer The style-layer [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * + */ + getLayoutProperties(layer: string): any; + /** + * Returns an instance of [paint](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-paint) properties for the specified [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#getPaintProperties) + * + * @param layer The style-layer [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * + */ + getPaintProperties(layer: string): any; + /** + * Returns the [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) of the [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers) based on its index. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#getStyleLayerId) + * + * @param index Index of the style-layer in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * + */ + getStyleLayerId(index: number): string; /** * Loads a style to render a layer from the specified URL to a style resource or style JSON object. It is equivalent of changing the entire CSS style sheet for web page. When loading a style, it is the developer's responsibility to make sure that any relative urls in the style resolve correctly. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#loadStyle) - * + * * @param style The URL to a style of vector tiles or style JSON object. - * + * */ loadStyle(style: string | any): IPromise; - + /** + * Assigns new [layout](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-layout) properties to the specified [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers). + * > **Known Limitations** This method is only supported in 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#setLayoutProperties) + * + * @param layer The style-layer [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * @param layout An instance of layout properties to assign to the style-layer. + * + */ + setLayoutProperties(layer: string, layout: any): void; + /** + * Assigns new [paint](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-paint) properties to the specified [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers). + * > **Known Limitations** This method is only supported in 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#setPaintProperties) + * + * @param layer The style-layer [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * @param painter An instance of paint properties to assign to the specified style-layer. + * + */ + setPaintProperties(layer: string, painter: any): void; on(name: "layerview-create", eventHandler: VectorTileLayerLayerviewCreateEventHandler): IHandle; @@ -14054,12 +14677,12 @@ declare namespace __esri { interface VectorTileLayerConstructor { /** - * A VectorTileLayer accesses cached tiles of data and renders it in vector format. It is similar to a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) in the context of caching; however, a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) renders as a series of images, not vector data. - * + * VectorTileLayer accesses cached tiles of data and renders it in vector format. It is similar to a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) in the context of caching; however, a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) renders as a series of images, not vector data. Unlike raster tiles, they can adapt to the resolution of their display device and can be restyled for multiple uses. VectorTileLayer delivers styled maps while taking advantage of cached raster map tiles with vector map data. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html) */ - new(properties?: VectorTileLayerProperties): VectorTileLayer; + new (properties?: VectorTileLayerProperties): VectorTileLayer; fromJSON(json: any): VectorTileLayer; } @@ -14069,55 +14692,52 @@ declare namespace __esri { interface VectorTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties { /** * The portal item from which the layer is loaded. This will load the layer from the portal item, not the vector tile service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#portalItem) */ portalItem?: PortalItemProperties; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * A style JSON object of vector tiles that will be used to render the layer. If initializing the layer with a style JSON object, the tiles are fetched from the tile servers specified in the style object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#style) */ style?: any; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#tileInfo) */ tileInfo?: TileInfoProperties; /** * The URL to the vector tile service, or the URL to the style resource of vector tiles that will be used to render the layer. If specifying a URL to a style, the tiles are fetched from the tile servers specified in the style object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#url) */ url?: string; } export interface VectorTileLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface VectorTileLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface VectorTileLayerCapabilities extends Object { /** * Indicates options supported by the exportTiles operation. Will be `null` if the `supportsExportTiles` is `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ exportTiles: any; @@ -14125,73 +14745,70 @@ declare namespace __esri { exportMap: VectorTileLayerCapabilitiesExportMap; /** * Indicates operations that can be performed on the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ operations: VectorTileLayerCapabilitiesOperations; } - export interface VectorTileLayerCapabilitiesExportMap extends Object { /** * Specifies the maximum number of tiles that can be exported to a cache dataset or a tile package. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ maxExportTilesCount: number; } - export interface VectorTileLayerCapabilitiesOperations extends Object { /** * Indicates if the tiles from the service can be exported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ supportsExportTiles: boolean; /** * Indicates if the service exposes a tile map that describes the presence of tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ supportsTileMap: boolean; } - export interface VectorTileLayerCurrentStyleInfo extends Object { /** * Absolute URL for a vector tile service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ serviceUrl: string; /** * Absolute URL for vector tile service style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ styleUrl: string; /** * Absolute URL for sprites included in a style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ spriteUrl: string; /** * Absolute template URL for font sets included in a style. The URL includes `{fontstack}` and `{range}` tokens. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ glyphsUrl: string; /** - * Style JSON object for vector tiles. Style object includes `version` of the style specification, `sprite` and `glyphs` properties. - * + * Style JSON object for vector tiles. Style object includes `version` of the style specification, `sprite` and `glyphs` properties. It adheres to [version 8 of the Mapbox GL style specification](https://www.mapbox.com/mapbox-gl-js/style-spec/). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ style: any; /** * Vector tile service information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ layerDefinition: any; @@ -14200,75 +14817,79 @@ declare namespace __esri { interface WebTileLayer extends Layer, ScaleRangeLayer, RefreshableLayer { /** * The attribution information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#copyright) */ copyright: string; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#spatialReference) - * + * * @default Web Mercator Auxiliary Sphere (wkid: 3857) */ readonly spatialReference: SpatialReference; /** * A string of subDomain names where tiles are served to speed up tile retrieval. If subDomains are specified, the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) should include a `{subDomain}` place holder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) */ subDomains: string[]; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileInfo) */ tileInfo: TileInfo; /** * The list of tile server urls for the layer. It's computed from the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) and the list of [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileServers) */ readonly tileServers: string[]; /** * For [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) the type is `web-tile`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#type) */ readonly type: "web-tile"; /** * URL template for the hosted tiles. The `urlTemplate` should contain a `{subDomain}` place holder if [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) are specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) */ urlTemplate: string; /** * This method fetches a tile for the given level, row and column present in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) - * + * * @param level Level of detail 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 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.timestamp A timestamp to append to the tile url to avoid loading a cached version of the tile. - * + * */ - fetchTile(level: number, row: number, column: number, options?: WebTileLayerFetchTileOptions): IPromise; + fetchTile( + level: number, + row: number, + column: number, + options?: WebTileLayerFetchTileOptions + ): IPromise; /** * This method returns a URL to a tile for a given level, row and column. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#getTileUrl) - * + * * @param level The requested tile's level. * @param row The requested tile's row. * @param column The requested tile's column. - * + * */ getTileUrl(level: number, row: number, column: number): string; - on(name: "layerview-create", eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: WebTileLayerLayerviewDestroyEventHandler): IHandle; @@ -14277,11 +14898,11 @@ declare namespace __esri { interface WebTileLayerConstructor { /** * WebTileLayer provides a simple way to add non-ArcGIS Server map tiles as a layer to a map. The constructor takes a URL template that usually follows a pattern of `http://some.domain.com/{level}/{col}/{row}/` where `level` corresponds to a zoom level, and `column` and `row` represent tile column and row, respectively. This pattern is not required, but is the most common one currently on the web. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) */ - new(properties?: WebTileLayerProperties): WebTileLayer; + new (properties?: WebTileLayerProperties): WebTileLayer; } export const WebTileLayer: WebTileLayerConstructor; @@ -14289,49 +14910,46 @@ declare namespace __esri { interface WebTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { /** * The attribution information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#copyright) */ copyright?: string; /** * A string of subDomain names where tiles are served to speed up tile retrieval. If subDomains are specified, the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) should include a `{subDomain}` place holder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) */ subDomains?: string[]; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileInfo) */ tileInfo?: TileInfoProperties; /** * URL template for the hosted tiles. The `urlTemplate` should contain a `{subDomain}` place holder if [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) are specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) */ urlTemplate?: string; } export interface WebTileLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface WebTileLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface WebTileLayerFetchTileOptions extends Object { /** * A timestamp to append to the tile url to avoid loading a cached version of the tile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) */ timestamp?: boolean; @@ -14340,293 +14958,291 @@ declare namespace __esri { interface WMSLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { /** * Copyright information for the WMS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#copyright) */ copyright: string; /** * Use this to append different custom parameters to the WMS map requests. The custom layer parameters are applied to GetMap and GetFeatureInfo. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customLayerParameters) */ customLayerParameters: any; /** * Use this to append custom parameters to all WMS requests. The custom parameters are applied to GetCapabilities, GetMap and GetFeatureInfo. For example, if an access key is required, the key can be configured as a custom parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customParameters) */ customParameters: any; /** * Description for the WMS layer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#description) */ description: string; /** * Return format of feature information (MIME type). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoFormat) */ featureInfoFormat: string; /** * The URL for the WMS GetFeatureInfo call. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoUrl) */ featureInfoUrl: string; /** * All bounding boxes defined for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fullExtents) */ fullExtents: Extent[]; /** * The map image format (MIME type) to request. Defaults to `image/png` if the WMS service supports it. If not, it defaults to the value of the first `` in `` in the GetCapabilities response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageFormat) */ imageFormat: string; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxHeight) - * + * * @default 2048 */ imageMaxHeight: number; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxWidth) - * + * * @default 2048 */ imageMaxWidth: number; /** * Indicates whether the background of the image exported by the service is transparent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageTransparency) - * + * * @default true */ imageTransparency: boolean; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReference) */ spatialReference: SpatialReference; /** * List of spatialReference well known ids derived from the CRS elements of the first layer in the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReferences) */ spatialReferences: number[]; /** * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#sublayers) */ sublayers: Collection; /** * The URL of the WMS service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#url) */ url: string; /** * Version of the [WMS specification](http://www.opengeospatial.org/standards/wms) to use. For example, `1.3.0`, `1.1.1`, `1.1` or `1.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#version) */ version: string; /** * Fetching the WMS image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) - * + * * @param extent The extent of the view. * @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.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. - * + * */ fetchImage(extent: Extent, width: number, height: number, options?: WMSLayerFetchImageOptions): IPromise; /** * Returns a [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html) based on the given sublayer id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#findSublayerById) - * + * * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) of the WMS sublayer. - * + * */ findSublayerById(id: number): WMSSublayer; - on(name: "layerview-create", eventHandler: WMSLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: WMSLayerLayerviewDestroyEventHandler): IHandle; } interface WMSLayerConstructor { - - - new(properties?: WMSLayerProperties): WMSLayer; + new (properties?: WMSLayerProperties): WMSLayer; fromJSON(json: any): WMSLayer; } export const WMSLayer: WMSLayerConstructor; - interface WMSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface WMSLayerProperties + extends LayerProperties, + PortalLayerProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { /** * Copyright information for the WMS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#copyright) */ copyright?: string; /** * Use this to append different custom parameters to the WMS map requests. The custom layer parameters are applied to GetMap and GetFeatureInfo. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customLayerParameters) */ customLayerParameters?: any; /** * Use this to append custom parameters to all WMS requests. The custom parameters are applied to GetCapabilities, GetMap and GetFeatureInfo. For example, if an access key is required, the key can be configured as a custom parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customParameters) */ customParameters?: any; /** * Description for the WMS layer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#description) */ description?: string; /** * Return format of feature information (MIME type). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoFormat) */ featureInfoFormat?: string; /** * The URL for the WMS GetFeatureInfo call. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoUrl) */ featureInfoUrl?: string; /** * All bounding boxes defined for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fullExtents) */ fullExtents?: ExtentProperties[]; /** * The map image format (MIME type) to request. Defaults to `image/png` if the WMS service supports it. If not, it defaults to the value of the first `` in `` in the GetCapabilities response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageFormat) */ imageFormat?: string; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxHeight) - * + * * @default 2048 */ imageMaxHeight?: number; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxWidth) - * + * * @default 2048 */ imageMaxWidth?: number; /** * Indicates whether the background of the image exported by the service is transparent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageTransparency) - * + * * @default true */ imageTransparency?: boolean; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * List of spatialReference well known ids derived from the CRS elements of the first layer in the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReferences) */ spatialReferences?: number[]; /** * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The URL of the WMS service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#url) */ url?: string; /** * Version of the [WMS specification](http://www.opengeospatial.org/standards/wms) to use. For example, `1.3.0`, `1.1.1`, `1.1` or `1.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#version) */ version?: string; } export interface WMSLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface WMSLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface WMSLayerFetchImageOptions extends Object { /** * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) */ pixelRatio?: number; /** * The rotation in degrees of the exported image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) */ rotation?: number; @@ -14635,143 +15251,142 @@ declare namespace __esri { interface WMTSLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { /** * Currently active sublayer. Defaults to the first sublayer in [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#activeLayer) */ activeLayer: WMTSSublayer; /** * Copyright information for the WMTS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#copyright) */ copyright: string; /** * Use this to append different custom parameters to the WMTS tile requests. The custom layer parameters are applied to GetTile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customLayerParameters) */ customLayerParameters: any; /** * Use this to append custom parameters to all WMTS requests. The custom parameters are applied to GetCapabilities and GetTile. For example, if an access key is required, the key can be configured as a custom parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customParameters) */ customParameters: any; /** * The service mode for the WMTS layer. If not specified, the API will first make a getCapabilities request using `RESTful`. If that fails, it will try using `KVP`. **Possible Values:** RESTful | KVP - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#serviceMode) - * + * * @default RESTful */ serviceMode: string; /** * A collection of [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers) */ sublayers: Collection; /** * The URL of the WMTS service. The URL for the GetCapabilities is created based on the url and serviceMode properties. For example https://gibs.earthdata.nasa.gov/wmts/epsg4326/best. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#url) */ url: string; /** * Version of the [WMTS specification](http://www.opengeospatial.org/standards/wmts) to use. Probably `1.0.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#version) */ version: string; /** * Returns a [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) based on the given sublayer id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#findSublayerById) - * + * * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) of the WMTS sublayer. - * + * */ findSublayerById(id: string): WMTSSublayer; - on(name: "layerview-create", eventHandler: WMTSLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: WMTSLayerLayerviewDestroyEventHandler): IHandle; } interface WMTSLayerConstructor { - - - new(properties?: WMTSLayerProperties): WMTSLayer; + new (properties?: WMTSLayerProperties): WMTSLayer; fromJSON(json: any): WMTSLayer; } export const WMTSLayer: WMTSLayerConstructor; - interface WMTSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface WMTSLayerProperties + extends LayerProperties, + PortalLayerProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { /** * Currently active sublayer. Defaults to the first sublayer in [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#activeLayer) */ activeLayer?: WMTSSublayerProperties; /** * Copyright information for the WMTS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#copyright) */ copyright?: string; /** * Use this to append different custom parameters to the WMTS tile requests. The custom layer parameters are applied to GetTile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customLayerParameters) */ customLayerParameters?: any; /** * Use this to append custom parameters to all WMTS requests. The custom parameters are applied to GetCapabilities and GetTile. For example, if an access key is required, the key can be configured as a custom parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customParameters) */ customParameters?: any; /** * The service mode for the WMTS layer. If not specified, the API will first make a getCapabilities request using `RESTful`. If that fails, it will try using `KVP`. **Possible Values:** RESTful | KVP - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#serviceMode) - * + * * @default RESTful */ serviceMode?: string; /** * A collection of [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The URL of the WMTS service. The URL for the GetCapabilities is created based on the url and serviceMode properties. For example https://gibs.earthdata.nasa.gov/wmts/epsg4326/best. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#url) */ url?: string; /** * Version of the [WMTS specification](http://www.opengeospatial.org/standards/wmts) to use. Probably `1.0.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#version) */ version?: string; } export interface WMTSLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface WMTSLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -14780,13 +15395,13 @@ declare namespace __esri { interface Map extends Accessor, LayersMixin { /** * A flat collection of all the [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) in the map. This collection contains [basemap layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground). [Group Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) and their [children layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#layers) are also part of this collection. Reference layers in the basemap will always be included at the end of the collection. Layers should not be added directly to this collection. They must only be added via the [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers), [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#allLayers) */ readonly allLayers: Collection; /** - * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context 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) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. - * + * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context 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) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * * Value | Description * ------|------------ * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) @@ -14806,8 +15421,8 @@ declare namespace __esri { * 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; @@ -14815,10 +15430,10 @@ declare namespace __esri { * 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) */ ground: Ground; @@ -14827,19 +15442,19 @@ declare namespace __esri { interface MapConstructor { /** * The Map class contains properties and methods for storing, managing, and overlaying [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) common to both 2D and 3D viewing. Layers can be added and removed from the map, but are rendered via a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) (for viewing data in 2D) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) (for viewing data in 3D). Thus a map instance is a simple container that holds the layers, while the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is the means of displaying and interacting with a map's layers and basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) */ - new(properties?: MapProperties): Map; + new (properties?: MapProperties): Map; } export const Map: MapConstructor; interface MapProperties extends LayersMixinProperties { /** - * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context 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) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. - * + * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context 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) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * * Value | Description * ------|------------ * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) @@ -14859,8 +15474,8 @@ declare namespace __esri { * 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; @@ -14868,10 +15483,10 @@ declare namespace __esri { * 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) */ ground?: GroundProperties | string; @@ -14879,99 +15494,199 @@ declare namespace __esri { /** * A convenience module for importing [PointCloudRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing renderers one at a time like this: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html) */ - interface pointCloudRenderers { + namespace pointCloudRenderers { + /** + * Renderer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudRenderer) + */ + export type PointCloudRenderer = + | __esri.PointCloudClassBreaksRenderer + | __esri.PointCloudRGBRenderer + | __esri.PointCloudStretchRenderer + | __esri.PointCloudUniqueValueRenderer; + + /** + * PointCloudClassBreaksRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudClassBreaksRenderer) + */ + export type PointCloudClassBreaksRenderer = __esri.PointCloudClassBreaksRenderer; + export const PointCloudClassBreaksRenderer: typeof __esri.PointCloudClassBreaksRenderer; + + /** + * PointCloudRGBRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudRGBRenderer) + */ + export type PointCloudRGBRenderer = __esri.PointCloudRGBRenderer; + export const PointCloudRGBRenderer: typeof __esri.PointCloudRGBRenderer; + + /** + * PointCloudStretchRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudStretchRenderer) + */ + export type PointCloudStretchRenderer = __esri.PointCloudStretchRenderer; + export const PointCloudStretchRenderer: typeof __esri.PointCloudStretchRenderer; + + /** + * PointCloudUniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudUniqueValueRenderer) + */ + export type PointCloudUniqueValueRenderer = __esri.PointCloudUniqueValueRenderer; + export const PointCloudUniqueValueRenderer: typeof __esri.PointCloudUniqueValueRenderer; } - export const pointCloudRenderers: pointCloudRenderers; + /** + * PointCloudClassBreaksRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudClassBreaksRenderer) + */ + export type pointCloudRenderersPointCloudClassBreaksRenderer = PointCloudClassBreaksRenderer; + + /** + * Renderer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudRenderer) + */ + export type pointCloudRenderersPointCloudRenderer = + | PointCloudClassBreaksRenderer + | PointCloudRGBRenderer + | PointCloudStretchRenderer + | PointCloudUniqueValueRenderer; + + /** + * PointCloudRGBRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudRGBRenderer) + */ + export type pointCloudRenderersPointCloudRGBRenderer = PointCloudRGBRenderer; + + /** + * PointCloudStretchRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudStretchRenderer) + */ + export type pointCloudRenderersPointCloudStretchRenderer = PointCloudStretchRenderer; + + /** + * PointCloudUniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudUniqueValueRenderer) + */ + export type pointCloudRenderersPointCloudUniqueValueRenderer = PointCloudUniqueValueRenderer; 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/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) */ actions: Collection; /** - * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. - * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. These values are referenced via placeholders. Within the string, placeholders are denoted by `{fieldName}` or `{expression/expressionName}` which are used to specify which values from field attributes or expressions to display within certain locations in the string. When the application runs, substitution occurs and the placeholder is replaced with the actual attribute or expression value for the selected feature. The string can also include HTML markup and formatting functions. - * * **Popup elements** - You can also display content as popup elements defined as an array of Objects. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. - * * **text** - Object that provides descriptive text as content. This object must be defined using the [text popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text). - * * **media** - Array of objects used to display media such as charts and/or images. This object must be defined using the [media popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media). - * * **fields** - Array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) objects. If `fieldInfos` is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. This must be defined using the [fields popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields). - * * **attachments** - Array of attachmentInfos objects listed in the popup. This object must be defined using the [attachments popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments). + * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. + * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. + * * **Popup elements** - You can also display content as popup elements. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. + * * **text** - A [TextContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html) that provides descriptive text as content. + * * **media** - A [MediaContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html) that is used to display media such as [charts](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html) and/or [images](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html). + * * **fields** - A [FieldsContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html). that contains the fields to display within the content. If this is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. + * * **attachments** - A [AttachmentsContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html) that contains attachments associated with the feature. * * **promise** - The PopupTemplate's content may also be defined with a promise that resolves to any of the above-mentioned elements. This is useful for cases when you run a task or execute a query and want to display the results in the popup. Simply pass the promise to the popupTemplate's content and ensure that it resolves to a string or other popup element. * * **function** - Content may be defined with a JavaScript function that returns any of the above-mentioned elements. This is handy when your popup requires additional processing or functionality than what is provided with the four content types listed above. For example, let’s assume that you would like to display charts using third-party JavaScript libraries or categorize information into separate tabs. In these cases, you can use a function that returns either a string, a reference to an HTML element, a popup element, or a promise. When the feature is clicked, the feature is passed as an argument to the function and provides access to the feature’s graphic and attributes. The function then executes and returns a value to display in the popup template. It is also possible to check a specific feature attribute and determine whether to apply a function based on its value. Out-of-the-box formatting functions can be used to format date, time, and number values. The syntax for using an out-of-the-box formatting function is: `{field-name:format-function-name(option-a: value, option-b: value)}` - * - * - * The formatter functions are described below: - * + * + * + * The formatter functions are described below: + * * Type | Description * ----- | ----------- * DateString | Formats the date into a human-readable format. Supports the following options: `hideTime: false` - When `true` shows time. Default value is `false`. `local: false` - Displays date and time in the local time zone. Default value is `false`. When `false` the date will display in UTC. `systemLocale: false` - Displays date and time in the system locale (local time zone). Default value is `false`. * DateFormat | Converts date fields into a human-readable format using [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html) method. Supports the same options as [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html). The following snippets show some usage examples: `{DATE_FIELD:DateFormat}` produces `3/8/08 4:00 PM`. `{DATE_FIELD:DateFormat(selector: 'date', fullYear: true)}` produces `4/8/2009`. * NumberFormat | Formats numbers into various formats using the [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format) method. Supports the same set of options as [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format). The following snippets show examples of usage pattern examples: `{Magnitude:NumberFormat}` produces `4.23456`. `{Magnitude:NumberFormat(places:2)}` produces `4.23`. - * + * * Out-of-the-box formatting functions and custom functions are supported as of version 4.1. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) */ - content: string | any[] | Function | IPromise; + content: ContentElementContentElement | ContentElementContentElement[] | string | Function | IPromise; /** - * An array of objects that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. These expressions evaluate to either a number or a string value on a feature-by-feature basis at runtime. The values display within the view's popup as if they are field values. They can be displayed in a table using the `fieldInfos` of the popupTemplate's content or referenced within a simple string. See the object specification table below for a description of the properties that may be set in each object. - * + * An array of objects or [ExpressionInfo[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html) that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) */ - expressionInfos: PopupTemplateExpressionInfos[]; + expressionInfos: ExpressionInfo[]; /** - * An array of objects that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object contains properties for a single field or expression. See the object specification table below for available options to set on each field. - * + * An array of [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) contains properties for a single field or expression. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) */ - fieldInfos: PopupTemplateFieldInfos[]; + fieldInfos: FieldInfo[]; /** - * Additional options that can be defined for the popup layer. Currently supports one property, `showNoDataRecords`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) - * - * @default null + * Indicates whether or not editor tracking should display. ![popupTemplate-showLastEditInfo](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/410/showlasteditinfo.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#lastEditInfoEnabled) + * + * @default true */ - layerOptions: PopupTemplateLayerOptions; + lastEditInfoEnabled: boolean; + /** + * Additional options that can be defined for the popup layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) + */ + layerOptions: LayerOptions; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions) - * + * * @default false */ overwriteActions: boolean; + /** + * The `RelatedRecordsInfo` class provides additional sorting options when working with related records in a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#relatedRecordsInfo) + */ + relatedRecordsInfo: RelatedRecordsInfo; /** * The template for defining how to format the title used in a popup. You can format the title by specifying either a string value or a function that returns a simple string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#title) */ title: string | Function; + + /** + * Creates a deep clone of the PopupTemplate object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#clone) + * + * + */ + clone(): PopupTemplate; } interface PopupTemplateConstructor { /** * A PopupTemplate formats and defines the content of a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for a specific [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) or [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). A PopupTemplate allows the user to access values from feature attributes and values returned from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions when a feature in the view is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) */ - new(properties?: PopupTemplateProperties): PopupTemplate; + new (properties?: PopupTemplateProperties): PopupTemplate; fromJSON(json: any): PopupTemplate; } @@ -14981,779 +15696,554 @@ 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/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) */ actions?: CollectionProperties; /** - * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. - * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. These values are referenced via placeholders. Within the string, placeholders are denoted by `{fieldName}` or `{expression/expressionName}` which are used to specify which values from field attributes or expressions to display within certain locations in the string. When the application runs, substitution occurs and the placeholder is replaced with the actual attribute or expression value for the selected feature. The string can also include HTML markup and formatting functions. - * * **Popup elements** - You can also display content as popup elements defined as an array of Objects. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. - * * **text** - Object that provides descriptive text as content. This object must be defined using the [text popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text). - * * **media** - Array of objects used to display media such as charts and/or images. This object must be defined using the [media popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media). - * * **fields** - Array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) objects. If `fieldInfos` is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. This must be defined using the [fields popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields). - * * **attachments** - Array of attachmentInfos objects listed in the popup. This object must be defined using the [attachments popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments). + * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. + * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. + * * **Popup elements** - You can also display content as popup elements. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. + * * **text** - A [TextContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html) that provides descriptive text as content. + * * **media** - A [MediaContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html) that is used to display media such as [charts](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html) and/or [images](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html). + * * **fields** - A [FieldsContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html). that contains the fields to display within the content. If this is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. + * * **attachments** - A [AttachmentsContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html) that contains attachments associated with the feature. * * **promise** - The PopupTemplate's content may also be defined with a promise that resolves to any of the above-mentioned elements. This is useful for cases when you run a task or execute a query and want to display the results in the popup. Simply pass the promise to the popupTemplate's content and ensure that it resolves to a string or other popup element. * * **function** - Content may be defined with a JavaScript function that returns any of the above-mentioned elements. This is handy when your popup requires additional processing or functionality than what is provided with the four content types listed above. For example, let’s assume that you would like to display charts using third-party JavaScript libraries or categorize information into separate tabs. In these cases, you can use a function that returns either a string, a reference to an HTML element, a popup element, or a promise. When the feature is clicked, the feature is passed as an argument to the function and provides access to the feature’s graphic and attributes. The function then executes and returns a value to display in the popup template. It is also possible to check a specific feature attribute and determine whether to apply a function based on its value. Out-of-the-box formatting functions can be used to format date, time, and number values. The syntax for using an out-of-the-box formatting function is: `{field-name:format-function-name(option-a: value, option-b: value)}` - * - * - * The formatter functions are described below: - * + * + * + * The formatter functions are described below: + * * Type | Description * ----- | ----------- * DateString | Formats the date into a human-readable format. Supports the following options: `hideTime: false` - When `true` shows time. Default value is `false`. `local: false` - Displays date and time in the local time zone. Default value is `false`. When `false` the date will display in UTC. `systemLocale: false` - Displays date and time in the system locale (local time zone). Default value is `false`. * DateFormat | Converts date fields into a human-readable format using [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html) method. Supports the same options as [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html). The following snippets show some usage examples: `{DATE_FIELD:DateFormat}` produces `3/8/08 4:00 PM`. `{DATE_FIELD:DateFormat(selector: 'date', fullYear: true)}` produces `4/8/2009`. * NumberFormat | Formats numbers into various formats using the [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format) method. Supports the same set of options as [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format). The following snippets show examples of usage pattern examples: `{Magnitude:NumberFormat}` produces `4.23456`. `{Magnitude:NumberFormat(places:2)}` produces `4.23`. - * + * * Out-of-the-box formatting functions and custom functions are supported as of version 4.1. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) */ - content?: string | any[] | Function | IPromise; + content?: + | ContentElementContentElementProperties + | ContentElementContentElementProperties[] + | string + | Function + | IPromise; /** - * An array of objects that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. These expressions evaluate to either a number or a string value on a feature-by-feature basis at runtime. The values display within the view's popup as if they are field values. They can be displayed in a table using the `fieldInfos` of the popupTemplate's content or referenced within a simple string. See the object specification table below for a description of the properties that may be set in each object. - * + * An array of objects or [ExpressionInfo[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html) that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) */ - expressionInfos?: PopupTemplateExpressionInfos[]; + expressionInfos?: ExpressionInfoProperties[]; /** - * An array of objects that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object contains properties for a single field or expression. See the object specification table below for available options to set on each field. - * + * An array of [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) contains properties for a single field or expression. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) */ - fieldInfos?: PopupTemplateFieldInfos[]; + fieldInfos?: FieldInfoProperties[]; /** - * Additional options that can be defined for the popup layer. Currently supports one property, `showNoDataRecords`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) - * - * @default null + * Indicates whether or not editor tracking should display. ![popupTemplate-showLastEditInfo](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/410/showlasteditinfo.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#lastEditInfoEnabled) + * + * @default true */ - layerOptions?: PopupTemplateLayerOptions; + lastEditInfoEnabled?: boolean; + /** + * Additional options that can be defined for the popup layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) + */ + layerOptions?: LayerOptionsProperties; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions) - * + * * @default false */ overwriteActions?: boolean; + /** + * The `RelatedRecordsInfo` class provides additional sorting options when working with related records in a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#relatedRecordsInfo) + */ + relatedRecordsInfo?: RelatedRecordsInfoProperties; /** * The template for defining how to format the title used in a popup. You can format the title by specifying either a string value or a function that returns a simple string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#title) */ title?: string | Function; } - /** - * 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) - */ - export interface Attachments extends Object { - /** - * **Required.** The type of popup element to display. To list attachments, set this to `attachments`. The attachmentInfos are queried from the service and will list within the popup. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments) - */ - type: string; - } - - /** - * 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) - */ - export interface Fields extends Object { - /** - * **Required.** The type of popup element to display. To display tabular field data, set this to `fields`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) - */ - type: string; - /** - * Object array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos). If the `fieldInfos` property is not provided directly within the content, the popup will display whatever is set directly in the `PopupTemplate.fieldInfos`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) - */ - fieldInfos: any[]; - } - - /** - * 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) - */ - export interface Media extends Object { - /** - * **Required.** The type of popup element to display. To display charts or images, set this to `media`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - type: string; - /** - * **Required.** Object array of mediaInfos representing images or charts for display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - mediaInfos: MediaMediaInfos[]; - } - - - export interface PopupTemplateExpressionInfos extends Object { - /** - * The name of the expression. This is used to reference the value of the given `expression` in the popupTemplate's [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) property by wrapping it in curly braces and prefacing it with `expression/` (e.g. `{expression/expressionName}`). See the code snippets below for more examples. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) - */ - name: string; - /** - * The title used to describe the value returned by the expression in the popup. This will display if the value is referenced in a `fieldInfos` table. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) - */ - title?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) - */ - expression: string; - /** - * Indicates the return type of the Arcade expression. This is an optional property. **Possible Values:** string | number - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) - */ - returnType?: string; - } - - - export interface PopupTemplateFieldInfos extends Object { - /** - * **Required.** The field name as defined by the service or the `name` of an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. Arcade expression names are defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. When referencing Arcade expressions, you must preface the name with `expression/`, such as `expression/percent-total`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - fieldName: string; - /** - * An object used with numerical or date fields to provide more detail about how the value should be displayed in a popup. When formatting Number fields, you must set both the `digitSeparator` and `places` properties for the formatting to take effect. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - format?: PopupTemplateFieldInfosFormat; - /** - * The field alias to display in place of the `fieldName` in the popup. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - label?: string; - /** - * For editable popups, defines the text box format. **Possible Values:** rich-text | text-area | text-box - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - stringFieldOption?: string; - /** - * Defines a tooltip for editable popup fields. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - tooltip?: string; - /** - * Defines whether the field is visible in the popup. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - visible?: boolean; - } - - - export interface PopupTemplateFieldInfosFormat extends Object { - /** - * Used only with Date fields. Specifies how the date should appear in a popup. **Possible Values:** short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - dateFormat?: string; - /** - * Used only with Number fields. A value of `true` indicates the number should have a digit (or thousands) separator when the value appears in popups. A value of `false` means that no separator will be used. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - digitSeparator?: boolean; - /** - * Used only with Number fields to specify the number of supported decimal places that should appear in popups. Any places beyond this value are rounded. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - places?: number; - } - - - export interface PopupTemplateLayerOptions extends Object { - /** - * Applicable to [Imagery Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). Indicates whether records without data should display within the popup. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) - */ - showNoDataRecords: boolean; - } - - /** - * 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) - */ - export interface Text extends Object { - /** - * **Required.** The type of popup element to display. For descriptive text, set this to `text`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) - */ - type: string; - /** - * **Required.** The formatted string content to display. This may contain a field name enclosed in `{}`, such as `{FIELDNAME}`, or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression name, referenced as `{expression/EXPRESSIONNAME}`. Text content may also leverage HTML tags such as ``, `

`, and `
` for formatting the look and feel of the content. To use this element, set the `type` property to `text`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) - */ - text: string; - } - - - export interface MediaMediaInfos extends Object { - /** - * Defines the media title. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - title: string; - /** - * Defines a caption for the media. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - caption: string; - /** - * **Since: 4.5** Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of `0` indicates auto refresh is not enabled. If the property does not exist, it is equivalent to having a value of `0`. Only applicable when `type` is set to `image`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - refreshInterval: number; - /** - * Defines the media type. **Possible Values:** image | pie-chart | bar-chart | column-chart | line-chart - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - type: string; - /** - * Defines the value format. This depends on the media type. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - value: MediaMediaInfosValue; - } - - - export interface MediaMediaInfosValue extends Object { - /** - * Use this for image values. It defines the sourceURL pointing to the image. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - sourceURL: string; - /** - * Used for chart values. An array of strings indicating field names from the specified layer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - fields: string[]; - /** - * Used for chart values. A field used to normalize data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - normalizationField: string; - /** - * Used for chart values. Defines a new dojo theme, only valid for chart types. View the [Dojox Charting Theme Preview](https://download.dojotoolkit.org/release-1.10.0/dojo-release-1.10.0/dojox/charting/tests/theme_preview.html) to see some of the theme options. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - theme: string; - /** - * Used for chart values. Defines the tooltip display field that displays when hovering over the chart. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - tooltipField: string; - } - interface Portal extends Accessor, Loadable { /** * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Possible Values:** public | private - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#access) */ access: string; /** * When `true`, access to the organization's Portal resources must occur over SSL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#allSSL) */ allSSL: boolean; /** - * The authentication mode for handling authentication when the user attempts to access a secure resource. - * + * The authentication mode for handling authentication when the user attempts to access a secure resource. + * * Possible Value | Description * ---------------|------------ * anonymous | An error will be returned when a secure resource is requested. * auto | The user will be signed in when a secure resource is requested. * immediate | The user will be signed in when the Portal is loaded. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authMode) - * + * * @default auto */ authMode: string; /** * Array of trusted servers to send credentials to when making Cross-Origin Resource Sharing (CORS) requests to access services secured with web-tier authentication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authorizedCrossOriginDomains) */ authorizedCrossOriginDomains: string[]; /** * The query that defines the basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is not true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery) */ basemapGalleryGroupQuery: string; /** * The Bing key to use for web maps using Bing Maps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#bingKey) */ bingKey: string; /** * Indicates whether an organization can list applications in the marketplace . - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListApps) */ canListApps: boolean; /** * Indicates whether an organization can list data services in the marketplace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListData) */ canListData: boolean; /** * Indicates whether an organization can list pre-provisioned items in the marketplace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListPreProvisionedItems) */ canListPreProvisionedItems: boolean; /** * Indicates whether an organization can provision direct purchases in the marketplace without customer request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canProvisionDirectPurchase) */ canProvisionDirectPurchase: boolean; /** * 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; /** * The Bing key can be shared to the public and is returned as part of a portal's description call (`/sharing/rest/portals/`). This requires the access of the portal to be set to public. The canShareBingPublic property is not returned publicly but only shown to users within the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canShareBingPublic) - * + * * @default false */ canShareBingPublic: boolean; /** * When `true`, members of the organization can share resources outside the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSharePublic) - * + * * @default false */ canSharePublic: boolean; /** * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the ArcGIS sign in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInArcGIS) - * + * * @default false */ canSignInArcGIS: boolean; /** * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the enterprise sign in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInIDP) - * + * * @default false */ canSignInIDP: boolean; /** * The query that identifies the group containing the color sets used for rendering in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#colorSetsGroupQuery) */ colorSetsGroupQuery: string; /** * Indicates whether to allow the organization to disable commenting. When commentsEnabled is false, comments are hidden and not removed. numComments are set to zero for all items in the organization. Calls to add a comment and view comments will fail. If the organization re-enables comments, the comments display and numComments are restored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#commentsEnabled) - * + * * @default false */ commentsEnabled: boolean; /** * Date the organization was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#created) */ created: Date; /** * The default locale (language and country) information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#culture) */ culture: string; /** * The custom base URL for the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#customBaseUrl) */ customBaseUrl: string; /** * The default basemap to use for the portal. Used in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap) */ defaultBasemap: Basemap; /** * The default extent to use for the portal. Used in the map viewer. The extent will be in the default basemap's spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultExtent) */ defaultExtent: Extent; /** * The default vector basemap to use for the portal. Used in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) */ defaultVectorBasemap: Basemap; /** * A description of the organization/portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#description) */ description: string; /** * Boolean value indicating whether to opt-in to the [Esri User Experience Improvement (EUEI) program](https://doc.arcgis.com/en/arcgis-online/reference/faq.htm#ESRI_QUESTIONANSWER_AED97F28DCD84F7682623C2FA9E5CE49). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#eueiEnabled) - * + * * @default false */ eueiEnabled: boolean; /** * The featured groups for the portal. Returns an array of objects that provide access to the owner and title for each featured group. Each item in this array has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) */ featuredGroups: PortalFeaturedGroups[]; /** * The query that defines the featured group. If null, then the most viewed items in the organization will be the featured items. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredItemsGroupQuery) */ featuredItemsGroupQuery: string; /** * The query that identifies the group containing features items for the gallery. Set a Group ID or, if null, then the most viewed items in your organization are displayed in the gallery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#galleryTemplatesGroupQuery) */ galleryTemplatesGroupQuery: string; /** * Indicates whether the organization has content categories. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#hasCategorySchema) - * + * * @default false */ hasCategorySchema: boolean; /** * Helper services provided by the portal. For the detailed information about these services, see the [about utility services](https://server.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm) topic from the ArcGIS Server documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#helperServices) */ helperServices: any; /** * The group that contains featured content to be displayed on the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContent) */ homePageFeaturedContent: string; /** * The number of featured items that can be displayed on the home page. The max is 100. Accepts integers only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContentCount) */ homePageFeaturedContentCount: number; /** * The port used by the portal for HTTP communication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpPort) */ httpPort: number; /** * The port used by the portal for HTTPS communication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpsPort) */ httpsPort: number; /** * The id of the organization that owns this portal. If `null` then this is the default portal for anonymous and non-organizational users. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#id) */ id: string; /** * The country code of the calling IP (ArcGIS Online only). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#ipCntryCode) */ ipCntryCode: string; /** * Indicates whether the portal is an organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isOrganization) */ readonly isOrganization: boolean; /** * Indicates if the portal is on-premises. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isPortal) */ isPortal: boolean; /** * The query that identifies the group containing editing templates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#layerTemplatesGroupQuery) */ layerTemplatesGroupQuery: string; /** * Indicates whether the portal's resources have loaded. When `true`, all the properties of the object can be accessed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The maximum validity in minutes of tokens issued for users of the organization. -1 is the default and is a special value that indicates infinite timeout or permanent tokens. For tokens granted using OAuth 2.0 authorization grant, it represents the maximum validity of refresh tokens. For access tokens, the maximum validity is the lower of two weeks or this value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#maxTokenExpirationMinutes) */ maxTokenExpirationMinutes: number; /** * Date the organization was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#modified) */ modified: Date; /** * Name of the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#name) */ name: string; /** * URL of the portal host. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalHostname) */ portalHostname: string; /** * The portal mode. **Possible Values:** multitenant | singletenant - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) */ portalMode: string; /** * Properties specific to the organization, for example the "contact us" link. If the organization is public, the properties are visible to the anonymous user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalProperties) */ portalProperties: any; /** * The region for the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region) */ region: string; /** * The REST URL for the portal, for example "https://www.arcgis.com/sharing/rest" for ArcGIS Online and "https://www.example.com/arcgis/sharing/rest" for your in-house portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#restUrl) */ readonly restUrl: string; /** * Custom HTML for the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#rotatorPanels) */ rotatorPanels: any[]; /** * Indicates whether the description of your organization displays on the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#showHomePageDescription) */ showHomePageDescription: boolean; /** * Indicates whether hosted services are supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#supportsHostedServices) - * + * * @default false */ supportsHostedServices: boolean; /** * The query that defines the symbols sets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#symbolSetsGroupQuery) */ symbolSetsGroupQuery: string; /** * The query that defines the collection of templates that will appear in the template gallery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#templatesGroupQuery) */ templatesGroupQuery: string; /** * The URL to the thumbnail of the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#thumbnailUrl) */ readonly thumbnailUrl: string; /** * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Possible Values:** english | metric - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#units) */ units: string; /** * The URL to the portal instance. Setting the location of the portal instance via [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) should be used in favor of setting it directly on this property. If using an on-premise portal, the syntax should look similar to: `https://www.example.com/arcgis` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#url) - * + * * @default {@link module:esri/config#portalUrl esriConfig.portalUrl} */ url: string; /** * The prefix selected by the organization's administrator to be used with the customBaseURL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#urlKey) */ urlKey: string; /** * Information representing a registered user of the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#user) */ user: PortalUser; /** * When `true`, only simple where clauses that are compliant with SQL92 can be used when querying layers and tables. The recommended security setting is true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useStandardizedQuery) */ useStandardizedQuery: boolean; /** * When `true`, the organization has opted in to use the vector tile basemaps, and (a) [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) should be used instead of [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery), while (b) [defaultVectorBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) should be used instead of [defaultBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap). The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method automatically uses vectorBasemapGalleryGroupQuery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) */ useVectorBasemaps: boolean; /** * The query that defines the vector tiles basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) */ vectorBasemapGalleryGroupQuery: string; /** * Fetches the [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) that are displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html). When [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is `true`, the basemaps will be based on [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery), and otherwise on [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) - * + * * @param basemapGalleryGroupQuery When provided, this argument is used to fetch basemaps based on input query parameters. - * + * */ fetchBasemaps(basemapGalleryGroupQuery?: string): IPromise; /** * If present, fetches the organization's category schema. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchCategorySchema) - * - * + * + * */ fetchCategorySchema(): IPromise; /** * Fetches the featured groups in the Portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchFeaturedGroups) - * - * + * + * */ fetchFeaturedGroups(): IPromise; /** * Fetches and returns the associated regions with the portal instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchRegions) - * - * + * + * */ fetchRegions(): IPromise; /** * Executes a query against the Portal to return an array of [PortalGroup](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryGroups) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). - * + * */ queryGroups(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; /** * Executes a query against the Portal to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). - * + * */ queryItems(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; /** * Executes a query against the Portal to return an array of [PortalUser](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryUsers) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). - * + * */ queryUsers(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; } @@ -15761,19 +16251,18 @@ declare namespace __esri { interface PortalConstructor { /** * The Portal class is part of the [ArcGIS Enterprise portal](https://enterprise.arcgis.com/en/portal/) that provides a way to build applications that work with content from [ArcGIS Online](http://www.arcgis.com/home/) or an [ArcGIS Enterprise portal](https://enterprise.arcgis.com/en/portal/). [ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/) is software from Esri that customers can deploy either on-premises or in the cloud. [ArcGIS Online](http://www.arcgis.com/home/) is Esri's Software as a Service offering that represents GIS as a Service and is implemented using the same technology as ArcGIS Enterprise. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) */ - new(properties?: PortalProperties): Portal; - + new (properties?: PortalProperties): Portal; /** * Returns a cached default Portal instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#getDefault) - * - * + * + * */ getDefault(): Portal; } @@ -15783,388 +16272,387 @@ declare namespace __esri { interface PortalProperties extends LoadableProperties { /** * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Possible Values:** public | private - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#access) */ access?: string; /** * When `true`, access to the organization's Portal resources must occur over SSL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#allSSL) */ allSSL?: boolean; /** - * The authentication mode for handling authentication when the user attempts to access a secure resource. - * + * The authentication mode for handling authentication when the user attempts to access a secure resource. + * * Possible Value | Description * ---------------|------------ * anonymous | An error will be returned when a secure resource is requested. * auto | The user will be signed in when a secure resource is requested. * immediate | The user will be signed in when the Portal is loaded. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authMode) - * + * * @default auto */ authMode?: string; /** * Array of trusted servers to send credentials to when making Cross-Origin Resource Sharing (CORS) requests to access services secured with web-tier authentication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authorizedCrossOriginDomains) */ authorizedCrossOriginDomains?: string[]; /** * The query that defines the basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is not true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery) */ basemapGalleryGroupQuery?: string; /** * The Bing key to use for web maps using Bing Maps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#bingKey) */ bingKey?: string; /** * Indicates whether an organization can list applications in the marketplace . - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListApps) */ canListApps?: boolean; /** * Indicates whether an organization can list data services in the marketplace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListData) */ canListData?: boolean; /** * Indicates whether an organization can list pre-provisioned items in the marketplace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListPreProvisionedItems) */ canListPreProvisionedItems?: boolean; /** * Indicates whether an organization can provision direct purchases in the marketplace without customer request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canProvisionDirectPurchase) */ canProvisionDirectPurchase?: boolean; /** * 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; /** * The Bing key can be shared to the public and is returned as part of a portal's description call (`/sharing/rest/portals/`). This requires the access of the portal to be set to public. The canShareBingPublic property is not returned publicly but only shown to users within the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canShareBingPublic) - * + * * @default false */ canShareBingPublic?: boolean; /** * When `true`, members of the organization can share resources outside the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSharePublic) - * + * * @default false */ canSharePublic?: boolean; /** * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the ArcGIS sign in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInArcGIS) - * + * * @default false */ canSignInArcGIS?: boolean; /** * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the enterprise sign in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInIDP) - * + * * @default false */ canSignInIDP?: boolean; /** * The query that identifies the group containing the color sets used for rendering in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#colorSetsGroupQuery) */ colorSetsGroupQuery?: string; /** * Indicates whether to allow the organization to disable commenting. When commentsEnabled is false, comments are hidden and not removed. numComments are set to zero for all items in the organization. Calls to add a comment and view comments will fail. If the organization re-enables comments, the comments display and numComments are restored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#commentsEnabled) - * + * * @default false */ commentsEnabled?: boolean; /** * Date the organization was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#created) */ created?: DateProperties; /** * The default locale (language and country) information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#culture) */ culture?: string; /** * The custom base URL for the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#customBaseUrl) */ customBaseUrl?: string; /** * The default basemap to use for the portal. Used in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap) */ defaultBasemap?: BasemapProperties; /** * The default extent to use for the portal. Used in the map viewer. The extent will be in the default basemap's spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultExtent) */ defaultExtent?: ExtentProperties; /** * The default vector basemap to use for the portal. Used in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) */ defaultVectorBasemap?: BasemapProperties; /** * A description of the organization/portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#description) */ description?: string; /** * Boolean value indicating whether to opt-in to the [Esri User Experience Improvement (EUEI) program](https://doc.arcgis.com/en/arcgis-online/reference/faq.htm#ESRI_QUESTIONANSWER_AED97F28DCD84F7682623C2FA9E5CE49). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#eueiEnabled) - * + * * @default false */ eueiEnabled?: boolean; /** * The featured groups for the portal. Returns an array of objects that provide access to the owner and title for each featured group. Each item in this array has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) */ featuredGroups?: PortalFeaturedGroups[]; /** * The query that defines the featured group. If null, then the most viewed items in the organization will be the featured items. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredItemsGroupQuery) */ featuredItemsGroupQuery?: string; /** * The query that identifies the group containing features items for the gallery. Set a Group ID or, if null, then the most viewed items in your organization are displayed in the gallery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#galleryTemplatesGroupQuery) */ galleryTemplatesGroupQuery?: string; /** * Indicates whether the organization has content categories. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#hasCategorySchema) - * + * * @default false */ hasCategorySchema?: boolean; /** * Helper services provided by the portal. For the detailed information about these services, see the [about utility services](https://server.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm) topic from the ArcGIS Server documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#helperServices) */ helperServices?: any; /** * The group that contains featured content to be displayed on the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContent) */ homePageFeaturedContent?: string; /** * The number of featured items that can be displayed on the home page. The max is 100. Accepts integers only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContentCount) */ homePageFeaturedContentCount?: number; /** * The port used by the portal for HTTP communication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpPort) */ httpPort?: number; /** * The port used by the portal for HTTPS communication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpsPort) */ httpsPort?: number; /** * The id of the organization that owns this portal. If `null` then this is the default portal for anonymous and non-organizational users. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#id) */ id?: string; /** * The country code of the calling IP (ArcGIS Online only). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#ipCntryCode) */ ipCntryCode?: string; /** * Indicates if the portal is on-premises. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isPortal) */ isPortal?: boolean; /** * The query that identifies the group containing editing templates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#layerTemplatesGroupQuery) */ layerTemplatesGroupQuery?: string; /** * The maximum validity in minutes of tokens issued for users of the organization. -1 is the default and is a special value that indicates infinite timeout or permanent tokens. For tokens granted using OAuth 2.0 authorization grant, it represents the maximum validity of refresh tokens. For access tokens, the maximum validity is the lower of two weeks or this value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#maxTokenExpirationMinutes) */ maxTokenExpirationMinutes?: number; /** * Date the organization was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#modified) */ modified?: DateProperties; /** * Name of the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#name) */ name?: string; /** * URL of the portal host. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalHostname) */ portalHostname?: string; /** * The portal mode. **Possible Values:** multitenant | singletenant - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) */ portalMode?: string; /** * Properties specific to the organization, for example the "contact us" link. If the organization is public, the properties are visible to the anonymous user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalProperties) */ portalProperties?: any; /** * The region for the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region) */ region?: string; /** * Custom HTML for the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#rotatorPanels) */ rotatorPanels?: any[]; /** * Indicates whether the description of your organization displays on the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#showHomePageDescription) */ showHomePageDescription?: boolean; /** * Indicates whether hosted services are supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#supportsHostedServices) - * + * * @default false */ supportsHostedServices?: boolean; /** * The query that defines the symbols sets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#symbolSetsGroupQuery) */ symbolSetsGroupQuery?: string; /** * The query that defines the collection of templates that will appear in the template gallery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#templatesGroupQuery) */ templatesGroupQuery?: string; /** * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Possible Values:** english | metric - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#units) */ units?: string; /** * The URL to the portal instance. Setting the location of the portal instance via [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) should be used in favor of setting it directly on this property. If using an on-premise portal, the syntax should look similar to: `https://www.example.com/arcgis` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#url) - * + * * @default {@link module:esri/config#portalUrl esriConfig.portalUrl} */ url?: string; /** * The prefix selected by the organization's administrator to be used with the customBaseURL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#urlKey) */ urlKey?: string; /** * Information representing a registered user of the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#user) */ user?: PortalUserProperties; /** * When `true`, only simple where clauses that are compliant with SQL92 can be used when querying layers and tables. The recommended security setting is true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useStandardizedQuery) */ useStandardizedQuery?: boolean; /** * When `true`, the organization has opted in to use the vector tile basemaps, and (a) [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) should be used instead of [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery), while (b) [defaultVectorBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) should be used instead of [defaultBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap). The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method automatically uses vectorBasemapGalleryGroupQuery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) */ useVectorBasemaps?: boolean; /** * The query that defines the vector tiles basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) */ vectorBasemapGalleryGroupQuery?: string; } - export interface PortalFeaturedGroups extends Object { /** * Name of the group owner. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) */ owner: string; /** * Group title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) */ title: string; @@ -16173,40 +16661,38 @@ declare namespace __esri { interface PortalFolder extends Accessor { /** * The date the folder was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#created) */ created: Date; /** * The unique id of the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#id) */ id: string; /** * The portal associated with the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#portal) */ portal: Portal; /** * The title of the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#title) */ title: string; /** * The URL to the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#url) */ readonly url: string; } interface PortalFolderConstructor { - - - new(properties?: PortalFolderProperties): PortalFolder; + new (properties?: PortalFolderProperties): PortalFolder; } export const PortalFolder: PortalFolderConstructor; @@ -16214,25 +16700,25 @@ declare namespace __esri { interface PortalFolderProperties { /** * The date the folder was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#created) */ created?: DateProperties; /** * The unique id of the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#id) */ id?: string; /** * The portal associated with the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#portal) */ portal?: PortalProperties; /** * The title of the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#title) */ title?: string; @@ -16241,125 +16727,123 @@ declare namespace __esri { interface PortalGroup extends Accessor { /** * The access privileges on the group which determines who can see and access the group. **Possible Values:** private | org | public - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#access) */ access: string; /** * The date the group was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#created) */ created: Date; /** * A detailed description of the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#description) */ description: string; /** * The unique id for the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#id) */ id: string; /** * If set to `true`, then users will not be able to apply to join the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#isInvitationOnly) - * + * * @default false */ isInvitationOnly: boolean; /** * The date the group was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#modified) */ modified: Date; /** * The username of the group's owner. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#owner) */ owner: string; /** * The portal associated with the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#portal) */ portal: Portal; /** * A short summary that describes the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#snippet) */ snippet: string; /** * User defined tags that describe the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#tags) */ tags: string[]; /** * The URL to the thumbnail used for the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#thumbnailUrl) */ readonly thumbnailUrl: string; /** * The title of the group. This is the name that is displayed to users. It is also used to refer to the group. Every group must have a title and it must be unique. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#title) */ title: string; /** * The URL to the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#url) */ readonly url: string; /** * If present, fetches the group's category schema. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#fetchCategorySchema) - * - * + * + * */ fetchCategorySchema(): IPromise; /** * Fetches the current members of the group. This method is only available to members or administrators of the group. View the ArcGIS REST API documentation for the [Group Users](https://developers.arcgis.com/rest/users-groups-and-items/group-users.htm) for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#fetchMembers) - * - * + * + * */ fetchMembers(): IPromise; /** * Get the URL to the thumbnail image for the group. Available width sizes: 150, 300 and 600. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#getThumbnailUrl) - * + * * @param width The desired image width. - * + * */ getThumbnailUrl(width?: number): string; /** * Executes a query against the group to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). - * + * */ queryItems(queryParams?: PortalQueryParams | PortalQueryParamsProperties): IPromise; } interface PortalGroupConstructor { - - - new(properties?: PortalGroupProperties): PortalGroup; + new (properties?: PortalGroupProperties): PortalGroup; } export const PortalGroup: PortalGroupConstructor; @@ -16367,69 +16851,69 @@ declare namespace __esri { interface PortalGroupProperties { /** * The access privileges on the group which determines who can see and access the group. **Possible Values:** private | org | public - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#access) */ access?: string; /** * The date the group was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#created) */ created?: DateProperties; /** * A detailed description of the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#description) */ description?: string; /** * The unique id for the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#id) */ id?: string; /** * If set to `true`, then users will not be able to apply to join the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#isInvitationOnly) - * + * * @default false */ isInvitationOnly?: boolean; /** * The date the group was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#modified) */ modified?: DateProperties; /** * The username of the group's owner. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#owner) */ owner?: string; /** * The portal associated with the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#portal) */ portal?: PortalProperties; /** * A short summary that describes the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#snippet) */ snippet?: string; /** * User defined tags that describe the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#tags) */ tags?: string[]; /** * The title of the group. This is the name that is displayed to users. It is also used to refer to the group. Every group must have a title and it must be unique. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#title) */ title?: string; @@ -16438,288 +16922,286 @@ declare namespace __esri { interface PortalItem extends Accessor, Loadable, JSONSupport { /** * Indicates the level of access to this item: `private`, `shared`, `org`, or `public`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#access) */ access: string; /** * Information on the source of the item and its copyright status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#accessInformation) */ accessInformation: string; /** * Contains an array of objects containing proxy information for premium platform services. This is most widely seen in registered applications that work with premium and subscriber services, e.g. routing and analysis services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) */ readonly applicationProxies: PortalItemApplicationProxies[]; /** * Average rating. Uses a weighted average called "Bayesian average." - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating) */ avgRating: number; /** * An array of organization categories that are set on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#categories) */ categories: string[]; /** * The date the item was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#created) */ created: Date; /** * The item's locale information (language and country). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#culture) */ culture: string; /** * The detailed description of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#description) */ description: string; /** * The geographic extent, or bounding rectangle, of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent) */ extent: Extent; /** * An array of group categories set on the item. This varies slightly from `categories` as it only returns categories in the group content returned from [PortalGroup.queryItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#groupCategories) */ groupCategories: string[]; /** * The unique id for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#id) */ id: string; /** * Indicates whether a layer can be created from this item using [Layer.fromPortalItem()](esri-layers-Layer.html#fromPortalItem). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#isLayer) */ readonly isLayer: boolean; /** - * Indicates whether an item can be updated and deleted. - * + * Indicates whether an item can be updated and deleted. + * * Possible Value | Description * ---------------|------------ * admin | The item can be updated or deleted. * update | The item can be updated, but not deleted. * null | The item cannot be updated nor deleted. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemControl) */ readonly itemControl: string; /** * The URL to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemUrl) */ readonly itemUrl: string; /** * Information on license or restrictions related to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#licenseInfo) */ licenseInfo: string; /** * Indicates whether the item's resources have loaded from the portal. When `true`, all the properties of the object can be accessed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The date the item was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#modified) */ modified: Date; /** * The name of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#name) */ name: string; /** * Number of comments on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numComments) */ numComments: number; /** * Number of ratings on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numRatings) */ numRatings: number; /** * Number of views on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numViews) */ numViews: number; /** * The username of the user who owns this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#owner) */ owner: string; /** * The portal that contains the item. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). Suggested to use [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) instead of this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) */ portal: Portal; /** * An array of string URLs. These URLs should point to screenshots (i.e. screen captures) associated with an application. An example value could be something similar to `"screenshots/Basic.png"`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#screenshots) - * + * * @default null */ screenshots: string[]; /** * The size of the item (in bytes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#size) */ size: number; /** * A summary description of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#snippet) */ snippet: string; /** * User defined tags that describe the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#tags) */ tags: string[]; /** * The URL to the thumbnail used for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#thumbnailUrl) */ readonly thumbnailUrl: string; /** * The title for the item. This is the name that is displayed to users and used to refer to the item. Every item must have a title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#title) */ title: string; /** * The GIS content type of this item. Example types include Web Map, Map Service, Shapefile, and Web Mapping Application. See the [ArcGIS REST API Items and Items Types Reference](https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm) to get an understanding of the item type hierarchy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#type) */ type: string; /** * Type keywords that describe the type of content of this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#typeKeywords) */ typeKeywords: string[]; /** * The service URL of this item. Only certain layer item types such as "Feature Service", "Map Service", "Image Service", "Scene Service", "WMS" and "KML" have service URLs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#url) */ url: string; /** * Adds a rating to an accessible item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#addRating) - * + * * @param rating Rating to set for the item. Rating must be a number between 1.0 and 5.0. - * + * */ addRating(rating: number | PortalRating): IPromise; /** * Deletes a rating for the specified item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#deleteRating) - * - * + * + * */ deleteRating(): IPromise; /** * Requests a PortalItem in the format specified in `responseType`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchData) - * + * * @param responseType The format of the response. **Possible Values:** json | xml | text | blob | array-buffer | document - * + * */ fetchData(responseType?: string): IPromise; /** * Returns the rating (if any) given to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRating) - * - * + * + * */ fetchRating(): IPromise; /** * Gets all the related items of a certain relationship type for the portal item. An optional direction can be specified if the direction of the relationship is ambiguous. Otherwise, the service will try to infer it. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) - * + * * @param params See the object specifications table below for the parameters that may be passed as properties in this object. * @param params.relationshipType The type of relationship between the two items. See [Relationship types](https://developers.arcgis.com/rest/users-groups-and-items/relationship-types.htm) for a complete listing of types. * @param params.direction The direction of the relationship. Can either be `forward` (from origin to destination) or `reverse` (from destination to origin). **Possible Values:** forward | reverse - * + * */ fetchRelatedItems(params: PortalItemFetchRelatedItemsParams): IPromise; /** * Get the URL to the thumbnail image for the item. Available width sizes: 200, 400, 800 and 2400. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#getThumbnailUrl) - * + * * @param width The desired image width. - * + * */ getThumbnailUrl(width?: number): string; /** * Updates the item's properties to the portal, and optionally its data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) - * + * * @param params See the object specifications table below for the parameters that may be passed as properties in this object. * @param params.data **Optional**. The component used to stream the data represented by the item to the client. - * + * */ update(params?: PortalItemUpdateParams): IPromise; /** * Updates the item's thumbnail on the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#updateThumbnail) - * + * * @param params See the object specification table below for the parameters that may be passed as properties in this object. * @param params.thumbnail A URL, Data URI, Blob, or File. The accepted formats are `GIF`, `JPG`, and `PNG`. - * + * */ updateThumbnail(params: PortalItemUpdateThumbnailParams): IPromise; } interface PortalItemConstructor { - - - new(properties?: PortalItemProperties): PortalItem; + new (properties?: PortalItemProperties): PortalItem; fromJSON(json: any): PortalItem; } @@ -16729,217 +17211,213 @@ declare namespace __esri { interface PortalItemProperties extends LoadableProperties { /** * Indicates the level of access to this item: `private`, `shared`, `org`, or `public`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#access) */ access?: string; /** * Information on the source of the item and its copyright status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#accessInformation) */ accessInformation?: string; /** * Average rating. Uses a weighted average called "Bayesian average." - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating) */ avgRating?: number; /** * An array of organization categories that are set on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#categories) */ categories?: string[]; /** * The date the item was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#created) */ created?: DateProperties; /** * The item's locale information (language and country). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#culture) */ culture?: string; /** * The detailed description of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#description) */ description?: string; /** * The geographic extent, or bounding rectangle, of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent) */ extent?: ExtentProperties; /** * An array of group categories set on the item. This varies slightly from `categories` as it only returns categories in the group content returned from [PortalGroup.queryItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#groupCategories) */ groupCategories?: string[]; /** * The unique id for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#id) */ id?: string; /** * Information on license or restrictions related to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#licenseInfo) */ licenseInfo?: string; /** * The date the item was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#modified) */ modified?: DateProperties; /** * The name of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#name) */ name?: string; /** * Number of comments on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numComments) */ numComments?: number; /** * Number of ratings on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numRatings) */ numRatings?: number; /** * Number of views on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numViews) */ numViews?: number; /** * The username of the user who owns this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#owner) */ owner?: string; /** * The portal that contains the item. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). Suggested to use [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) instead of this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) */ portal?: PortalProperties; /** * An array of string URLs. These URLs should point to screenshots (i.e. screen captures) associated with an application. An example value could be something similar to `"screenshots/Basic.png"`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#screenshots) - * + * * @default null */ screenshots?: string[]; /** * The size of the item (in bytes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#size) */ size?: number; /** * A summary description of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#snippet) */ snippet?: string; /** * User defined tags that describe the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#tags) */ tags?: string[]; /** * The title for the item. This is the name that is displayed to users and used to refer to the item. Every item must have a title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#title) */ title?: string; /** * The GIS content type of this item. Example types include Web Map, Map Service, Shapefile, and Web Mapping Application. See the [ArcGIS REST API Items and Items Types Reference](https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm) to get an understanding of the item type hierarchy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#type) */ type?: string; /** * Type keywords that describe the type of content of this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#typeKeywords) */ typeKeywords?: string[]; /** * The service URL of this item. Only certain layer item types such as "Feature Service", "Map Service", "Image Service", "Scene Service", "WMS" and "KML" have service URLs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#url) */ url?: string; } - export interface PortalItemApplicationProxies extends Object { /** * The URL of the premium map service layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) */ sourceUrl: string; /** * The proxy URL for the source URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) */ proxyUrl: string; /** * The proxy ID registered in ArcGIS Online or ArcGIS Enterprise Portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) */ proxyId: string; } - export interface PortalItemFetchRelatedItemsParams extends Object { /** * The type of relationship between the two items. See [Relationship types](https://developers.arcgis.com/rest/users-groups-and-items/relationship-types.htm) for a complete listing of types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) */ relationshipType: string; /** * The direction of the relationship. Can either be `forward` (from origin to destination) or `reverse` (from destination to origin). **Possible Values:** forward | reverse - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) */ direction?: string; } - export interface PortalItemUpdateParams extends Object { /** * **Optional**. The component used to stream the data represented by the item to the client. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) */ data: string | any; } - export interface PortalItemUpdateThumbnailParams extends Object { /** * A URL, Data URI, Blob, or File. The accepted formats are `GIF`, `JPG`, and `PNG`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#updateThumbnail) */ thumbnail: Blob | string; @@ -16950,37 +17428,37 @@ declare namespace __esri { * An array of categories stored within the item. Use this property to filter the results from [Portal.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) and [PortalGroup.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). It accepts an array of: * * individual string elements or * * an array of strings. - * - * - * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: + * + * + * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: * > Note: String[] elements are only supported by [ArcGIS Online](http://doc.arcgis.com/en/arcgis-online/reference/what-is-agol.htm) and version 10.6.1 of [Portal for ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#categories) */ categories: (string | string[])[]; /** * Only relevant when querying for [PortalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). When specified, restricts the results of the query to the extent defined here. The [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#spatialReference) of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#extent) */ extent: Extent; /** * The maximum number of results to be included in the [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) set response. The maximum value allowed is `100`. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property combined with the `num` property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) - * + * * @default 10 */ num: number; /** * The query string used for the search. View the [ArcGIS REST API Search Reference](https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm) for details on constructing a valid query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#query) */ query: string; /** - * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. - * + * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. + * * Field name | Query functionality * ---------------|------------ * title | search, group @@ -16994,48 +17472,46 @@ declare namespace __esri { * num-ratings | search * num-comments | search * num-views | search - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortField) */ sortField: string; /** - * The order in which to sort the results. - * + * The order in which to sort the results. + * * Possible Value | Description * ---------------|------------ * asc | Sort the results in ascending order. * desc | Sort the results in descending order. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortOrder) - * + * * @default asc */ sortOrder: string; /** * The index of the first entry in the result set response. The index is 1-based. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property, along with the [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) - * + * * @default 1 */ start: number; /** * Creates a deep clone of the instance of PortalQueryParams that calls this method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#clone) - * - * + * + * */ clone(): PortalQueryParams; } interface PortalQueryParamsConstructor { - - - new(properties?: PortalQueryParamsProperties): PortalQueryParams; + new (properties?: PortalQueryParamsProperties): PortalQueryParams; } export const PortalQueryParams: PortalQueryParamsConstructor; @@ -17045,37 +17521,37 @@ declare namespace __esri { * An array of categories stored within the item. Use this property to filter the results from [Portal.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) and [PortalGroup.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). It accepts an array of: * * individual string elements or * * an array of strings. - * - * - * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: + * + * + * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: * > Note: String[] elements are only supported by [ArcGIS Online](http://doc.arcgis.com/en/arcgis-online/reference/what-is-agol.htm) and version 10.6.1 of [Portal for ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#categories) */ categories?: (string | string[])[]; /** * Only relevant when querying for [PortalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). When specified, restricts the results of the query to the extent defined here. The [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#spatialReference) of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#extent) */ extent?: ExtentProperties; /** * The maximum number of results to be included in the [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) set response. The maximum value allowed is `100`. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property combined with the `num` property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) - * + * * @default 10 */ num?: number; /** * The query string used for the search. View the [ArcGIS REST API Search Reference](https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm) for details on constructing a valid query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#query) */ query?: string; /** - * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. - * + * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. + * * Field name | Query functionality * ---------------|------------ * title | search, group @@ -17089,30 +17565,30 @@ declare namespace __esri { * num-ratings | search * num-comments | search * num-views | search - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortField) */ sortField?: string; /** - * The order in which to sort the results. - * + * The order in which to sort the results. + * * Possible Value | Description * ---------------|------------ * asc | Sort the results in ascending order. * desc | Sort the results in descending order. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortOrder) - * + * * @default asc */ sortOrder?: string; /** * The index of the first entry in the result set response. The index is 1-based. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property, along with the [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) - * + * * @default 1 */ start?: number; @@ -17121,34 +17597,32 @@ declare namespace __esri { interface PortalQueryResult extends Accessor { /** * The query parameters for the next set of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#nextQueryParams) */ nextQueryParams: PortalQueryParams; /** * The query parameters for the first set of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#queryParams) */ queryParams: PortalQueryParams; /** * An array of result item objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) */ results: any[]; /** * The total number of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#total) */ total: number; } interface PortalQueryResultConstructor { - - - new(properties?: PortalQueryResultProperties): PortalQueryResult; + new (properties?: PortalQueryResultProperties): PortalQueryResult; } export const PortalQueryResult: PortalQueryResultConstructor; @@ -17156,25 +17630,25 @@ declare namespace __esri { interface PortalQueryResultProperties { /** * The query parameters for the next set of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#nextQueryParams) */ nextQueryParams?: PortalQueryParamsProperties; /** * The query parameters for the first set of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#queryParams) */ queryParams?: PortalQueryParamsProperties; /** * An array of result item objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) */ results?: any[]; /** * The total number of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#total) */ total?: number; @@ -17183,22 +17657,20 @@ declare namespace __esri { interface PortalRating extends Accessor { /** * Date the rating was added to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#created) */ created: Date; /** * A rating between 1.0 and 5.0 for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#rating) */ rating: number; } interface PortalRatingConstructor { - - - new(properties?: PortalRatingProperties): PortalRating; + new (properties?: PortalRatingProperties): PortalRating; } export const PortalRating: PortalRatingConstructor; @@ -17206,13 +17678,13 @@ declare namespace __esri { interface PortalRatingProperties { /** * Date the rating was added to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#created) */ created?: DateProperties; /** * A rating between 1.0 and 5.0 for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#rating) */ rating?: number; @@ -17221,189 +17693,187 @@ declare namespace __esri { interface PortalUser extends Accessor { /** * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Possible Values:** private | org | public - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#access) */ access: string; /** * The date the user was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#created) */ created: Date; /** * The culture information for the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#culture) */ culture: string; /** * A description of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#description) */ description: string; /** * The user's e-mail address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#email) */ email: string; /** * The user's full name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fullName) */ fullName: string; /** * The date the user was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#modified) */ modified: Date; /** * The ID of the organization the user belongs to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#orgId) */ orgId: string; /** * The portal associated with the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#portal) */ portal: Portal; /** * The user's preferred view for content, either web or GIS. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#preferredView) */ preferredView: string; /** * The user preferred region, used to set the featured maps on the home page, content in the gallery, and the default extent of new maps in the Viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#region) */ region: string; /** * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Possible Values:** org_admin | org_publisher | org_user - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) */ role: string; /** * The ID of the user's role. Only set if the user is assigned a custom role. When present, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will indicate the "base" role of the custom role based on the privileges the custom role contains. For example, if the custom role contains some publisher privileges, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will be set to `org_publisher`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) */ roleId: string; /** * The URL to the thumbnail image for the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#thumbnailUrl) */ readonly thumbnailUrl: string; /** * The user's personal units of measure setting. **Possible Values:** english | metric - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#units) */ units: string; /** * The URL for the user's content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#userContentUrl) */ readonly userContentUrl: string; /** * The username of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#username) */ username: string; /** * Adds an item to the user's portal content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) - * + * * @param params See the object specifications table below for the parameters that may be passed as properties in this object. * @param params.item The item to add to the user's content. * @param params.data The component used to stream the data represented by the item to the client. * @param params.folder The portal folder in which to store the item. - * + * */ addItem(params: PortalUserAddItemParams): IPromise; /** * Deletes an item from the user's portal content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#deleteItem) - * + * * @param item The portal item to remove. - * + * */ deleteItem(item: PortalItem): IPromise; /** * Deletes items from the user's portal content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#deleteItems) - * + * * @param items The portal items to remove. - * + * */ deleteItems(items: PortalItem[]): IPromise; /** * Fetches all of the user's folders used to organize portal content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchFolders) - * - * + * + * */ fetchFolders(): IPromise; /** * Fetches all the groups that the portal user has permission to access. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchGroups) - * - * + * + * */ fetchGroups(): IPromise; /** * Retrieves all the items in the specified folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) - * + * * @param params See the object specifications table below for the parameters that may be passed as properties in this object. * @param params.folder The folder to retrieve items from. * @param params.num The maximum number of results to be included in the result set response. The maximum value allowed is 100. The start property combined with the num property can be used to paginate the search results. * @param params.start The index of the first entry in the result set response. The index is 1-based. - * + * */ fetchItems(params?: PortalUserFetchItemsParams): IPromise; /** * Get the URL to the thumbnail image for the user. Available width sizes: 150, 300 and 600. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#getThumbnailUrl) - * + * * @param width The desired image width. - * + * */ getThumbnailUrl(width?: number): string; /** * Executes a query against the user's favorite group to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#queryFavorites) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). This object may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/). - * + * */ queryFavorites(queryParams?: PortalQueryParams): IPromise; } interface PortalUserConstructor { - - - new(properties?: PortalUserProperties): PortalUser; + new (properties?: PortalUserProperties): PortalUser; } export const PortalUser: PortalUserConstructor; @@ -17411,139 +17881,137 @@ declare namespace __esri { interface PortalUserProperties { /** * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Possible Values:** private | org | public - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#access) */ access?: string; /** * The date the user was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#created) */ created?: DateProperties; /** * The culture information for the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#culture) */ culture?: string; /** * A description of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#description) */ description?: string; /** * The user's e-mail address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#email) */ email?: string; /** * The user's full name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fullName) */ fullName?: string; /** * The date the user was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#modified) */ modified?: DateProperties; /** * The ID of the organization the user belongs to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#orgId) */ orgId?: string; /** * The portal associated with the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#portal) */ portal?: PortalProperties; /** * The user's preferred view for content, either web or GIS. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#preferredView) */ preferredView?: string; /** * The user preferred region, used to set the featured maps on the home page, content in the gallery, and the default extent of new maps in the Viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#region) */ region?: string; /** * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Possible Values:** org_admin | org_publisher | org_user - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) */ role?: string; /** * The ID of the user's role. Only set if the user is assigned a custom role. When present, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will indicate the "base" role of the custom role based on the privileges the custom role contains. For example, if the custom role contains some publisher privileges, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will be set to `org_publisher`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) */ roleId?: string; /** * The user's personal units of measure setting. **Possible Values:** english | metric - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#units) */ units?: string; /** * The username of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#username) */ username?: string; } - export interface PortalUserAddItemParams extends Object { /** * The item to add to the user's content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) */ item: PortalItem; /** * The component used to stream the data represented by the item to the client. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) */ data?: string | any; /** * The portal folder in which to store the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) */ folder?: PortalFolder; } - export interface PortalUserFetchItemsParams extends Object { /** * The folder to retrieve items from. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) */ folder?: PortalFolder; /** * The maximum number of results to be included in the result set response. The maximum value allowed is 100. The start property combined with the num property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) - * + * * @default 10 */ num?: number; /** * The index of the first entry in the result set response. The index is 1-based. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) - * + * * @default 1 */ start?: number; @@ -17551,250 +18019,261 @@ declare namespace __esri { /** * A convenience module for importing [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing renderers one at a time like this: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html) */ - interface renderers { + namespace renderers { + /** + * Renderer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#Renderer) + */ + export type Renderer = + | __esri.ClassBreaksRenderer + | __esri.SimpleRenderer + | __esri.UniqueValueRenderer + | __esri.HeatmapRenderer; + + /** + * ClassBreaksRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#ClassBreaksRenderer) + */ + export type ClassBreaksRenderer = __esri.ClassBreaksRenderer; + export const ClassBreaksRenderer: typeof __esri.ClassBreaksRenderer; + + /** + * SimpleRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#SimpleRenderer) + */ + export type SimpleRenderer = __esri.SimpleRenderer; + export const SimpleRenderer: typeof __esri.SimpleRenderer; + + /** + * UniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#UniqueValueRenderer) + */ + export type UniqueValueRenderer = __esri.UniqueValueRenderer; + export const UniqueValueRenderer: typeof __esri.UniqueValueRenderer; + + /** + * HeatmapRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#HeatmapRenderer) + */ + export type HeatmapRenderer = __esri.HeatmapRenderer; + export const HeatmapRenderer: typeof __esri.HeatmapRenderer; } - export const renderers: renderers; - - interface ClassBreaksRenderer extends Renderer, VisualVariablesMixin { + interface ClassBreaksRenderer extends Renderer, VisualVariablesRenderer { /** * When symbolizing polygon features with graduated symbols, set a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) on this property to visualize the boundaries of each feature. Use a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) of varying sizes in the [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) to indicate the quantity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#backgroundFillSymbol) */ backgroundFillSymbol: FillSymbol | PolygonSymbol3D; /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ classBreakInfos: ClassBreaksRendererClassBreakInfos[]; /** - * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. + * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultLabel) + */ + defaultLabel: string; + /** + * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) */ defaultSymbol: Symbol; /** * 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; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) */ legendOptions: ClassBreaksRendererLegendOptions; /** * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `field`, this property contains the attribute field name used for normalization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) */ normalizationField: string; /** * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `percent-of-total`, this property contains the total of all data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) */ normalizationTotal: number; /** - * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the data value using the attribute value of the field specified in the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) property. This value is set by default if the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) to define the total value by which to normalize. This value is set by default if the [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) is provided. - * + * * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) */ normalizationType: string; /** * The type of renderer. For ClassBreaksRenderer this value is always `class-breaks`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#type) */ readonly type: "class-breaks"; /** * 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. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) for data-driven visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) */ 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle) */ valueExpressionTitle: string; - - /** - * Adds a class break to the renderer. You can provide the minimum, maximum and symbol values as individual arguments or by using the info object. The range of the break is greater than or equal to the minimum value and less than the maximum value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#addClassBreakInfo) - * - * @param min The minimum value to use in the break. This can be a number or an info object as defined in [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos). - * @param max The maximum value to use in the break. - * @param symbol Symbol to use for the break. - * - */ - addClassBreakInfo(min: number | any, max: number, symbol: Symbol): void; - /** - * Creates a deep clone of the renderer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#clone) - * - * - */ - clone(): ClassBreaksRenderer; - /** - * Returns the [classBreakInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) information (as defined by the renderer) associated with the given graphic. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#getClassBreakInfo) - * - * @param graphic The graphic whose rendering information will be returned. - * - */ - getClassBreakInfo(graphic: Graphic): any; - /** - * Removes a break from the renderer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#removeClassBreakInfo) - * - * @param min Minimum value in the break to remove - * @param max Maximum value in the break to remove. - * - */ - removeClassBreakInfo(min: number, max: number): void; } interface ClassBreaksRendererConstructor { /** * ClassBreaksRenderer defines the symbol of each feature in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on the value of a numeric attribute. Symbols are assigned based on classes or ranges of data. Each feature is assigned a symbol based on the class break in which the value of the attribute falls. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) */ - new(properties?: ClassBreaksRendererProperties): ClassBreaksRenderer; + new (properties?: ClassBreaksRendererProperties): ClassBreaksRenderer; fromJSON(json: any): ClassBreaksRenderer; } export const ClassBreaksRenderer: ClassBreaksRendererConstructor; - interface ClassBreaksRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + interface ClassBreaksRendererProperties extends RendererProperties, VisualVariablesRendererProperties { /** * When symbolizing polygon features with graduated symbols, set a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) on this property to visualize the boundaries of each feature. Use a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) of varying sizes in the [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) to indicate the quantity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#backgroundFillSymbol) */ backgroundFillSymbol?: FillSymbolProperties | PolygonSymbol3DProperties; /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ classBreakInfos?: ClassBreaksRendererClassBreakInfos[]; /** - * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. + * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultLabel) + */ + defaultLabel?: string; + /** + * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) */ defaultSymbol?: SymbolProperties; /** * 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; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) */ legendOptions?: ClassBreaksRendererLegendOptions; /** * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `field`, this property contains the attribute field name used for normalization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) */ normalizationField?: string; /** * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `percent-of-total`, this property contains the total of all data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) */ normalizationTotal?: number; /** - * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the data value using the attribute value of the field specified in the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) property. This value is set by default if the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) to define the total value by which to normalize. This value is set by default if the [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) is provided. - * + * * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) */ normalizationType?: 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. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) for data-driven visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) */ 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle) */ valueExpressionTitle?: string; } - export interface ClassBreaksRendererClassBreakInfos extends Object { /** * The minimum value of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ minValue: number; /** * The maximum value of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ maxValue: number; /** * The symbol used to style features whose values are between the `minValue` and `maxValue` of the break. This value may be autocast by specifying the symbol `type`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ symbol: Symbol; /** * The label used to describe features in the break 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-ClassBreaksRenderer.html#classBreakInfos) */ label?: string; } - export interface ClassBreaksRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) or [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) */ title: string; @@ -17803,14 +18282,14 @@ declare namespace __esri { interface HeatmapRenderer extends Renderer { /** * The area of influence for each point in the layer. This is defined as a radius in pixels. The default is `10`, which means the pixels within a 10-pixel radius of the point's location are assigned an intensity value corresponding to their distance from the nearby point. Increasing this value creates a larger heatmap with more hotspots. Decreasing it makes a smaller heatmap with fewer hotspots. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius) - * + * * @default 10 */ blurRadius: number; /** - * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: + * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: * ```js * [ * { ratio: 0, color: "rgba(255, 140, 0, 0)" }, @@ -17818,45 +18297,45 @@ declare namespace __esri { * { ratio: 0.9, color: "rgba(255, 0, 0, 1)" } * ] * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) */ colorStops: HeatmapColorStop[]; /** * The name of the attribute field used to weight the intensity of each heatmap point. For example, suppose you have a layer of points representing buildings containing a field `num_units` for the number of units in the building (if it's an apartment complex). You could weight the heatmap renderer based on the `num_units` field to create a heatmap representing the density of housing units in a city. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) */ field: string; /** * The pixel intensity value that determines which pixels are assigned the final color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixelx with intensity values above this number will be assigned the final (or hottest) color in the color ramp. Typically, `minPixelIntensity` will be zero and `maxPixelIntensity` will be set to a high value appropriate for the dataset. The default may not be ideal for your dataset, so this value will likely need to change. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) - * + * * @default 100 */ maxPixelIntensity: number; /** * The pixel intensity value used to determine which pixels will be assigned the initial color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixels with intensity values below this number will be excluded from the visualization. When using a [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) to weight the points, setting `minPixelIntensity` above zero might help to visually deemphasize frequently occurring but low value point clusters. This property does not actually filter the data or modify the calculated intensity value. Rather, it scales the color ramp such that a higher intensity value is required for a pixel to get a noticeable color. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) - * + * * @default 0 */ minPixelIntensity: number; /** * The type of renderer. For HeatmapRenderer this value is always `heatmap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#type) */ readonly type: "heatmap"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#clone) - * - * + * + * */ clone(): HeatmapRenderer; } @@ -17864,11 +18343,11 @@ declare namespace __esri { interface HeatmapRendererConstructor { /** * The HeatmapRenderer renders point [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) as a raster surface, emphasizing areas with a high density of points. This renderer uses a [Gaussian Blur](https://en.wikipedia.org/wiki/Gaussian_blur) to determine the strength of the influence of each point over an area determined by the [blurRadius](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius). A Gaussian, or normal, distribution is used to spread the color of the point so it appears to be a fuzzy circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html) */ - new(properties?: HeatmapRendererProperties): HeatmapRenderer; + new (properties?: HeatmapRendererProperties): HeatmapRenderer; fromJSON(json: any): HeatmapRenderer; } @@ -17878,14 +18357,14 @@ declare namespace __esri { interface HeatmapRendererProperties extends RendererProperties { /** * The area of influence for each point in the layer. This is defined as a radius in pixels. The default is `10`, which means the pixels within a 10-pixel radius of the point's location are assigned an intensity value corresponding to their distance from the nearby point. Increasing this value creates a larger heatmap with more hotspots. Decreasing it makes a smaller heatmap with fewer hotspots. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius) - * + * * @default 10 */ blurRadius?: number; /** - * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: + * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: * ```js * [ * { ratio: 0, color: "rgba(255, 140, 0, 0)" }, @@ -17893,74 +18372,194 @@ declare namespace __esri { * { ratio: 0.9, color: "rgba(255, 0, 0, 1)" } * ] * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) */ colorStops?: HeatmapColorStopProperties[]; /** * The name of the attribute field used to weight the intensity of each heatmap point. For example, suppose you have a layer of points representing buildings containing a field `num_units` for the number of units in the building (if it's an apartment complex). You could weight the heatmap renderer based on the `num_units` field to create a heatmap representing the density of housing units in a city. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) */ field?: string; /** * The pixel intensity value that determines which pixels are assigned the final color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixelx with intensity values above this number will be assigned the final (or hottest) color in the color ramp. Typically, `minPixelIntensity` will be zero and `maxPixelIntensity` will be set to a high value appropriate for the dataset. The default may not be ideal for your dataset, so this value will likely need to change. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) - * + * * @default 100 */ maxPixelIntensity?: number; /** * The pixel intensity value used to determine which pixels will be assigned the initial color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixels with intensity values below this number will be excluded from the visualization. When using a [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) to weight the points, setting `minPixelIntensity` above zero might help to visually deemphasize frequently occurring but low value point clusters. This property does not actually filter the data or modify the calculated intensity value. Rather, it scales the color ramp such that a higher intensity value is required for a pixel to get a noticeable color. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) - * + * * @default 0 */ minPixelIntensity?: number; } + interface VisualVariablesRenderer { + /** + * An array of [VisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html) objects. Each object must indicate the type of visual variable to apply (e.g. [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html), [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html), [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html), [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html)), the numeric field or expression from which to drive the visualization, and the 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 | [ColorVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html) | ![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-visualVariables-SizeVariable.html) | ![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-visualVariables-OpacityVariable.html) | ![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-visualVariables-RotationVariable.html) | - + * + * Visual variables are primarily be used in two ways. **1**. Thematic mapping In most cases, visual variables are used to create visualizations based on a thematic attribute (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. + * ```js + * renderer.visualVariables = [{ + * type: "size", + * field: "POP_POVERTY", + * normalizationField: "TOTPOP_CY", + * legendOptions: { + * title: "% population in poverty by county" + * }, + * stops: [ + * { value: 0.15, size: 4, label: "<15%" }, + * { value: 0.25, size: 12, label: "25%" }, + * { value: 0.35, size: 24, label: ">35%" } + * ] + * }]; + * ``` + * + * [![size-image-here](https://developers.arcgis.com/javascript/assets/img/samples/8-vv-size.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-size/index.html) + * + * You can take the visualization a step further and use multiple visual variables in the same renderer. + * The sample below uses + * three visual variables (size, color, and opacity). + * + * [![visualization-multivariate-2d](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-visualVariables-SizeVariable.html) 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 trees + * that uses visual variables to size each feature to the true dimensions of each tree + * based on data stored in multiple attribute fields. + * + * [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/3-trees-3d.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) + * + * See the [Thematic visualization 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-mixins-VisualVariablesRenderer.html#visualVariables) + */ + visualVariables: VisualVariable[]; + } + + interface VisualVariablesRendererConstructor { + new (): VisualVariablesRenderer; + } + + export const VisualVariablesRenderer: VisualVariablesRendererConstructor; + + interface VisualVariablesRendererProperties { + /** + * An array of [VisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html) objects. Each object must indicate the type of visual variable to apply (e.g. [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html), [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html), [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html), [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html)), the numeric field or expression from which to drive the visualization, and the 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 | [ColorVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html) | ![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-visualVariables-SizeVariable.html) | ![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-visualVariables-OpacityVariable.html) | ![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-visualVariables-RotationVariable.html) | - + * + * Visual variables are primarily be used in two ways. **1**. Thematic mapping In most cases, visual variables are used to create visualizations based on a thematic attribute (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. + * ```js + * renderer.visualVariables = [{ + * type: "size", + * field: "POP_POVERTY", + * normalizationField: "TOTPOP_CY", + * legendOptions: { + * title: "% population in poverty by county" + * }, + * stops: [ + * { value: 0.15, size: 4, label: "<15%" }, + * { value: 0.25, size: 12, label: "25%" }, + * { value: 0.35, size: 24, label: ">35%" } + * ] + * }]; + * ``` + * + * [![size-image-here](https://developers.arcgis.com/javascript/assets/img/samples/8-vv-size.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-size/index.html) + * + * You can take the visualization a step further and use multiple visual variables in the same renderer. + * The sample below uses + * three visual variables (size, color, and opacity). + * + * [![visualization-multivariate-2d](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-visualVariables-SizeVariable.html) 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 trees + * that uses visual variables to size each feature to the true dimensions of each tree + * based on data stored in multiple attribute fields. + * + * [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/3-trees-3d.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) + * + * See the [Thematic visualization 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-mixins-VisualVariablesRenderer.html#visualVariables) + */ + visualVariables?: VisualVariableProperties[]; + } + interface PointCloudClassBreaksRenderer extends PointCloudRenderer { /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ colorClassBreakInfos: PointCloudClassBreaksRendererColorClassBreakInfos[]; /** * The name of the field that is used to drive the color visualization for the renderer. The value of this field determines which class break each point is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#field) */ field: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) */ legendOptions: PointCloudClassBreaksRendererLegendOptions; /** * The type of renderer. For PointCloudClassBreaksRenderer this value is always `point-cloud-class-breaks`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#type) */ readonly type: "point-cloud-class-breaks"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#clone) - * - * + * + * */ clone(): PointCloudClassBreaksRenderer; } @@ -17968,11 +18567,11 @@ declare namespace __esri { interface PointCloudClassBreaksRendererConstructor { /** * This class defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a numeric attribute. Colors are assigned based on classes or ranges of data. Each point is assigned a symbol based on the class break in which the value of the attribute falls. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html) */ - new(properties?: PointCloudClassBreaksRendererProperties): PointCloudClassBreaksRenderer; + new (properties?: PointCloudClassBreaksRendererProperties): PointCloudClassBreaksRenderer; fromJSON(json: any): PointCloudClassBreaksRenderer; } @@ -17982,65 +18581,63 @@ declare namespace __esri { interface PointCloudClassBreaksRendererProperties extends PointCloudRendererProperties { /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ colorClassBreakInfos?: PointCloudClassBreaksRendererColorClassBreakInfos[]; /** * The name of the field that is used to drive the color visualization for the renderer. The value of this field determines which class break each point is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#field) */ field?: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) */ legendOptions?: PointCloudClassBreaksRendererLegendOptions; } - export interface PointCloudClassBreaksRendererColorClassBreakInfos extends Object { /** * The minimum value of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ minValue: number; /** * The maximum value of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ maxValue: number; /** * The color used to colorize the points where values are between the `minValue` and `maxValue` of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ color: Color; /** * The label used to describe point in the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ label?: string; } - export interface PointCloudClassBreaksRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) */ title?: string; @@ -18049,45 +18646,43 @@ declare namespace __esri { interface PointCloudRenderer extends Accessor, JSONSupport { /** * Reduces the brightness of the point's color, based on the value of another field, usually `intensity`. High values leave the color unchanged, while low values darken the color of the point. This helps to display the scanned surface in a more realistic way. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) */ colorModulation: PointCloudRendererColorModulation; /** * Specifies how the size of the points in the point cloud is computed for rendering. The splat algorithm automatically computes a size based on the density, which varies with the Level of Detail that is currently displayed. The fixed size algorithm displays all points with the same size, either in screen space or real world units. When `pointSizeAlgorithm` is not set, the default is `splat`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ pointSizeAlgorithm: PointCloudRendererPointSizeAlgorithm; /** * The number of points to draw per display inch. This property determines the level of detail in the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointsPerInch) - * + * * @default 10 */ pointsPerInch: number; /** * The point cloud renderer type. **Possible values:** point-cloud-class-breaks | point-cloud-rgb | point-cloud-stretch | point-cloud-unique-value - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#type) */ readonly type: string; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#clone) - * - * + * + * */ clone(): PointCloudRenderer; } interface PointCloudRendererConstructor { - - - new(properties?: PointCloudRendererProperties): PointCloudRenderer; + new (properties?: PointCloudRendererProperties): PointCloudRenderer; fromJSON(json: any): PointCloudRenderer; } @@ -18097,77 +18692,75 @@ declare namespace __esri { interface PointCloudRendererProperties { /** * Reduces the brightness of the point's color, based on the value of another field, usually `intensity`. High values leave the color unchanged, while low values darken the color of the point. This helps to display the scanned surface in a more realistic way. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) */ colorModulation?: PointCloudRendererColorModulation; /** * Specifies how the size of the points in the point cloud is computed for rendering. The splat algorithm automatically computes a size based on the density, which varies with the Level of Detail that is currently displayed. The fixed size algorithm displays all points with the same size, either in screen space or real world units. When `pointSizeAlgorithm` is not set, the default is `splat`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ pointSizeAlgorithm?: PointCloudRendererPointSizeAlgorithm; /** * The number of points to draw per display inch. This property determines the level of detail in the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointsPerInch) - * + * * @default 10 */ pointsPerInch?: number; } - export interface PointCloudRendererColorModulation extends Object { /** * Field to use for the color modulation. Commonly modulation is used with the `intensity` field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) */ field: string; /** * Field value at which the point color becomes darkest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) - * + * * @default 0 */ minValue?: number; /** * Field value at which the point color will be left unchanged. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) - * + * * @default 255 */ maxValue?: number; } - export interface PointCloudRendererPointSizeAlgorithm extends Object { /** * `fixed-size` or `splat`. Choosing `fixed-size` implies setting `size` and `useRealWorldSymbolSizes`. If `splat` is chosen then `scaleFactor` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ type: string; /** * Specifies whether `size` is in real world units or screen-space units. Applies to `fixed-size` only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ useRealWorldSymbolSizes?: boolean; /** * Point size in meters (`useRealWorldSymbolSizes = true`) or points. Applies to `fixed-size` only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ size?: number; /** * Specifies the scale factor that is applied to the size estimated by the density. Applies to `splat` only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) - * + * * @default 1 */ scaleFactor?: number; @@ -18176,23 +18769,23 @@ declare namespace __esri { interface PointCloudRGBRenderer extends PointCloudRenderer { /** * The name of the field containing RGB values used to drive the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#field) */ field: string; /** * The type of Renderer. For PointCloudRGBRenderer this value is always `point-cloud-rgb`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#type) */ readonly type: "point-cloud-rgb"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#clone) - * - * + * + * */ clone(): PointCloudRGBRenderer; } @@ -18200,11 +18793,11 @@ declare namespace __esri { interface PointCloudRGBRendererConstructor { /** * PointCloudRGBRenderer defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a color attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) */ - new(properties?: PointCloudRGBRendererProperties): PointCloudRGBRenderer; + new (properties?: PointCloudRGBRendererProperties): PointCloudRGBRenderer; fromJSON(json: any): PointCloudRGBRenderer; } @@ -18214,7 +18807,7 @@ declare namespace __esri { interface PointCloudRGBRendererProperties extends PointCloudRendererProperties { /** * The name of the field containing RGB values used to drive the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#field) */ field?: string; @@ -18223,43 +18816,43 @@ declare namespace __esri { interface PointCloudStretchRenderer extends PointCloudRenderer { /** * The name of the number field whose values are used to drive the continuous color visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#field) */ field: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) */ legendOptions: PointCloudStretchRendererLegendOptions; /** * An array of color value pairs. Points with values between the specified stops are colorized with linearly interpolated colors. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ stops: PointCloudStretchRendererStops[]; /** * The type of Renderer. For PointCloudStretchRenderer this value is always `point-cloud-stretch`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#type) */ readonly type: "point-cloud-stretch"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#clone) - * - * + * + * */ clone(): PointCloudStretchRenderer; } @@ -18267,11 +18860,11 @@ declare namespace __esri { interface PointCloudStretchRendererConstructor { /** * PointCloudStretchRenderer defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a numeric attribute. It allows you to easily map continuous color ramps to minimum and maximum data values of one of the layer's numeric attribute fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html) */ - new(properties?: PointCloudStretchRendererProperties): PointCloudStretchRenderer; + new (properties?: PointCloudStretchRendererProperties): PointCloudStretchRenderer; fromJSON(json: any): PointCloudStretchRenderer; } @@ -18281,59 +18874,57 @@ declare namespace __esri { interface PointCloudStretchRendererProperties extends PointCloudRendererProperties { /** * The name of the number field whose values are used to drive the continuous color visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#field) */ field?: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) */ legendOptions?: PointCloudStretchRendererLegendOptions; /** * An array of color value pairs. Points with values between the specified stops are colorized with linearly interpolated colors. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ stops?: PointCloudStretchRendererStops[]; } - export interface PointCloudStretchRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) */ title?: string; } - export interface PointCloudStretchRendererStops extends Object { /** * The value for this stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ value: number; /** * The label for this stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ label?: string; /** * The color value for this stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ color: Color; @@ -18342,43 +18933,43 @@ declare namespace __esri { interface PointCloudUniqueValueRenderer extends PointCloudRenderer { /** * Each element in the array is an object that matches a unique value with a specific color. Features with equal values to those specified here will be assigned the associated color. For example, you may choose to visualize points representing low vegetation with a green color and points representing power lines with a gray color. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ colorUniqueValueInfos: PointCloudUniqueValueRendererColorUniqueValueInfos[]; /** * The name of the field whose values are used to drive the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#field) */ field: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) */ legendOptions: PointCloudUniqueValueRendererLegendOptions; /** * The type of Renderer. For PointCloudUniqueValueRenderer this value is always `point-cloud-unique-value`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#type) */ readonly type: "point-cloud-unique-value"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#clone) - * - * + * + * */ clone(): PointCloudUniqueValueRenderer; } @@ -18386,11 +18977,11 @@ declare namespace __esri { interface PointCloudUniqueValueRendererConstructor { /** * PointCloudUniqueValueRenderer allows you to colorize points in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on an attribute value. This is done by assigning unique colors to represent points with equal attribute values. This renderer is used to visualize points of the same type, not interpolate colors along a continuous ramp mapped to numbers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html) */ - new(properties?: PointCloudUniqueValueRendererProperties): PointCloudUniqueValueRenderer; + new (properties?: PointCloudUniqueValueRendererProperties): PointCloudUniqueValueRenderer; fromJSON(json: any): PointCloudUniqueValueRenderer; } @@ -18400,59 +18991,57 @@ declare namespace __esri { interface PointCloudUniqueValueRendererProperties extends PointCloudRendererProperties { /** * Each element in the array is an object that matches a unique value with a specific color. Features with equal values to those specified here will be assigned the associated color. For example, you may choose to visualize points representing low vegetation with a green color and points representing power lines with a gray color. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ colorUniqueValueInfos?: PointCloudUniqueValueRendererColorUniqueValueInfos[]; /** * The name of the field whose values are used to drive the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#field) */ field?: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) */ legendOptions?: PointCloudUniqueValueRendererLegendOptions; } - export interface PointCloudUniqueValueRendererColorUniqueValueInfos extends Object { /** * A unique combination of values that will be represented with the given `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ values: string[]; /** * The color used to represent points whose value matches `values`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ color: Color; /** * Label used to describe points matched to the unique value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ label?: string; } - export interface PointCloudUniqueValueRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) */ title?: string; @@ -18461,13 +19050,13 @@ declare namespace __esri { interface Renderer extends Accessor, JSONSupport { /** * Authoring metadata only included in renderers generated from one of the Smart Mapping creator methods, such as [sizeRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) or [colorRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer). This includes information from UI elements such as sliders and selected classification methods and themes. This allows the authoring clients to save specific overridable settings so that next time it is accessed via the UI, their selections can be remembered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#authoringInfo) */ authoringInfo: AuthoringInfo; /** * The renderer type. **Possible values:** class-breaks | heatmap | simple | unique-value - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#type) */ readonly type: string; @@ -18476,11 +19065,11 @@ declare namespace __esri { interface RendererConstructor { /** * Renderers define how to visually represent each feature in one of the following layer types: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) */ - new(properties?: RendererProperties): Renderer; + new (properties?: RendererProperties): Renderer; fromJSON(json: any): Renderer; } @@ -18490,740 +19079,38 @@ declare namespace __esri { interface RendererProperties { /** * Authoring metadata only included in renderers generated from one of the Smart Mapping creator methods, such as [sizeRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) or [colorRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer). This includes information from UI elements such as sliders and selected classification methods and themes. This allows the authoring clients to save specific overridable settings so that next time it is accessed via the UI, their selections can be remembered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#authoringInfo) */ authoringInfo?: AuthoringInfoProperties; } - /** - * Defines a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) with minimum and maximum bounds. When an object with this specification is applied to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of a renderer, then feature sizes are bounded by min and max data values. Features with values greater than the provided max value are assigned the specified maximum size. Likewise, features with values less than the provied min value are assigned the specified minimum size. Features with values between the min and the max are assigned a corresponding size that is linearly interpolated between the provided min and max size values. The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - export interface BoundedMinMax extends Object { - /** - * The size used to render a feature containing the maximum data value. - * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. - * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - maxSize: string | number; - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - type: 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. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - 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#BoundedMinMax) - */ - 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 size 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#BoundedMinMax) - */ - valueExpressionTitle?: string; - /** - * The maximum data value used in the size ramp. Features with this value or higher will be rendered at the size defined in `maxSize`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - maxDataValue: number; - /** - * 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; - /** - * The minimum data value used in the size ramp. Features with this value or lower will be rendered at the size defined in `minSize`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - minDataValue: number; - /** - * The size used to render a feature containing the minimum data value. - * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. - * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - minSize: string | number; - /** - * An object providing options for displaying the 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-Renderer.html#BoundedMinMax) - */ - legendOptions?: BoundedMinMaxLegendOptions; - /** - * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. - * - * Possible Value | Description - * ----------------|----------- - * width | The diameter of the symbol from east to west. - * depth | The diameter of the symbol from north to south. - * height | The height of the symbol. - * width-and-depth | Applies the size visual variable to both width and depth axes. - * all | Applies the size visual variable to all axes. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - axis?: string; - /** - * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - useSymbolValue?: boolean; - } - - /** - * 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) - */ - export interface ColorVisualVariable extends Object { - /** - * **Required.** Value must be `color`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - type: string; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - stops: ColorVisualVariableStops[]; - } - - /** - * 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) - */ - export interface OpacityVisualVariable extends Object { - /** - * **Required.** Value must be `opacity`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - type: string; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - stops: OpacityVisualVariableStops[]; - } - - /** - * 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) - */ - export interface RealWorldSize extends Object { - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - type: string; - /** - * 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; - /** - * 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#RealWorldSize) - */ - 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 size 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#RealWorldSize) - */ - valueExpressionTitle?: string; - /** - * Indicates the unit of measurement used to interpret the value returned by `field` or `valueExpression`. For 3D volumetric symbols the default is `meters`. This property should not be used if the data value represents a thematic quantity (e.g. traffic count, census data, etc.). **Possible Values:** unknown | inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - valueUnit: string; - /** - * Specifies how to apply the data value when mapping real-world sizes. See table below for supported values. - * - * Value | Description - * ------|----------- - * radius | The point data value represents the radius of a circular feature. - * diameter | The point data value represents the diameter of a circular feature. - * area | The point data value represents the area of a feature. - * width | The polyline data value represents the width of a line. - * distance | The polyline data value represents the distance from the center line (one half of the width). - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - 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). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - legendOptions?: RealWorldSizeLegendOptions; - /** - * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. - * - * Possible Value | Description - * ----------------|----------- - * width | The diameter of the symbol from east to west. - * depth | The diameter of the symbol from north to south. - * height | The height of the symbol. - * width-and-depth | Applies the size visual variable to both width and depth axes. - * all | Applies the size visual variable to all axes. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - axis?: string; - /** - * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - useSymbolValue?: boolean; - } - - /** - * 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) - */ - export interface RotationVisualVariable extends Object { - /** - * **Required.** Value must be `rotation`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - type: string; - /** - * 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; - /** - * 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; - /** - * 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. - * - * Possible Value | Description - * ----------------|----------- - * heading | The rotation of the symbol in the horizontal plane (i.e., around the z axis). - * tilt | The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). - * roll | The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - axis?: string; - /** - * Defines the origin and direction of rotation depending on how the angle of rotation was measured. See the table below for a list of possible values. This property only applies to rotations around the `heading` axis. - * - * Value | Description - * ------|------------ - * geographic | Rotates the symbol from the north in a clockwise direction. - * arithmetic | Rotates the symbol from the east in a counter-clockwise direction. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - rotationType?: string; - } - - /** - * **Only applicable to [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)**. Defines icon sizes in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) based on minimum and maximum bounds similar to the [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) case. However, this specification allows the developer to specify various min and max sizes based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). Features with values greater than the provided max value are assigned the specified maximum size for the given view scale. Likewise, features with values less than the provied min value are assigned the specified minumum size for the given view scale. Features with values between the min and the max are assigned a corresponding size that is linearly interpolated between the provided min and max size values for the given scale value. The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - export interface ScaleDependentIcons extends Object { - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - type: string; - /** - * 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; - /** - * 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. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - 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`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - 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 size 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#ScaleDependentIcons) - */ - valueExpressionTitle?: string; - /** - * The maximum data value used in the size ramp. Features with this value or higher will be rendered at the size defined in `maxSize`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - maxDataValue: number; - /** - * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is greater than or equal to the `maxDataValue` for the given view scale. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - maxSize: ScaleDependentStops; - /** - * The minimum data value used in the size ramp. Features with this value or lower will be rendered at the size defined in `minSize`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - minDataValue: number; - /** - * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is less than or equal to the `minDataValue` for the given view scale. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - minSize: ScaleDependentStops; - /** - * An object providing options for displaying the 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-Renderer.html#ScaleDependentIcons) - */ - legendOptions?: ScaleDependentIconsLegendOptions; - } - - /** - * **Only applicable to [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)**. Defines feature sizes and outline widths in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). It also provides the specification of the `minSize` and `maxSize` properties in a [ScaleDependentIcons](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) size visual variable. The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - export interface ScaleDependentStops extends Object { - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - type: string; - /** - * This value must be `$view.scale`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - valueExpression: string; - /** - * **Deprecated since version 4.2. Use `valueExpression` instead**. The only supported expression is `view.scale`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - expression?: string; - /** - * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - target?: string; - /** - * An array of objects that define the size of the icon (or alternatively the width of the polygon outline) at the given scale `value`. 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: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - stops: ScaleDependentStopsStops[]; - } - - /** - * The **size** visual variable defines the size of individual features in a layer based on a numeric (often thematic) value. This value comes from one of the following: - * * An attribute `field` - * * The value of an attribute `field` divided by a `normalizationField` - * * A value returned from an [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) specified in `valueExpression`. - * - * - * Size is defined in the form of a continuous ramp, which may be applied to renderers in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Symbol size may be applied either thematically, or literally using real-world units. See the following object specification tables for details about each potential use of a size visual variable: - * * **[BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax)** - Feature sizes are bounded by min and max data values. - * * **[ThematicStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops)** - Defines two or more stops at which feature sizes are mapped to data values. - * * **[ScaleDependentIcons](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons)** - Icons sizes are bounded by min and max data values, but the min and max sizes (and interpolated sizes) change based on the scale of the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * * **[ScaleDependentStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops)** - Defines the width of polygon outlines at various view scales. - * * **[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/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) - */ - export interface SizeVisualVariable extends Object { - } - - /** - * Defines two or more stops at which feature sizes are mapped to data values in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable). Setting two stops will have the same effect as creating a [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) size visual variable. Adding additional stops allows you to map specific sizes with data values. Sizes are interpolated linearly between stop values. The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - export interface ThematicStops extends Object { - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - type: string; - /** - * 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; - /** - * 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. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - 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#ThematicStops) - */ - 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 size 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#ThematicStops) - */ - valueExpressionTitle?: string; - /** - * An array of objects that defines the thematic size ramp in a sequence of data or expression 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: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - stops: ThematicStopsStops[]; - /** - * An object providing options for displaying the 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-Renderer.html#ThematicStops) - */ - legendOptions?: ThematicStopsLegendOptions; - /** - * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. - * - * Possible Value | Description - * ----------------|----------- - * width | The diameter of the symbol from east to west. - * depth | The diameter of the symbol from north to south. - * height | The height of the symbol. - * width-and-depth | Applies the size visual variable to both width and depth axes. - * all | Applies the size visual variable to all axes. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - axis?: string; - /** - * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - useSymbolValue?: boolean; - } - - - export interface BoundedMinMaxLegendOptions extends Object { - /** - * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - title?: string; - /** - * Indicates whether to show the size ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - showLegend?: boolean; - } - - - export interface ColorVisualVariableLegendOptions extends Object { - /** - * The title describing the visualization of the color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - 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; - } - - - export interface ColorVisualVariableStops extends Object { - /** - * **Required**. Specifies the data value to map with the given `color`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - value: number; - /** - * **Required**. The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given `value`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - color: Color; - /** - * A string value used to label the stop in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - label?: string; - } - - - export interface OpacityVisualVariableLegendOptions extends Object { - /** - * The title describing the visualization of the opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - 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; - } - - - export interface OpacityVisualVariableStops extends Object { - /** - * **Required**. Specifies the data value to map with the given `opacity`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - value: number; - /** - * **Required**. The opacity value used to render features containing the specified `value`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - opacity: number; - /** - * A string value used to label the stop in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - label?: string; - } - - - export interface RealWorldSizeLegendOptions extends Object { - /** - * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - title?: string; - /** - * Indicates whether to show the size ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - showLegend?: boolean; - } - - - export interface ScaleDependentIconsLegendOptions extends Object { - /** - * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - title?: string; - /** - * Indicates whether to show the size ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - showLegend?: boolean; - } - - - export interface ScaleDependentStopsStops extends Object { - /** - * Specifies the scale value to map with the given `size`. When the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) equals the given number then icons (or outlines) will be rendered with the given size. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - value: number; - /** - * The size at which to render features at the specified scale `value`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - size: string | number; - } - - - export interface ThematicStopsLegendOptions extends Object { - /** - * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - title?: string; - /** - * Indicates whether to show the size ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - showLegend?: boolean; - } - - - export interface ThematicStopsStops extends Object { - /** - * Specifies the data or expression value to map with the given `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - value: number; - /** - * The size at which to render features containing the specified `value`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - size: number | string; - /** - * A string value used to label the stop in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - label?: string; - } - - interface SimpleRenderer extends Renderer, VisualVariablesMixin { + interface SimpleRenderer extends Renderer, VisualVariablesRenderer { /** * The label for the renderer. This describes what features with the given [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) represent in the real world. This will display next to the layer's [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) inside the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This text is not displayed in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) when [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) are used. When the renderer contains [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables), you should set the `title` property in `legendOptions` on each visual variable to describe the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#label) */ label: string; /** * The symbol used by the renderer to visualize all features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) */ symbol: Symbol; /** * The type of renderer. For SimpleRenderer this value is always `simple`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#type) */ readonly type: "simple"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#clone) - * - * + * + * */ clone(): SimpleRenderer; } @@ -19231,27 +19118,27 @@ declare namespace __esri { interface SimpleRendererConstructor { /** * SimpleRenderer renders all features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with one [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html). This renderer may be used to simply visualize the location of geographic features. For example, layers representing political boundaries, cities, buildings, rivers, etc. that are typically used for providing geographic context in an application may be defined with a single symbol per layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html) */ - new(properties?: SimpleRendererProperties): SimpleRenderer; + new (properties?: SimpleRendererProperties): SimpleRenderer; fromJSON(json: any): SimpleRenderer; } export const SimpleRenderer: SimpleRendererConstructor; - interface SimpleRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + interface SimpleRendererProperties extends RendererProperties, VisualVariablesRendererProperties { /** * The label for the renderer. This describes what features with the given [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) represent in the real world. This will display next to the layer's [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) inside the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This text is not displayed in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) when [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) are used. When the renderer contains [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables), you should set the `title` property in `legendOptions` on each visual variable to describe the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#label) */ label?: string; /** * The symbol used by the renderer to visualize all features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) */ symbol?: SymbolProperties; @@ -19259,25 +19146,25 @@ declare namespace __esri { /** * This object contains helper methods for generating data-driven visualizations with continuous color 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 colors optimized based on the indicated basemap. - * + * * [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.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` parameter 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` parameter 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 + * @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) | @@ -19287,49 +19174,49 @@ declare namespace __esri { * @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. - * + * @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. - * + * @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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @param params Input parameters for generating a classed color visualization based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.field The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. * @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.normalizationType With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. - * + * * @param params.normalizationTotal When `normalizationType` is `percent-of-total`, this property contains the total of all data values. * @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.classificationMethod - * The classification method used for generating breaks. See the table below for a list of possible values. - * + * @param params.classificationMethod + * The classification method used for generating breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. @@ -19348,38 +19235,38 @@ declare namespace __esri { * @param params.maxValue A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @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. - * + * @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.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. - * + * @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. - * + * */ createClassBreaksRenderer(params: colorCreateClassBreaksRendererParams): 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 color visual variable that maps optimal colors based on the indicated basemap to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, `field`, and `theme` 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) - * + * * @param params Input parameters for generating a continuous color visualization based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. * @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.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 + * @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) | @@ -19397,30 +19284,30 @@ declare namespace __esri { * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @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. - * + * @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.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. - * + * @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. - * + * */ createContinuousRenderer(params: colorCreateContinuousRendererParams): IPromise; /** * Generates a [PointCloudStretchRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html) with a color scheme best-suited for the given basemap based on statistics returned from a given field of a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). All that's required is a layer instance, field name, and basemap ID. You can optionally set the size and density of the points to suit the needs of the desired visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) - * + * * @param params Input parameters for generating a renderer based on the given field of the input layer. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. The only field names used for this renderer type are `elevation` and `intensity`. @@ -19429,34 +19316,34 @@ declare namespace __esri { * @param params.density The number of points per inch in the view. * @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.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 stats object here to avoid making a second statistics query to the server. - * + * */ createPCContinuousRenderer(params: colorCreatePCContinuousRendererParams): IPromise; /** * Generates a [PointCloudRGBRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) based on the `RGB` field of a given [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). This method simplifies the experience of creating a [PointCloudRGBRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) manually. All that's required is a layer instance. You can optionally set the size and density of the points to suit the needs of the desired visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) - * + * * @param params Input parameters for generating a true color visualization based on the `RGB` field of the input layer. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.size The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. * @param params.density The number of points per inch in the view. - * + * */ createPCTrueColorRenderer(params: colorCreatePCTrueColorRendererParams): IPromise; /** * This method generates a color visual variable with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and colors based on the input basemap. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, `field`, and `theme`. 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) - * + * * @param params Input parameters for generating a color visual variable based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visual variable is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. * @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.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 + * @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) | @@ -19474,7 +19361,7 @@ declare namespace __esri { * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. * @param params.view When generating 3D symbols (except for layers with a `mesh` geometry type), a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology, except for layers with a `mesh` geometry type. A `view` must be provided if this property is set to `true`. - * + * */ createVisualVariable(params: colorCreateVisualVariableParams): IPromise; } @@ -19483,49 +19370,49 @@ declare namespace __esri { /** * 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; + visualVariable: ColorVariable; /** * 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; @@ -19533,711 +19420,701 @@ declare namespace __esri { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ export interface ClassBreaksRendererResult 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#ClassBreaksRendererResult) */ renderer: ClassBreaksRenderer; /** * This object describes class breaks generated from data in a layer for a given field with a specified classification method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ classBreaksResult: ClassBreaksResult; /** * The color scheme used for the class breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ 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#ClassBreaksRendererResult) */ defaultValuesUsed: boolean; /** * 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#ClassBreaksRendererResult) */ basemapId: string; } - 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. - * + * 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` parameter 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. - * + * 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` parameter 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. - * + * 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. - * + * **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ normalizationField?: string; /** - * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. - * + * * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ normalizationType?: string; /** * When `normalizationType` is `percent-of-total`, this property contains the total of all data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ normalizationTotal?: 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-color.html#createClassBreaksRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** - * The classification method used for generating breaks. See the table below for a list of possible values. - * + * The classification method used for generating breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information. * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes. * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default equal-interval */ classificationMethod?: string; /** * If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks. **Possible Values:** 1 | 0.5 | 0.33 | 0.25 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default 1 */ standardDeviationInterval?: number; /** * The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default 5 */ numClasses?: number; /** * 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`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ colorScheme?: ColorScheme; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ sqlWhere?: string; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ legendOptions?: colorCreateClassBreaksRendererParamsLegendOptions; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ minValue?: number; /** * A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * 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. - * + * 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#createClassBreaksRenderer) - * + * * @default 2d */ symbolType?: string; /** - * **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. - * + * **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#createClassBreaksRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface colorCreateClassBreaksRendererParamsLegendOptions extends Object { /** * The title used to represent the given field or expression 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#createClassBreaksRenderer) */ title?: string; } - export interface colorCreateContinuousRendererParams 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#createContinuousRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ normalizationField?: 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#createContinuousRenderer) - * + * * @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#createContinuousRenderer) */ theme?: string; /** * 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#createContinuousRenderer) */ colorScheme?: ColorScheme; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ sqlWhere?: string; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ legendOptions?: colorCreateContinuousRendererParamsLegendOptions; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ statistics?: SummaryStatisticsResult; /** * 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 color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * 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. - * + * 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#createContinuousRenderer) - * + * * @default 2d */ symbolType?: string; /** - * **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. - * + * **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#createContinuousRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface colorCreateContinuousRendererParamsLegendOptions extends Object { /** * The title used to represent the given field or expression 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#createContinuousRenderer) */ title?: string; /** * Indicates whether to describe the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ showLegend?: boolean; } - export interface colorCreatePCContinuousRendererParams 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#createPCContinuousRenderer) */ layer: PointCloudLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. The only field names used for this renderer type are `elevation` and `intensity`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) */ field: 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#createPCContinuousRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) - * + * * @default 100% */ size?: string; /** * The number of points per inch in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) - * + * * @default 25 */ density?: number; /** * 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`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) */ colorScheme?: ColorScheme; /** * 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 stats object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) */ statistics?: SummaryStatisticsResult; } - export interface colorCreatePCTrueColorRendererParams 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#createPCTrueColorRenderer) */ layer: PointCloudLayer; /** * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) - * + * * @default 100% */ size?: string; /** * The number of points per inch in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) - * + * * @default 25 */ density?: number; } - export interface colorCreateVisualVariableParams extends Object { /** * The layer for which the visual variable is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ normalizationField?: 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#createVisualVariable) - * + * * @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#createVisualVariable) */ theme?: string; /** * 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#createVisualVariable) */ colorScheme?: ColorScheme; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ sqlWhere?: string; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ legendOptions?: colorCreateVisualVariableParamsLegendOptions; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ statistics?: SummaryStatisticsResult; /** * 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 color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ maxValue?: number; /** * When generating 3D symbols (except for layers with a `mesh` geometry type), a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology, except for layers with a `mesh` geometry type. 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-creators-color.html#createVisualVariable) */ worldScale?: boolean; } - export interface colorCreateVisualVariableParamsLegendOptions extends Object { /** * The title used to represent the given field or expression 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#createVisualVariable) */ title?: string; /** * Indicates whether to describe the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ showLegend?: boolean; @@ -20245,43 +20122,43 @@ declare namespace __esri { /** * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) 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#ContinuousRendererResult) */ export interface ContinuousRendererResult 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#ContinuousRendererResult) */ 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#ContinuousRendererResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) */ 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#ContinuousRendererResult) */ 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#ContinuousRendererResult) */ 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#ContinuousRendererResult) */ basemapId: string; @@ -20289,37 +20166,37 @@ declare namespace __esri { /** * The result object of the [createPCContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) 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#PCContinuousRendererResult) */ export interface PCContinuousRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this object on the input layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ renderer: PointCloudStretchRenderer; /** * The color scheme used by the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ 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#PCContinuousRendererResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for data from the given field name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal color scheme for the output renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ basemapId: string; @@ -20327,13 +20204,13 @@ declare namespace __esri { /** * The result object of the [createPCTrueColorRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) 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#PCTrueColorRendererResult) */ export interface PCTrueColorRendererResult extends Object { /** * The renderer object configured to represent the true color of each point in the point cloud. This gives the PointCloudLayer a realistic visualization of how it looks in the real world. Set this object on the input layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCTrueColorRendererResult) */ renderer: PointCloudRGBRenderer; @@ -20341,43 +20218,43 @@ declare namespace __esri { /** * The result object of the [createVisualVariable()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) 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#VisualVariableResult) */ export interface VisualVariableResult extends Object { /** * 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#VisualVariableResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ colorScheme: ColorScheme; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ statistics: SummaryStatisticsResult; /** * 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#VisualVariableResult) */ defaultValuesUsed: boolean; /** * 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#VisualVariableResult) */ basemapId: string; /** * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ authoringInfo: AuthoringInfo; @@ -20385,98 +20262,97 @@ declare namespace __esri { /** * This object contains helper methods for generating location-only visualizations (not data-driven) in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) method generates a [SimpleRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html) object that may be applied directly to the layer. This renderer contains a single symbol with a color optimally selected based on the indicated basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html) */ interface location { /** * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a supported [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The renderer contains a single symbol with a color optimally chosen based on the indicated basemap. In most cases you will provide a `layer` and `basemap` to generate this renderer. If working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), then the `view` and `symbolType` options should be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) - * + * * @param params Input parameters for generating a location-based visualization. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @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.locationScheme In authoring apps, the user may select a pre-defined location scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.view 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. - * @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. - * + * @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.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. - * + * @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: locationCreateRendererParams): IPromise; } export const location: location; - export interface locationCreateRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * 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-location.html#createRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * In authoring apps, the user may select a pre-defined location 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-location.html#createRenderer) */ 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. - * + * * [Read more...](global.html) */ view?: SceneView; /** - * 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. - * + * 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-location.html#createRenderer) - * + * * @default 2d */ symbolType?: string; /** - * **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. - * + * **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-location.html#createRenderer) - * + * * @default replace */ colorMixMode?: string; @@ -20484,25 +20360,25 @@ declare namespace __esri { /** * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.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-location.html#RendererResult) */ export interface RendererResult extends Object { /** * A simple renderer configured with a single color best suited to match the given basemap. Set this to a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) */ renderer: SimpleRenderer; /** * The location scheme used by the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) */ locationScheme: LocationScheme; /** * 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-location.html#RendererResult) */ basemapId: string; @@ -20510,15 +20386,15 @@ declare namespace __esri { /** * This object contains a helper method for generating data-driven visualizations with continuous opacity based on data returned from a field value or expression in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html) */ interface opacity { /** * This method generates an opacity visual variable with default alpha values optimally mapped to data values based on the statistics queried for the indicated field or expression. There are several ways this method may be called. The most common case is by providing a `layer` and a `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know the which alpha values to map to data values. 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 stats in 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-opacity.html#createVisualVariable) - * + * * @param params Input parameters for generating an opacity visual variable based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visual variable is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. @@ -20532,94 +20408,92 @@ declare namespace __esri { * @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 variable. * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variable. * @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. - * + * */ createVisualVariable(params: opacityCreateVisualVariableParams): IPromise; } export const opacity: opacity; - export interface opacityCreateVisualVariableParams extends Object { /** * The layer for which the visual variable is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ normalizationField?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ sqlWhere?: string; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ legendOptions?: opacityCreateVisualVariableParamsLegendOptions; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ statistics?: SummaryStatisticsResult; /** * 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 variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ maxValue?: number; /** * 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. - * + * * [Read more...](global.html) */ view?: View; } - export interface opacityCreateVisualVariableParamsLegendOptions extends Object { /** * The title used to represent the given field or expression 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-opacity.html#createVisualVariable) */ title?: string; @@ -20627,31 +20501,31 @@ declare namespace __esri { /** * The result object of the [createVisualVariable()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ export interface opacityVisualVariableResult extends Object { /** * An opacity visual variable configured based on the statistics of the data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ - visualVariable: OpacityVisualVariable; + visualVariable: OpacityVariable; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ statistics: SummaryStatisticsResult; /** * 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-opacity.html#VisualVariableResult) */ defaultValuesUsed: boolean; /** * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ authoringInfo: AuthoringInfo; @@ -20659,13 +20533,13 @@ declare namespace __esri { /** * 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: - * + * 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 @@ -20673,11 +20547,11 @@ declare namespace __esri { * 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. @@ -20687,181 +20561,178 @@ declare namespace __esri { * @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 + * @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. - * + * @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. - * + * @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. - * + * 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. - * + * **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; @@ -20869,49 +20740,49 @@ declare namespace __esri { /** * 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; @@ -20919,24 +20790,24 @@ declare namespace __esri { /** * 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. - * + * @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. | @@ -20944,78 +20815,77 @@ declare namespace __esri { * 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. - * + * @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. - * + * @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. - * + * @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. - * + * 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. | @@ -21023,153 +20893,150 @@ declare namespace __esri { * 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. - * + * 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. - * + * 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. - * + * **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; @@ -21177,53 +21044,52 @@ declare namespace __esri { /** * 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; @@ -21231,60 +21097,60 @@ declare namespace __esri { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html) */ interface size { /** * 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.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` parameter 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` parameter 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. - * + * @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) - * + * * @param params Input parameters for generating a classed size visualization based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @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.field The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. * @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.normalizationType With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. - * + * * @param params.normalizationTotal When `normalizationType` is `percent-of-total`, this property contains the total of all data values. - * @param params.classificationMethod - * The classification method used for generating breaks. See the table below for a list of possible values. - * + * @param params.classificationMethod + * The classification method used for generating breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. @@ -21303,23 +21169,23 @@ declare namespace __esri { * @param params.maxValue A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. 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) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. 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) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * + * */ 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 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) - * + * * @param params Input parameters for generating size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the renderer is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. @@ -21336,23 +21202,23 @@ declare namespace __esri { * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. 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) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. 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) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * + * */ 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 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) - * + * * @param params Input parameters for generating size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visual variables are generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. @@ -21370,7 +21236,7 @@ declare namespace __esri { * @param params.view When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @param params.axis When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height - * + * */ createVisualVariables(params: sizeCreateVisualVariablesParams): IPromise; } @@ -21379,49 +21245,49 @@ declare namespace __esri { /** * 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[]; + visualVariables: SizeVariable[]; /** * 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; @@ -21429,37 +21295,37 @@ declare namespace __esri { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ export interface sizeClassBreaksRendererResult 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#ClassBreaksRendererResult) */ renderer: ClassBreaksRenderer; /** * This object describes class breaks generated from data in a layer for a given field with a specified classification method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ classBreaksResult: ClassBreaksResult; /** * The size scheme used by the visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ 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#ClassBreaksRendererResult) */ defaultValuesUsed: boolean; /** * 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#ClassBreaksRendererResult) */ basemapId: string; @@ -21467,562 +21333,554 @@ declare namespace __esri { /** * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) 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#ContinuousRendererResult) */ export interface sizeContinuousRendererResult 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#ContinuousRendererResult) */ 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#ContinuousRendererResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The size scheme used by the visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ 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#ContinuousRendererResult) */ 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-size.html#ContinuousRendererResult) */ 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#ContinuousRendererResult) */ basemapId: string; } - 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. - * + * 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` parameter 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. - * + * 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` parameter 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. - * + * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * 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#createClassBreaksRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ field: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ normalizationField?: string; /** - * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. - * + * * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ normalizationType?: string; /** * When `normalizationType` is `percent-of-total`, this property contains the total of all data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ normalizationTotal?: number; /** - * The classification method used for generating breaks. See the table below for a list of possible values. - * + * The classification method used for generating breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information. * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes. * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default equal-interval */ classificationMethod?: string; /** * If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks. **Possible Values:** 1 | 0.5 | 0.33 | 0.25 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default 1 */ standardDeviationInterval?: number; /** * The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default 5 */ numClasses?: number; /** * 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#createClassBreaksRenderer) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ sqlWhere?: string; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ legendOptions?: sizeCreateClassBreaksRendererParamsLegendOptions; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ minValue?: number; /** * A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. 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) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. 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) and the symbol should be sized uniformly, for example with spheres. 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#createClassBreaksRenderer) - * + * * @default 2d */ symbolType?: string; } - export interface sizeCreateClassBreaksRendererParamsLegendOptions extends Object { /** * The title used to represent the given field or expression 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#createClassBreaksRenderer) */ title?: string; } - export interface sizeCreateContinuousRendererParams extends Object { /** * The layer for which the renderer is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ normalizationField?: 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#createContinuousRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * 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#createContinuousRenderer) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ sqlWhere?: string; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ legendOptions?: sizeCreateContinuousRendererParamsLegendOptions; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ statistics?: SummaryStatisticsResult; /** * 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 size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. 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) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. 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) and the symbol should be sized uniformly, for example with spheres. 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#createContinuousRenderer) - * + * * @default 2d */ symbolType?: string; } - export interface sizeCreateContinuousRendererParamsLegendOptions extends Object { /** * The title used to represent the given field or expression 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#createContinuousRenderer) */ title?: string; /** * Indicates whether to describe the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ showLegend?: boolean; } - export interface sizeCreateVisualVariablesParams extends Object { /** * The layer for which the visual variables are generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ field: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ normalizationField?: 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#createVisualVariables) - * + * * @default gray */ basemap?: string | Basemap; /** * 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#createVisualVariables) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ sqlWhere?: string; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ statistics?: SummaryStatisticsResult; /** * 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 size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ maxValue?: number; /** * When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 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-creators-size.html#createVisualVariables) */ worldScale?: boolean; /** * When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) - * + * * @default all */ axis?: string; } - export interface sizeCreateVisualVariablesParamsLegendOptions extends Object { /** * The title used to represent the given field or expression 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#createVisualVariables) */ title?: string; /** * Indicates whether to describe the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ showLegend?: boolean; @@ -22030,43 +21888,43 @@ declare namespace __esri { /** * The result object of the [createVisualVariables()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) 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#VisualVariableResult) */ export interface sizeVisualVariableResult extends Object { /** * An array of size visual variables configured based on the statistics of the data and the view scale. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The size scheme used by the main visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ 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#VisualVariableResult) */ basemapId: string; /** * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ authoringInfo: AuthoringInfo; @@ -22074,15 +21932,15 @@ declare namespace __esri { /** * This object contains helper methods for generating data-driven visualizations with unique types (or categories) based on a field value from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) method generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) object that may be applied directly to the layer used to generate it. This renderer contains unique values with colors best suited to the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html) */ interface type { /** * Generates a [PointCloudUniqueValueRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html) based on a given field of a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). This renderer visualizes points of the same type, usually from the `CLASS_CODE` field or an equivalent field that stores information related to the classification of the data (e.g. low vegetation, high vegetation, ground, etc.). The generated renderer visualizes each point with a standard predefined color matching the class code of the point. All that's required is a layer instance and field name. You can optionally set the size and density of the points to suit the needs of the desired visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) - * + * * @param params Input parameters for generating a renderer based on the given field of the input layer. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.field The name of the field containing classification data for the given layer. A common field name used for this renderer type is `CLASS_CODE`, though other fields can be used. @@ -22090,27 +21948,27 @@ declare namespace __esri { * @param params.density The number of points per inch in the view. * @param params.typeScheme In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.statistics 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. - * + * */ createPCClassRenderer(params: typeCreatePCClassRendererParams): IPromise; /** * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) that supports renderers. The renderer contains unique symbols representing a string or a numeric value returned from the indicated field. In most cases you will provide a `layer`, `basemap`, and `field` to generate this renderer. This is a scenario in which the values of the field aren't well known and the user doesn't know which 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @param params Input parameters for generating symbols to represent unique types based on data returned from a given field. See the table below for details of each parameter. * @param params.layer The layer for which the renderer is generated. * @param params.field The name of the field from which to extract unique values that will be used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. * @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.numTypes The number of types (or categories) displayed by the renderer. Use `-1` to display all returned types. - * @param params.sortBy + * @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 alphabetical order. - * + * * **Possible Values:** count | value * @param params.typeScheme In authoring apps, the user may select a pre-defined type 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 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. @@ -22118,9 +21976,9 @@ declare namespace __esri { * @param params.legendOptions Provides options for setting a title to a field that will override the field alias defined in the service. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @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 can be ignored for layers with a `mesh` geometry type. Possible values are described below. - * + * @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 can be ignored 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). | @@ -22128,15 +21986,15 @@ declare namespace __esri { * | 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) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly-sized 3D symbols with volumetric symbol layers. 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) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | * @param params.statistics 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. - * @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. - * + * @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: typeCreateRendererParams): IPromise; } @@ -22145,13 +22003,13 @@ declare namespace __esri { /** * The result object of the [createPCClassRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#PCClassRendererResult) */ export interface PCClassRendererResult extends Object { /** * The renderer object configured to represent the class codes in the point cloud. Set this object on the input layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#PCClassRendererResult) */ renderer: PointCloudUniqueValueRenderer; @@ -22159,212 +22017,209 @@ declare namespace __esri { /** * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.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-type.html#RendererResult) */ export interface typeRendererResult extends Object { /** * The renderer object configured to best match the given basemap. 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-type.html#RendererResult) */ renderer: UniqueValueRenderer; /** * An array of objects describing the value, symbol, and count of each unique type or category represented in the renderer. See the table below describing each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ excludedUniqueValueInfos: any[]; /** * The scheme used to represent each category within the `uniqueValueInfos`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ typeScheme: TypeScheme; /** * The ID of the basemap used to determine the optimal color scheme to represent the categorical variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ basemapId: string; } - export interface typeCreatePCClassRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) */ layer: PointCloudLayer; /** * The name of the field containing classification data for the given layer. A common field name used for this renderer type is `CLASS_CODE`, though other fields can be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) */ field: string; /** * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) - * + * * @default 100% */ size?: string; /** * The number of points per inch in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) - * + * * @default 25 */ density?: number; /** * In authoring apps, the user may select a pre-defined type 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-type.html#createPCClassRenderer) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) */ statistics?: UniqueValuesResult; } - export interface typeCreateRendererParams extends Object { /** * The layer for which the renderer is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field from which to extract unique values that will be used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ field?: 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-type.html#createRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * The number of types (or categories) displayed by the renderer. Use `-1` to display all returned types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @default 10 */ numTypes?: number; /** * 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 alphabetical order. - * + * * **Possible Values:** count | value - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @default count */ sortBy?: string; /** * In authoring apps, the user may select a pre-defined type 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-type.html#createRenderer) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ valueExpressionTitle?: string; /** * Provides options for setting a title to a field that will override the field alias defined in the service. This title will represent the field 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#createRenderer) */ legendOptions?: typeCreateRendererParamsLegendOptions; /** * 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-type.html#createRenderer) */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored 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) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly-sized 3D symbols with volumetric symbol layers. 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) and the symbol should be sized uniformly, for example with spheres. 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-type.html#createRenderer) - * + * * @default 2d */ symbolType?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ statistics?: UniqueValuesResult; /** - * **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. - * + * **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-type.html#createRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface typeCreateRendererParamsLegendOptions extends Object { /** * The title used to represent the given field 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#createRenderer) */ title: string; @@ -22372,31 +22227,31 @@ declare namespace __esri { /** * 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 a layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ value: string | number; /** * 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#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#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#UniqueValueInfo) */ symbol: Symbol; @@ -22404,15 +22259,15 @@ declare namespace __esri { /** * This object contains helper methods for generating data-driven univariate visualizations using both continuous color and continuous size 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 [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) method generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) object that may be applied directly to a supported layer. This renderer contains a continuous color and size ramp with optimal colors based on the indicated basemap and mapped to specific break values based on the statistics of the indicated field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) */ interface univariateColorSize { /** * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The renderer contains continuous color and size visual variables that map symbols with optimal colors and sizes based on the indicated basemap to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, `field`, and `theme` 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 and 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-univariateColorSize.html#createContinuousRenderer) - * + * * @param params See the table below for details of each parameter that may be passed to this method. * @param params.layer The layer for which the visual variable is generated. * @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. @@ -22429,23 +22284,25 @@ declare namespace __esri { * @param params.colorOptions Options for configuring the color portion of the visualization. * @param params.sizeOptions Options for configuring the size portion of the visualization. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. 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) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. 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) and the symbol should be sizes uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * + * */ - createContinuousRenderer(params: univariateColorSizeCreateContinuousRendererParams): IPromise; + createContinuousRenderer( + params: univariateColorSizeCreateContinuousRendererParams + ): IPromise; /** * This method generates color and size visual variables, both based on the same given field or expression. These visual variables are generated with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and colors based on the input basemap. 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` and/or 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 one color visual variable, and one or two size visual variables depending on the value of the `sizeOptions.axis` parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) - * + * * @param params Input parameters for generating color and size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visual variable is generated. * @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. @@ -22462,7 +22319,7 @@ declare namespace __esri { * @param params.sizeOptions Options for configuring the size portion of the visualization. * @param params.view When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * */ createVisualVariables(params: univariateColorSizeCreateVisualVariablesParams): IPromise; } @@ -22471,391 +22328,381 @@ declare namespace __esri { /** * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ export interface univariateColorSizeContinuousRendererResult 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-univariateColorSize.html#ContinuousRendererResult) */ renderer: ClassBreaksRenderer; /** * Object containing visual variable and scheme information for the color portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ color: ContinuousRendererResultColor; /** * Object containing visual variable and scheme information for the size portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ size: ContinuousRendererResultSize; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ 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-univariateColorSize.html#ContinuousRendererResult) */ basemapId: string; } - export interface univariateColorSizeCreateContinuousRendererParams extends Object { /** * The layer for which the visual variable is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * 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-univariateColorSize.html#createContinuousRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ normalizationField?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ sqlWhere?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ statistics?: SummaryStatisticsResult; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ defaultSymbolEnabled?: boolean; /** * Options for configuring the color portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ colorOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptions; /** * Options for configuring the size portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ sizeOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptions; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. 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) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. 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) and the symbol should be sizes uniformly, for example with spheres. 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-univariateColorSize.html#createContinuousRenderer) - * + * * @default 2d */ symbolType?: string; } - export interface univariateColorSizeCreateContinuousRendererParamsColorOptions extends Object { /** * 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-univariateColorSize.html#createContinuousRenderer) */ theme?: string; /** * 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-univariateColorSize.html#createContinuousRenderer) */ colorScheme?: ColorScheme; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ legendOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions; } - export interface univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions extends Object { /** * The title used to represent the given field or expression 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-univariateColorSize.html#createContinuousRenderer) */ title: string; } - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptions extends Object { /** * 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-univariateColorSize.html#createContinuousRenderer) */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ legendOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions; } - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions extends Object { /** * The title used to represent the given field or expression 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-univariateColorSize.html#createContinuousRenderer) */ title: string; } - export interface univariateColorSizeCreateVisualVariablesParams extends Object { /** * The layer for which the visual variable is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * 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-univariateColorSize.html#createVisualVariables) - * + * * @default gray */ basemap?: string | Basemap; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ normalizationField?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ valueExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ sqlWhere?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ statistics?: SummaryStatisticsResult; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ maxValue?: number; /** * Options for configuring the color portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ colorOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptions; /** * Options for configuring the size portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ sizeOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptions; /** * When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 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-creators-univariateColorSize.html#createVisualVariables) */ worldScale?: boolean; } - export interface univariateColorSizeCreateVisualVariablesParamsColorOptions extends Object { /** * 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-univariateColorSize.html#createVisualVariables) */ theme?: string; /** * 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-univariateColorSize.html#createVisualVariables) */ colorScheme?: ColorScheme; /** * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ legendOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions; } - export interface univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions extends Object { /** * The title used to represent the given field or expression 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-univariateColorSize.html#createVisualVariables) */ title: string; } - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions extends Object { /** * When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) - * + * * @default all */ axis?: boolean; /** * 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-univariateColorSize.html#createVisualVariables) */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; } - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions extends Object { /** * The title used to represent the given field or expression 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-univariateColorSize.html#createVisualVariables) */ title: string; @@ -22863,107 +22710,103 @@ declare namespace __esri { /** * The result object of the [createVisualVariables()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ export interface VisualVariablesResult extends Object { /** * Object containing visual variable and scheme information for the color portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ color: VisualVariablesResultColor; /** * Object containing visual variable and scheme information for the size portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ size: VisualVariablesResultSize; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ 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-univariateColorSize.html#VisualVariablesResult) */ basemapId: string; /** * Authoring information related to the creation of the visual variables. This includes inforamation related to UI inputs from sliders and selected themes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ authoringInfo: AuthoringInfo; } - export interface ContinuousRendererResultColor extends Object { /** * 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-univariateColorSize.html#ContinuousRendererResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ colorScheme: ColorScheme; } - export interface ContinuousRendererResultSize extends Object { /** * The size visual variable(s) configured based on the statistics of the data and the view scale. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The size scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ sizeScheme: SizeScheme; } - export interface VisualVariablesResultColor extends Object { /** * 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-univariateColorSize.html#VisualVariablesResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ colorScheme: ColorScheme; } - export interface VisualVariablesResultSize extends Object { /** * The size visual variable(s) configured based on the statistics of the data and the view scale. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The size scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ sizeScheme: SizeScheme; @@ -22971,22 +22814,22 @@ declare namespace __esri { /** * Function for generating class breaks for an input field in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) based on a given classification method and normalization type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html) */ interface classBreaks { /** * Generates class breaks for an input field (or expression) of a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) based on a given classification method and normalization type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) - * + * * @param params See the table below for details about parameters that may be passed to this function. * @param params.layer The layer from which to generate class breaks. * @param params.field The class breaks will be generated based on values of this field. If a field is provided, the values from the given field from all features will be queried in the service. * @param params.normalizationField The field by which to normalize the values returned from the given `field`. - * @param params.classificationMethod - * The method for classifying the data. See the table below for a list of possible values. - * + * @param params.classificationMethod + * The method for classifying the data. See the table below for a list of possible values. + * * | Possible Value | Description | * |---------------|------------ | * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | @@ -23002,7 +22845,7 @@ declare namespace __esri { * @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. - * + * */ classBreaks(params: classBreaksClassBreaksParams): IPromise; } @@ -23010,92 +22853,90 @@ declare namespace __esri { const __classBreaksMapped: classBreaks; export const classBreaks: typeof __classBreaksMapped.classBreaks; - - export interface classBreaksClassBreaksParams extends Object { /** * The layer from which to generate class breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; /** * The class breaks will be generated based on values of this field. If a field is provided, the values from the given field from all features will be queried in the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ field?: string; /** * The field by which to normalize the values returned from the given `field`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ normalizationField?: string; /** - * The method for classifying the data. See the table below for a list of possible values. - * + * The method for classifying the data. See the table below for a list of possible values. + * * | Possible Value | Description | * |---------------|------------ | * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | * | equal-interval | Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. | * | quantile | Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. | * | standard-deviation | Class breaks are placed above and below the mean value at intervals of `1`, `0.5`, or `0.25` standard deviations until all the data values are included in a class. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ classificationMethod?: string; /** * When `classificationMethod = "standard-deviation"`, this sets the interval at which each class break should be set (e.g. `0.25`, `0.33`, `0.5`, `1`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ standardDeviationInterval?: number; /** * The minimum bounding value for the class breaks definition. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ minValue?: number; /** * The maximum bounding value for the class breaks definition. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ maxValue?: number; /** * Indicates the number of classes to generate for the class breaks definition. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ numClasses?: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ valueExpression?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ sqlWhere?: string; /** * 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. - * + * * [Read more...](global.html) */ view?: View; /** * A subset of features for which to generate the class breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ features?: Graphic[]; @@ -23103,53 +22944,52 @@ declare namespace __esri { /** * Object returned from the [classBreaks()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) method. This object describes classes generated from data in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) for a given field with a specified classification method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ export interface ClassBreaksResult extends Object { /** * An array of objects describing the class breaks generated from the [classBreaks()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ classBreaksInfos: ClassBreaksResultClassBreaksInfos[]; /** * The minimum value of features in the dataset. This will be the lower bound of the lowest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ minValue: number; /** * The maximum value of features in the dataset. This will be the upper bound of the highest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ maxValue: number; /** * The normalization total if `normalizationType` is set to `percent-of-total` when generating class breaks with [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ normalizationTotal: number; } - export interface ClassBreaksResultClassBreaksInfos extends Object { /** * The label describing the given class break for use 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-statistics-classBreaks.html#ClassBreaksResult) */ label: string; /** * The lower bound of the class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ minValue: number; /** * The upper bound of the class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ maxValue: number; @@ -23157,22 +22997,22 @@ declare namespace __esri { /** * Generates a histogram based on data in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) for a given field. The returned object can be used for displaying a histogram in the UI within visualization authoring applications and analytical apps that query and display statistics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) */ interface histogram { /** * Generates a histogram for data returned from a `field` in a given `layer`. The returned object can be used for displaying a histogram to the UI in visualization authoring applications and analytical apps that query and display statistics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) - * + * * @param params See the table below for details on parameters that may be passed to this function. * @param params.layer The layer for which to generate a histogram. * @param params.field The name of the numeric field for which the histogram will be generated. This property is ignored if a `valueExpression` is used. * @param params.normalizationField The field by which to normalize the values returned from the given `field`. - * @param params.classificationMethod - * The method for classifying the data. See the table below for a list of possible values. - * + * @param params.classificationMethod + * The method for classifying the data. See the table below for a list of possible values. + * * | Possible Value | Description | * |---------------|------------ | * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | @@ -23188,7 +23028,7 @@ declare namespace __esri { * @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. - * + * */ histogram(params: histogramHistogramParams): IPromise; } @@ -23196,94 +23036,92 @@ declare namespace __esri { const __histogramMapped: histogram; export const histogram: typeof __histogramMapped.histogram; - - export interface histogramHistogramParams extends Object { /** * The layer for which to generate a histogram. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; /** * The name of the numeric field for which the histogram will be generated. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ field?: string; /** * The field by which to normalize the values returned from the given `field`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ normalizationField?: string; /** - * The method for classifying the data. See the table below for a list of possible values. - * + * The method for classifying the data. See the table below for a list of possible values. + * * | Possible Value | Description | * |---------------|------------ | * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | * | equal-interval | Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. | * | quantile | Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. | * | standard-deviation | Class breaks are placed above and below the mean value at intervals of `1`, `0.5`, or `0.25` standard deviations until all the data values are included in a class. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ classificationMethod?: string; /** * When `classificationMethod = "standard-deviation"`, this sets the interval at which each class break should be set (e.g. `0.25`, `0.33`, `0.5`, `1`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ standardDeviationInterval?: number; /** * The minimum bounding value for the histogram. Use this in conjunction with `maxValue` to generate a histogram between custom lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ minValue?: number; /** * The maximum bounding value for the histogram. Use this in conjunction with `minValue` to generate a histogram between custom lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ maxValue?: number; /** * Indicates the number of classes to generate for the histogram. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) - * + * * @default 10 */ numBins?: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ valueExpression?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ sqlWhere?: string; /** * 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. - * + * * [Read more...](global.html) */ view?: View; /** * A subset of features for which to generate the histogram. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ features?: Graphic[]; @@ -23291,47 +23129,46 @@ declare namespace __esri { /** * The result returned from the [histogram()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ export interface HistogramResult extends Object { /** * An array of objects representing each bin in the histogram. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ bins: HistogramResultBins[]; /** * The minimum value returned by the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ minValue: number; /** * The maximum value returned by the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ maxValue: number; } - export interface HistogramResultBins extends Object { /** * The number of features that are contained between the indicated `minValue` and `maxValue`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ count: number; /** * The minimum value of the bin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ minValue: number; /** * The maximum value of the bin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ maxValue: number; @@ -23339,15 +23176,15 @@ declare namespace __esri { /** * Function for generating attribute statistics in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on values returned from a given field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) */ interface summaryStatistics { /** * Returns an object containing various statistics describing a set of values returned from a field (or expression) in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) - * + * * @param params See the table below for details of each parameter. * @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. @@ -23359,7 +23196,7 @@ declare namespace __esri { * @param params.maxValue The maximum bounding value for the statistics calculation. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. * @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 calculate the statistics. - * + * */ summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; } @@ -23367,116 +23204,114 @@ declare namespace __esri { const __summaryStatisticsMapped: summaryStatistics; export const summaryStatistics: typeof __summaryStatisticsMapped.summaryStatistics; - /** * The statistics returned from the [summaryStatistics()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ export interface SummaryStatisticsResult extends Object { /** * The average of all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ avg: number; /** * The number of features evaluated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ count: number; /** * The maximum of all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ max: number; /** * The minimum of all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ min: number; /** * The standard deviation calculated from values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ stddev: number; /** * The sum of all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ sum: number; /** * The calculated variance from all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ variance: number; } - export interface summaryStatisticsSummaryStatisticsParams extends Object { /** * The layer from which to generate statistics for the given `field`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; /** * The name of the numeric field for which the summary statistics will be generated. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ valueExpression?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ sqlWhere?: string; /** * The field by which to normalize the values returned from the given `field`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ normalizationField?: string; /** * The minimum bounding value for the statistics calculation. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ minValue?: number; /** * The maximum bounding value for the statistics calculation. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ maxValue?: number; /** * 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. - * + * * [Read more...](global.html) */ view?: View; /** * A subset of features for which to calculate the statistics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ features?: Graphic[]; @@ -23484,15 +23319,15 @@ declare namespace __esri { /** * A function that queries for unique values from a field in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) */ interface uniqueValues { /** * Returns an object containing an array of unique values queried from a given field (or values returned from an expression) in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) along with the total count of features that belong to the given category. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) - * + * * @param params See the table below for details of each parameter. * @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. @@ -23502,7 +23337,7 @@ declare namespace __esri { * @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. * @param params.features A subset of features for which to generate the unique values. - * + * */ uniqueValues(params: uniqueValuesUniqueValuesParams): IPromise; } @@ -23510,133 +23345,130 @@ declare namespace __esri { const __uniqueValuesMapped: uniqueValues; export const uniqueValues: typeof __uniqueValuesMapped.uniqueValues; - /** * An object that contains the unique values returned from the [uniqueValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) query of a layer's field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) */ export interface UniqueValuesResult extends 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) */ uniqueValueInfos: UniqueValuesResultUniqueValueInfos[]; } - export interface uniqueValuesUniqueValuesParams extends Object { /** * The layer from which to query for unique values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ field?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ valueExpression?: string; /** * 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) */ sqlExpression?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ sqlWhere?: string; /** * Indicates that all domain codes should be returned if the given field has domain values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ returnAllCodedValues?: boolean; /** * 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. - * + * * [Read more...](global.html) */ view?: View; /** * A subset of features for which to generate the unique values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ features?: Graphic[]; } - export interface UniqueValuesResultUniqueValueInfos extends Object { /** * A unique value representing a type or category of features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) */ value: string | number; /** * The number of features assigned the given `value` (or belonging to the given category). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) */ count: number; } - interface symbologyColor { /** * Clones a color scheme object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#cloneScheme) - * + * * @param scheme The color scheme object to clone. - * + * */ cloneScheme(scheme: ColorScheme): ColorScheme; /** * Flips the colors in reverse order of the input color scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#flipColors) - * + * * @param scheme The color scheme to reverse. - * + * */ 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. - * + * + * @param params See the table below for details of each parameter that may be passed to this function. + * @param params.theme The name of the theme from which to get color schemes. + * @param params.colors An array of colors used to match with schemes for the given theme. + * @param params.geometryType The geometry type of the layer for which the color scheme will be applied. + * @param params.worldScale Indicates whether 3D volumetric symbols will be used in the visualization. + * @param params.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[]; + getMatchingSchemes(params: colorGetMatchingSchemesParams): 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.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 against the given basemap. * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh - * @param params.theme + * @param params.theme * The 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) | @@ -23645,59 +23477,91 @@ declare namespace __esri { * | 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): ColorSchemes; /** * Returns metadata for the available themes. If a `basemap` is provided, returns themes that look best with the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getThemes) - * + * * @param basemap The [Esri basemap string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or object that will be used with the returned theme(s). - * + * */ getThemes(basemap?: string | Basemap): any[]; } export const symbologyColor: symbologyColor; + export interface colorGetMatchingSchemesParams extends Object { + /** + * The name of the theme from which to get color schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + */ + theme: string; + /** + * An array of colors used to match with schemes for the given theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + */ + colors: Color[]; + /** + * The geometry type of the layer for which the color scheme will be applied. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + */ + geometryType: string; + /** + * Indicates whether 3D volumetric symbols will be used in the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + */ + worldScale?: boolean; + /** + * 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. + * + * [Read more...](global.html) + */ + view?: SceneView; + } export interface colorGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.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-color.html#getSchemes) */ geometryType: string; /** * The 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) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) */ theme: string; /** * 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; /** * 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-color.html#getSchemes) */ worldScale?: boolean; @@ -23705,58 +23569,58 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize features with attribute data-driven color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) */ 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#ColorSchemeForMesh) */ 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#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#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#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#ColorSchemeForMesh) */ 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; @@ -23764,63 +23628,63 @@ declare namespace __esri { /** * 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#ColorSchemeForPoint) */ outline: ColorSchemeForPointOutline; /** * 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#ColorSchemeForPoint) */ size: number; /** * The opacity of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ opacity: number; @@ -23828,57 +23692,57 @@ declare namespace __esri { /** * 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; @@ -23886,57 +23750,57 @@ declare namespace __esri { /** * 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#ColorSchemeForPolyline) */ opacity: number; @@ -23944,177 +23808,169 @@ declare namespace __esri { /** * 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 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#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#ColorSchemeForMesh) */ numClasses: number; } - 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#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#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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#cloneScheme) - * + * * @param scheme The location scheme object to clone. - * + * */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.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 on top of the given basemap. * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * @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: locationGetSchemesParams): LocationSchemes; } export const symbologyLocation: symbologyLocation; - export interface locationGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features on top of the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.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-location.html#getSchemes) */ geometryType: string; /** * 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; /** * 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-location.html#getSchemes) */ worldScale?: boolean; @@ -24122,26 +23978,30 @@ declare namespace __esri { /** * 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#LocationScheme) */ - export type LocationScheme = LocationSchemeForPoint | LocationSchemeForPolyline | LocationSchemeForPolygon | LocationSchemeForMesh; + 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 color of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForMesh) */ color: Color; /** * The opacity of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForMesh) */ opacity: number; @@ -24149,31 +24009,31 @@ declare namespace __esri { /** * 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#LocationSchemeForPoint) */ 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; @@ -24181,25 +24041,25 @@ declare namespace __esri { /** * 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#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#LocationSchemeForPolygon) */ outline: LocationSchemeForPolygonOutline; /** * The opacity of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ opacity: number; @@ -24207,25 +24067,25 @@ 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#LocationSchemeForPolyline) */ 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#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#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#LocationSchemeForPolyline) */ opacity: number; @@ -24233,78 +24093,75 @@ declare namespace __esri { /** * 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 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#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#LocationSchemeForPoint) */ width: number; } - 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#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#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 @@ -24312,50 +24169,49 @@ declare namespace __esri { * @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; @@ -24363,32 +24219,36 @@ declare namespace __esri { /** * 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; + 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; @@ -24396,37 +24256,37 @@ declare namespace __esri { /** * 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; @@ -24434,37 +24294,37 @@ declare namespace __esri { /** * 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; @@ -24472,37 +24332,37 @@ declare namespace __esri { /** * 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; @@ -24510,122 +24370,118 @@ declare namespace __esri { /** * 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; @@ -24633,38 +24489,42 @@ declare namespace __esri { /** * 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; + 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; @@ -24672,43 +24532,43 @@ declare namespace __esri { /** * 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; @@ -24716,37 +24576,37 @@ declare namespace __esri { /** * 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; @@ -24754,37 +24614,37 @@ declare namespace __esri { /** * 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; @@ -24792,177 +24652,169 @@ declare namespace __esri { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#cloneScheme) - * + * * @param scheme The SizeScheme object to clone. - * + * */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.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 * @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): SizeSchemes; } export const symbologySize: symbologySize; - export interface sizeGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) */ basemap: string | Basemap; /** * 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) */ geometryType: string; /** * 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; /** * 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-size.html#getSchemes) */ worldScale?: boolean; @@ -24970,62 +24822,62 @@ declare namespace __esri { /** * 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; /** * 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; @@ -25033,25 +24885,25 @@ declare namespace __esri { /** * 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; @@ -25059,49 +24911,49 @@ declare namespace __esri { /** * 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; @@ -25109,138 +24961,133 @@ declare namespace __esri { /** * 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#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#SizeSchemeForPoint) */ width: number; } - 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#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#SizeSchemeForPolygon) */ outline: SizeSchemeForPolygonBackgroundOutline; } - 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#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#SizeSchemeForPolygon) */ width: number; } - interface symbologyType { /** * Clones a type scheme object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#cloneScheme) - * + * * @param scheme The type scheme object to clone. - * + * */ cloneScheme(scheme: TypeScheme): TypeScheme; /** * 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 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): TypeSchemes; } export const symbologyType: symbologyType; - export interface typeGetSchemesParams 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-type.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-type.html#getSchemes) */ geometryType: string; /** * 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 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.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-type.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; @@ -25248,32 +25095,32 @@ declare namespace __esri { /** * 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; /** * 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; @@ -25281,37 +25128,37 @@ declare namespace __esri { /** * 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; @@ -25319,31 +25166,31 @@ declare namespace __esri { /** * 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; @@ -25351,31 +25198,31 @@ declare namespace __esri { /** * 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; @@ -25383,57 +25230,55 @@ declare namespace __esri { /** * 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#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#TypeSchemeForPoint) */ width: number; } - 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#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#TypeSchemeForPolygon) */ width: number; @@ -25442,79 +25287,77 @@ declare namespace __esri { interface AuthoringInfo extends Accessor, JSONSupport { /** * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Possible Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) */ classificationMethod: string; /** * 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: AuthoringInfoField1; /** * 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: AuthoringInfoField2; /** * 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[]; /** * 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) */ focus: string; /** * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Possible Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#lengthUnit) */ lengthUnit: string; /** * 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) */ numClasses: number; /** * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Possible Values:** 0.25 | 0.33 | 0.5 | 1 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#standardDeviationInterval) */ standardDeviationInterval: number; /** * 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) */ type: string; /** * Contains authoring properties of visual variables generated from one of the Smart Mapping methods or sliders. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#visualVariables) */ visualVariables: AuthoringInfoVisualVariable[]; /** * Creates a deep clone of the instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#clone) - * - * + * + * */ clone(): AuthoringInfo; } interface AuthoringInfoConstructor { - - - new(properties?: AuthoringInfoProperties): AuthoringInfo; + new (properties?: AuthoringInfoProperties): AuthoringInfo; fromJSON(json: any): AuthoringInfo; } @@ -25524,117 +25367,115 @@ declare namespace __esri { interface AuthoringInfoProperties { /** * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Possible Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) */ classificationMethod?: string; /** * 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?: AuthoringInfoField1; /** * 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?: AuthoringInfoField2; /** * 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[]; /** * 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) */ focus?: string; /** * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Possible Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#lengthUnit) */ lengthUnit?: string; /** * 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) */ numClasses?: number; /** * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Possible Values:** 0.25 | 0.33 | 0.5 | 1 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#standardDeviationInterval) */ standardDeviationInterval?: number; /** * 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) */ type?: string; /** * Contains authoring properties of visual variables generated from one of the Smart Mapping methods or sliders. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#visualVariables) */ 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; @@ -25643,73 +25484,71 @@ declare namespace __esri { interface AuthoringInfoVisualVariable extends Accessor, JSONSupport { /** * If an age or timeline renderer was generated, indicates the end time of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#endTime) */ endTime: string | number; /** * Indicates the field name used for generating the data-driven visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#field) */ field: string; /** * Indicates the value of the upper handle if a slider was used to generate the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#maxSliderValue) */ maxSliderValue: number; /** * Indicates the value of the lower handle if a slider was used to generate the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#minSliderValue) */ minSliderValue: number; /** * If an age or timeline renderer was generated, indicates the start time of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#startTime) */ startTime: string | number; /** * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Possible Values:** percent | percent-of-total | ratio - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#style) */ style: string; /** * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Possible Values:** above-and-below | centered-on | extremes | high-to-low - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#theme) */ theme: string; /** * The type of visual variable generated. **Possible Values:** color | size | opacity - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#type) */ type: string; /** * If an age or timeline renderer was generated, indicates the time units used. **Possible Values:** seconds | minutes | hours | days | months | years - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#units) */ units: string; /** * Creates a deep clone of the instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#clone) - * - * + * + * */ clone(): AuthoringInfoVisualVariable; } interface AuthoringInfoVisualVariableConstructor { - - - new(properties?: AuthoringInfoVisualVariableProperties): AuthoringInfoVisualVariable; + new (properties?: AuthoringInfoVisualVariableProperties): AuthoringInfoVisualVariable; fromJSON(json: any): AuthoringInfoVisualVariable; } @@ -25719,55 +25558,55 @@ declare namespace __esri { interface AuthoringInfoVisualVariableProperties { /** * If an age or timeline renderer was generated, indicates the end time of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#endTime) */ endTime?: string | number; /** * Indicates the field name used for generating the data-driven visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#field) */ field?: string; /** * Indicates the value of the upper handle if a slider was used to generate the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#maxSliderValue) */ maxSliderValue?: number; /** * Indicates the value of the lower handle if a slider was used to generate the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#minSliderValue) */ minSliderValue?: number; /** * If an age or timeline renderer was generated, indicates the start time of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#startTime) */ startTime?: string | number; /** * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Possible Values:** percent | percent-of-total | ratio - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#style) */ style?: string; /** * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Possible Values:** above-and-below | centered-on | extremes | high-to-low - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#theme) */ theme?: string; /** * The type of visual variable generated. **Possible Values:** color | size | opacity - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#type) */ type?: string; /** * If an age or timeline renderer was generated, indicates the time units used. **Possible Values:** seconds | minutes | hours | days | months | years - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#units) */ units?: string; @@ -25776,31 +25615,29 @@ declare namespace __esri { interface HeatmapColorStop extends Accessor { /** * The color to shade a given pixel based on its calculated pixel intensity [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color) */ color: Color; /** * The ratio of a pixel's intensity value to the [minPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) of the renderer. The ratio of each pixel is matched to the corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) */ ratio: number; /** * Creates a deep clone of the color stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#clone) - * - * + * + * */ clone(): HeatmapColorStop; } interface HeatmapColorStopConstructor { - - - new(properties?: HeatmapColorStopProperties): HeatmapColorStop; + new (properties?: HeatmapColorStopProperties): HeatmapColorStop; } export const HeatmapColorStop: HeatmapColorStopConstructor; @@ -25808,61 +25645,60 @@ declare namespace __esri { interface HeatmapColorStopProperties { /** * The color to shade a given pixel based on its calculated pixel intensity [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color) */ color?: Color | number[] | string; /** * The ratio of a pixel's intensity value to the [minPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) of the renderer. The ratio of each pixel is matched to the corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) */ ratio?: number; } - interface supportJsonUtils { /** * Creates a new instance of an appropriate [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-jsonUtils.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/renderer-objects.htm) for examples of the structure of various input JSON objects. - * + * */ fromJSON(json: any): Renderer; } export const supportJsonUtils: supportJsonUtils; - interface UniqueValueRenderer extends Renderer, VisualVariablesMixin { + interface UniqueValueRenderer extends Renderer, VisualVariablesRenderer { /** - * This property is only relevant When symbolizing polygon features with marker symbols (or [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html)) in the [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) of this renderer. This is usually done when adding a [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#visualVariables)) in a bivariate visualization (color indicates a type-based value and size indicates the value of a separate numeric field). Use this property to set a background [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) (or [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) if visualizing data in 3D) to visualize the boundaries of each polygon. - * + * This property is only relevant When symbolizing polygon features with marker symbols (or [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html)) in the [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) of this renderer. This is usually done when adding a [SizeVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#visualVariables)) in a bivariate visualization (color indicates a type-based value and size indicates the value of a separate numeric field). Use this property to set a background [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) (or [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) if visualizing data in 3D) to visualize the boundaries of each polygon. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#backgroundFillSymbol) */ backgroundFillSymbol: FillSymbol | PolygonSymbol3D; /** * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultLabel) */ defaultLabel: string; /** - * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. + * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) */ defaultSymbol: Symbol; /** * 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; /** - * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: + * 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 * var renderer = { * type: "unique-value", // autocasts as new UniqueValueRenderer() @@ -25881,15 +25717,15 @@ declare namespace __esri { * ] * }; * ``` - * + * * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) and `field2` are unique values and * may have their own symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2) */ field2: string; /** - * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: + * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: * ```js * var renderer = { * type: "unique-value", // autocasts as new UniqueValueRenderer() @@ -25909,84 +25745,84 @@ declare namespace __esri { * ] * }; * ``` - * + * * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field), [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2), and `field3` are unique values and * may have their own symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field3) */ field3: string; /** * String inserted between the values if multiple attribute fields are specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#fieldDelimiter) */ fieldDelimiter: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) */ legendOptions: UniqueValueRendererLegendOptions; /** * The type of Renderer. For UniqueValueRenderer this value is always `unique-value`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#type) */ readonly type: "unique-value"; /** * Each element in the array is an object that provides information about a unique value associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ uniqueValueInfos: UniqueValueRendererUniqueValueInfos[]; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) for data-driven visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) */ 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle) */ valueExpressionTitle: string; /** * Adds a unique value and symbol to the renderer. You can provide the value and its associated symbol as individual arguments or as an info object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#addUniqueValueInfo) - * + * * @param valueOrInfo The value to match. The value can be provided as an individual argument or as an [info object described in uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos). * @param symbol The symbol used to represent features matching the specified `value`. - * + * */ addUniqueValueInfo(valueOrInfo: string | number | any, symbol?: Symbol | SymbolProperties): void; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#clone) - * - * + * + * */ clone(): UniqueValueRenderer; /** * Returns rendering and legend information (as defined by the renderer) associated with the given graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#getUniqueValueInfo) - * + * * @param graphic The graphic whose rendering and legend information will be returned. - * + * */ getUniqueValueInfo(graphic: Graphic): any; /** * Removes a unique value from the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#removeUniqueValueInfo) - * + * * @param value Value to remove from [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos). - * + * */ removeUniqueValueInfo(value: string): void; } @@ -25994,45 +25830,45 @@ declare namespace __esri { interface UniqueValueRendererConstructor { /** * UniqueValueRenderer allows you to symbolize features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on one or more matching string attributes. This is typically done by using unique colors, fill styles, or images to represent features with equal values in a string field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html) */ - new(properties?: UniqueValueRendererProperties): UniqueValueRenderer; + new (properties?: UniqueValueRendererProperties): UniqueValueRenderer; fromJSON(json: any): UniqueValueRenderer; } export const UniqueValueRenderer: UniqueValueRendererConstructor; - interface UniqueValueRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + interface UniqueValueRendererProperties extends RendererProperties, VisualVariablesRendererProperties { /** - * This property is only relevant When symbolizing polygon features with marker symbols (or [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html)) in the [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) of this renderer. This is usually done when adding a [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#visualVariables)) in a bivariate visualization (color indicates a type-based value and size indicates the value of a separate numeric field). Use this property to set a background [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) (or [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) if visualizing data in 3D) to visualize the boundaries of each polygon. - * + * This property is only relevant When symbolizing polygon features with marker symbols (or [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html)) in the [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) of this renderer. This is usually done when adding a [SizeVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#visualVariables)) in a bivariate visualization (color indicates a type-based value and size indicates the value of a separate numeric field). Use this property to set a background [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) (or [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) if visualizing data in 3D) to visualize the boundaries of each polygon. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#backgroundFillSymbol) */ backgroundFillSymbol?: FillSymbolProperties | PolygonSymbol3DProperties; /** * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultLabel) */ defaultLabel?: string; /** - * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. + * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) */ defaultSymbol?: SymbolProperties; /** * 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; /** - * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: + * 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 * var renderer = { * type: "unique-value", // autocasts as new UniqueValueRenderer() @@ -26051,15 +25887,15 @@ declare namespace __esri { * ] * }; * ``` - * + * * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) and `field2` are unique values and * may have their own symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2) */ field2?: string; /** - * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: + * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: * ```js * var renderer = { * type: "unique-value", // autocasts as new UniqueValueRenderer() @@ -26079,133 +25915,1089 @@ declare namespace __esri { * ] * }; * ``` - * + * * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field), [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2), and `field3` are unique values and * may have their own symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field3) */ field3?: string; /** * String inserted between the values if multiple attribute fields are specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#fieldDelimiter) */ fieldDelimiter?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) */ legendOptions?: UniqueValueRendererLegendOptions; /** * Each element in the array is an object that provides information about a unique value associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ uniqueValueInfos?: UniqueValueRendererUniqueValueInfos[]; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) for data-driven visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) */ 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle) */ valueExpressionTitle?: string; } - export interface UniqueValueRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) or [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) */ title?: string; } - export interface UniqueValueRendererUniqueValueInfos extends Object { /** * The unique value used to classify features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ value: string | number; /** * The symbol used to style features whose value matches `value`. This value may be autocast by specifying the symbol `type`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ symbol: Symbol; /** * Label used to describe features matched to this unique value 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-UniqueValueRenderer.html#uniqueValueInfos) */ label?: string; } - interface VisualVariablesMixin { + interface ColorVariable extends VisualVariable, JSONSupport { /** - * 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/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. - * > **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) + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#normalizationField) */ - visualVariables: any[]; - } - - interface VisualVariablesMixinConstructor { - - - new(): VisualVariablesMixin; - } - - export const VisualVariablesMixin: VisualVariablesMixinConstructor; - - interface VisualVariablesMixinProperties { + normalizationField: string; /** - * 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/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. - * > **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) + * An array of sequential objects, or stops, that defines a continuous color ramp. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with values that fall between the given stops will be assigned colors linearly interpolated along the ramp in relation to the nearest stop values. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) */ - visualVariables?: any[]; + stops: ColorStop[]; + /** + * The visual variable type. For ColorVariable, this value is always `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#type) + */ + readonly type: "color"; + + /** + * Creates a deep clone of the ColorVariable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#clone) + * + * + */ + clone(): ColorVariable; } + interface ColorVariableConstructor { + /** + * The color visual variable is used to visualize features along a continuous color ramp based on the values of a numeric attribute [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#field) or an [expression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#valueExpression). The color ramp is defined along a sequence of [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops), where color values are mapped to data values. Data values that fall between two stops are assigned a color that is linearly interpolated based on the value's position relative to the closest defined stops. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html) + */ + + new (properties?: ColorVariableProperties): ColorVariable; + + fromJSON(json: any): ColorVariable; + } + + export const ColorVariable: ColorVariableConstructor; + + interface ColorVariableProperties extends VisualVariableProperties { + /** + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#normalizationField) + */ + normalizationField?: string; + /** + * An array of sequential objects, or stops, that defines a continuous color ramp. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with values that fall between the given stops will be assigned colors linearly interpolated along the ramp in relation to the nearest stop values. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) + */ + stops?: ColorStopProperties[]; + } + + interface OpacityVariable extends VisualVariable, JSONSupport { + /** + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#normalizationField) + */ + normalizationField: string; + /** + * An array of objects that defines the opacity to apply to features in a layer in a sequence of stops. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with data values that fall between the given stops will be assigned opacity values linearly interpolated along the ramp in relation to the stop values. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) + */ + stops: OpacityStop[]; + /** + * The visual variable type. For OpacityVariable, this value is always `opacity`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#type) + */ + readonly type: "opacity"; + + /** + * Creates a deep clone of the OpacityVariable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#clone) + * + * + */ + clone(): OpacityVariable; + } + + interface OpacityVariableConstructor { + /** + * The opacity visual variable defines the opacity of each feature's symbol based on a numeric [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#field) value or number returned from an [expression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#valueExpression). You must specify [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) to construct the opacity ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html) + */ + + new (properties?: OpacityVariableProperties): OpacityVariable; + + fromJSON(json: any): OpacityVariable; + } + + export const OpacityVariable: OpacityVariableConstructor; + + interface OpacityVariableProperties extends VisualVariableProperties { + /** + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#normalizationField) + */ + normalizationField?: string; + /** + * An array of objects that defines the opacity to apply to features in a layer in a sequence of stops. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with data values that fall between the given stops will be assigned opacity values linearly interpolated along the ramp in relation to the stop values. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) + */ + stops?: OpacityStopProperties[]; + } + + interface RotationVariable extends VisualVariable, JSONSupport { + /** + * 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. + * + * Possible Value | Description + * ----------------|----------- + * heading | The rotation of the symbol in the horizontal plane (i.e., around the z axis). + * tilt | The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). + * roll | The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#axis) + * + * @default heading + */ + axis: string; + /** + * Defines the origin and direction of rotation depending on how the angle of rotation was measured. See the table below for a list of possible values. This property only applies to rotations around the `heading` axis. + * + * Value | Description + * ------|------------ + * geographic | Rotates the symbol from the north in a clockwise direction. + * arithmetic | Rotates the symbol from the east in a counter-clockwise direction. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#rotationType) + * + * @default geographic + */ + rotationType: string; + /** + * The visual variable type. For RotationVariable, this value is always `rotation`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#type) + */ + readonly type: "rotation"; + + /** + * Creates a deep clone of the RotationVariable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#clone) + * + * + */ + clone(): RotationVariable; + } + + interface RotationVariableConstructor { + /** + * 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 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html) + */ + + new (properties?: RotationVariableProperties): RotationVariable; + + fromJSON(json: any): RotationVariable; + } + + export const RotationVariable: RotationVariableConstructor; + + interface RotationVariableProperties extends VisualVariableProperties { + /** + * 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. + * + * Possible Value | Description + * ----------------|----------- + * heading | The rotation of the symbol in the horizontal plane (i.e., around the z axis). + * tilt | The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). + * roll | The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#axis) + * + * @default heading + */ + axis?: string; + /** + * Defines the origin and direction of rotation depending on how the angle of rotation was measured. See the table below for a list of possible values. This property only applies to rotations around the `heading` axis. + * + * Value | Description + * ------|------------ + * geographic | Rotates the symbol from the north in a clockwise direction. + * arithmetic | Rotates the symbol from the east in a counter-clockwise direction. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#rotationType) + * + * @default geographic + */ + rotationType?: string; + } + + interface SizeVariable extends VisualVariable, JSONSupport { + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. + * + * Possible Value | Description + * ----------------|----------- + * width | The diameter of the symbol from east to west. + * depth | The diameter of the symbol from north to south. + * height | The height of the symbol. + * width-and-depth | Applies the size visual variable to both width and depth axes. + * all | Applies the size visual variable to all axes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#axis) + * + * @default all + */ + axis: string; + /** + * Deprecated. Use [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#expression) + */ + expression: string; + /** + * The maximum data value used in the size ramp. Features whose [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) return a value equal to or higher than the value defined in `maxDataValue` will be rendered at the size defined in [maxSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxSize). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) + */ + maxDataValue: number; + /** + * The size used to render a feature containing the maximum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * * When an object is used, the size of features whose data value (defined in [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression)) is greater than or equal to the [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxSize) + */ + maxSize: number | ScaleDependentStops; + /** + * The minimum data value used in the size ramp. Features whose [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) return a value equal to or lower than the value defined in `maxDataValue` will be rendered at the size defined in [minSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minSize). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) + */ + minDataValue: number; + /** + * The size used to render a feature containing the minimum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * * When an object is used, the size of features whose data value (defined in [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression)) is greater than or equal to the [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minSize) + */ + minSize: number | ScaleDependentStops; + /** + * The name of the numeric attribute field used to normalize the data in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). If this field is used, then the values in [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) and [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) or [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField) + */ + normalizationField: string; + /** + * An array of objects that defines the mapping of data values returned from [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) to icon sizes. You must specify 2 - 6 stops. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops) + */ + stops: SizeStop[]; + /** + * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#target) + */ + target: string; + /** + * The visual variable type. For SizeVariable, this value is always `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#type) + */ + readonly type: "size"; + /** + * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding [axis](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#axis) of this visual variable instead of proportionally scaling this axis' value. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#useSymbolValue) + */ + useSymbolValue: boolean; + /** + * Specifies how to apply the data value when mapping real-world sizes. See table below for supported values. + * + * Value | Description + * ------|----------- + * radius | The point data value represents the radius of a circular feature. + * diameter | The point data value represents the diameter of a circular feature. + * area | The point data value represents the area of a feature. + * width | The polyline data value represents the width of a line. + * distance | The polyline data value represents the distance from the center line (one half of the width). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueRepresentation) + */ + valueRepresentation: string; + /** + * Indicates the unit of measurement used to interpret the value returned by [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). For 3D volumetric symbols the default is `meters`. This property should not be used if the data value represents a thematic quantity (e.g. traffic count, census data, etc.). **Possible Values:** unknown | inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueUnit) + */ + valueUnit: string; + + /** + * Creates a deep clone of the SizeVisualVariable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#clone) + * + * + */ + clone(): SizeVariable; + } + + interface SizeVariableConstructor { + /** + * The size visual variable defines the size of individual features in a layer based on a numeric (often thematic) value. This value comes from one of the following: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) + */ + + new (properties?: SizeVariableProperties): SizeVariable; + + fromJSON(json: any): SizeVariable; + } + + export const SizeVariable: SizeVariableConstructor; + + interface SizeVariableProperties extends VisualVariableProperties { + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. + * + * Possible Value | Description + * ----------------|----------- + * width | The diameter of the symbol from east to west. + * depth | The diameter of the symbol from north to south. + * height | The height of the symbol. + * width-and-depth | Applies the size visual variable to both width and depth axes. + * all | Applies the size visual variable to all axes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#axis) + * + * @default all + */ + axis?: string; + /** + * Deprecated. Use [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#expression) + */ + expression?: string; + /** + * The maximum data value used in the size ramp. Features whose [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) return a value equal to or higher than the value defined in `maxDataValue` will be rendered at the size defined in [maxSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxSize). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) + */ + maxDataValue?: number; + /** + * The size used to render a feature containing the maximum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * * When an object is used, the size of features whose data value (defined in [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression)) is greater than or equal to the [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxSize) + */ + maxSize?: number | ScaleDependentStops | string; + /** + * The minimum data value used in the size ramp. Features whose [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) return a value equal to or lower than the value defined in `maxDataValue` will be rendered at the size defined in [minSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minSize). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) + */ + minDataValue?: number; + /** + * The size used to render a feature containing the minimum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * * When an object is used, the size of features whose data value (defined in [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression)) is greater than or equal to the [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minSize) + */ + minSize?: number | ScaleDependentStops | string; + /** + * The name of the numeric attribute field used to normalize the data in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). If this field is used, then the values in [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) and [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) or [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField) + */ + normalizationField?: string; + /** + * An array of objects that defines the mapping of data values returned from [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) to icon sizes. You must specify 2 - 6 stops. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops) + */ + stops?: SizeStopProperties[]; + /** + * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#target) + */ + target?: string; + /** + * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding [axis](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#axis) of this visual variable instead of proportionally scaling this axis' value. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#useSymbolValue) + */ + useSymbolValue?: boolean; + /** + * Specifies how to apply the data value when mapping real-world sizes. See table below for supported values. + * + * Value | Description + * ------|----------- + * radius | The point data value represents the radius of a circular feature. + * diameter | The point data value represents the diameter of a circular feature. + * area | The point data value represents the area of a feature. + * width | The polyline data value represents the width of a line. + * distance | The polyline data value represents the distance from the center line (one half of the width). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueRepresentation) + */ + valueRepresentation?: string; + /** + * Indicates the unit of measurement used to interpret the value returned by [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). For 3D volumetric symbols the default is `meters`. This property should not be used if the data value represents a thematic quantity (e.g. traffic count, census data, etc.). **Possible Values:** unknown | inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueUnit) + */ + valueUnit?: string; + } + + /** + * Defines a size visual variable with minimum and maximum bounds. When an object with this specification is applied to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of a renderer, then feature sizes are bounded by min and max data values. Features with values greater than the provided max value are assigned the specified maximum size. Likewise, features with values less than the provided min value are assigned the specified minimum size. Features with values between the min and the max are assigned a corresponding size that is linearly interpolated between the min and max size values. The properties for this size visual variable type are defined below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + export interface BoundedMinMax extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + type: string; + /** + * See [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + field?: string; + /** + * See [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + normalizationField?: string; + /** + * See [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + valueExpression?: string; + /** + * See [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpressionTitle). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + valueExpressionTitle?: string; + /** + * See [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + maxDataValue: number; + /** + * The size used to render a feature containing the maximum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + maxSize: string | number; + /** + * See [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + minDataValue: number; + /** + * The size used to render a feature containing the minimum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + minSize: string | number; + } + + /** + * Defines a size visual variable 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/3-trees-3d.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + export interface RealWorldSize extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + type: string; + /** + * See [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + field?: string; + /** + * See [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + normalizationField?: string; + /** + * See [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + valueExpression?: string; + /** + * See [valueUnit](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueUnit). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + valueUnit: string; + /** + * See [valueRepresentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueRepresentation). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + valueRepresentation?: string; + } + + /** + * Defines icon sizes in a size visual variable based on minimum and maximum bounds similar to the [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) case. However, this specification allows the developer to specify various min and max sizes based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). Features with values greater than the provided max value are assigned the specified maximum size for the given view scale. Likewise, features with values less than the provided min value are assigned the specified minimum size for the given view scale. Features with values between the min and the max are assigned a corresponding size linearly interpolated between the provided min and max size values for the given scale value. The object specification for this object is provided below. + * > **Known Limitations** Scale-dependent size visual variables are currently not supported 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-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + export interface ScaleDependentIcons extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + type: string; + /** + * See [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + field?: string; + /** + * See [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + normalizationField?: string; + /** + * This value must be `$view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + valueExpression?: string; + /** + * **Deprecated since version 4.2. Use `valueExpression` instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + expression?: string; + /** + * See [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + maxDataValue: number; + /** + * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is greater than or equal to the `maxDataValue` for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + maxSize: ScaleDependentStops; + /** + * See [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + minDataValue: number; + /** + * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is less than or equal to the `minDataValue` for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + minSize: ScaleDependentStops; + } + + /** + * Defines feature sizes and outline widths in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#SizeVisualVariable) based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). It also provides the specification of the `minSize` and `maxSize` properties in a [ScaleDependentIcons](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) size visual variable. The object specification for this object is provided below. + * > **Known Limitations** Scale-dependent size visual variables are currently not supported 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-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + export interface ScaleDependentStops extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + type: string; + /** + * This value must be `$view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + valueExpression: string; + /** + * **Deprecated since version 4.2. Use `valueExpression` instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + expression?: string; + /** + * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + target?: string; + /** + * An array of objects that define the size of the icon (or alternatively the width of the polygon outline) at the given scale `value`. You must specify 2 - 6 stops. The stops must be listed in ascending order based on the value of the `value` property in each stop. When the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) equals the `value` in a stop, then icons (or outlines) will be rendered with the corresponding size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + stops: SizeStop[]; + } + + /** + * Defines two or more stops at which feature sizes are mapped to data values in a size visual variable. Setting two stops will have the same effect as creating a [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) size visual variable. Adding additional stops allows you to map specific sizes to data values. Sizes are interpolated linearly between stop values. The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + export interface ThematicStops extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + type: string; + /** + * See [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + field?: string; + /** + * See [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + normalizationField?: string; + /** + * See [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + valueExpression?: string; + /** + * An array of objects defining the thematic size ramp in a sequence of data or expression 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + stops: SizeStop[]; + } + + interface ColorStop extends Accessor, JSONSupport { + /** + * The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#value). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#color) + */ + color: Color; + /** + * A string value used to label the stop along 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-visualVariables-support-ColorStop.html#label) + */ + label: string; + /** + * Specifies the data value to map to the given [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#color). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#value) + */ + value: number; + + /** + * Creates a deep clone of the ColorStop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#clone) + * + * + */ + clone(): ColorStop; + } + + interface ColorStopConstructor { + new (properties?: ColorStopProperties): ColorStop; + + fromJSON(json: any): ColorStop; + } + + export const ColorStop: ColorStopConstructor; + + interface ColorStopProperties { + /** + * The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#value). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#color) + */ + color?: Color | number[] | string; + /** + * A string value used to label the stop along 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-visualVariables-support-ColorStop.html#label) + */ + label?: string; + /** + * Specifies the data value to map to the given [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#color). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#value) + */ + value?: number; + } + + interface OpacityStop extends Accessor, JSONSupport { + /** + * The opacity value (between `0` and `1`) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#value). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#color) + */ + color: Color; + /** + * A string value used to label the stop 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-visualVariables-support-OpacityStop.html#label) + */ + label: string; + /** + * Specifies the data value to map to the given [opacity value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#opacity). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#value) + */ + value: number; + + /** + * Creates a deep clone of the OpacityStop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#clone) + * + * + */ + clone(): OpacityStop; + } + + interface OpacityStopConstructor { + new (properties?: OpacityStopProperties): OpacityStop; + + fromJSON(json: any): OpacityStop; + } + + export const OpacityStop: OpacityStopConstructor; + + interface OpacityStopProperties { + /** + * The opacity value (between `0` and `1`) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#value). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#color) + */ + color?: Color | number[] | string; + /** + * A string value used to label the stop 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-visualVariables-support-OpacityStop.html#label) + */ + label?: string; + /** + * Specifies the data value to map to the given [opacity value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#opacity). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#value) + */ + value?: number; + } + + interface SizeStop extends Accessor, JSONSupport { + /** + * A string value used to label the stop 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-visualVariables-support-SizeStop.html#label) + */ + label: string; + /** + * The size value in points (between `0` and `90`) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#value). This value may also be autocast from a string in points or pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#size) + */ + size: number; + /** + * Specifies the data value to map to the given [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#size). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#value) + */ + value: number; + + /** + * Creates a deep clone of the SizeStop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#clone) + * + * + */ + clone(): SizeStop; + } + + interface SizeStopConstructor { + new (properties?: SizeStopProperties): SizeStop; + + fromJSON(json: any): SizeStop; + } + + export const SizeStop: SizeStopConstructor; + + interface SizeStopProperties { + /** + * A string value used to label the stop 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-visualVariables-support-SizeStop.html#label) + */ + label?: string; + /** + * The size value in points (between `0` and `90`) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#value). This value may also be autocast from a string in points or pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#size) + */ + size?: number | string; + /** + * Specifies the data value to map to the given [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#size). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#value) + */ + value?: number; + } + + interface VisualVariable extends Accessor, JSONSupport { + /** + * The name of the numeric attribute field that contains the data values used to determine the color/opacity/size/rotation of each feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field) + */ + field: string; + /** + * The index of the visual variable in relation to its position in the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#index) + */ + index: string | number; + /** + * An object providing options for displaying the visual variable 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-visualVariables-VisualVariable.html#legendOptions) + */ + legendOptions: VisualVariableLegendOptions; + /** + * The visual variable type. **Possible values:** color | opacity | rotation | size + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#type) + */ + readonly type: 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field). Therefore, this property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field) in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpression) + */ + 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpression) property. This is displayed as the title of the corresponding visual variable 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpressionTitle) + */ + valueExpressionTitle: string; + } + + interface VisualVariableConstructor { + /** + * The visual variable base class. See each of the subclasses that extend this class to learn how to create continuous data-driven thematic visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html) + */ + + new (properties?: VisualVariableProperties): VisualVariable; + + fromJSON(json: any): VisualVariable; + } + + export const VisualVariable: VisualVariableConstructor; + + interface VisualVariableProperties { + /** + * The name of the numeric attribute field that contains the data values used to determine the color/opacity/size/rotation of each feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field) + */ + field?: string; + /** + * The index of the visual variable in relation to its position in the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#index) + */ + index?: string | number; + /** + * An object providing options for displaying the visual variable 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-visualVariables-VisualVariable.html#legendOptions) + */ + legendOptions?: VisualVariableLegendOptions; + /** + * 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field). Therefore, this property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field) in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpression) + */ + 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpression) property. This is displayed as the title of the corresponding visual variable 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpressionTitle) + */ + valueExpressionTitle?: string; + } + + export interface VisualVariableLegendOptions extends Object { + /** + * Indicates whether to show the visual variable in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) + */ + showLegend?: boolean; + /** + * The title describing the visualization of the visual variable in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpressionTitle). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) + */ + title?: string; + } + + /** + * ClassBreaksRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#ClassBreaksRenderer) + */ + export type renderersClassBreaksRenderer = ClassBreaksRenderer; + + /** + * HeatmapRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#HeatmapRenderer) + */ + export type renderersHeatmapRenderer = HeatmapRenderer; + + /** + * Renderer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#Renderer) + */ + export type renderersRenderer = ClassBreaksRenderer | SimpleRenderer | UniqueValueRenderer | HeatmapRenderer; + + /** + * SimpleRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#SimpleRenderer) + */ + export type renderersSimpleRenderer = SimpleRenderer; + + /** + * UniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#UniqueValueRenderer) + */ + export type renderersUniqueValueRenderer = UniqueValueRenderer; interface request { /** * Retrieves data from a remote server or uploads a file from a user's computer. If the request returns an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html), the error object will include the details specified in [EsriErrorDetails](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * + * * @param url The request URL. * @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; } @@ -26213,58 +27005,57 @@ declare namespace __esri { const __requestMapped: request; export const request: typeof __requestMapped.esriRequest; - /** * The specification of the [details object](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#details) returned in an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ export interface EsriErrorDetails extends Object { /** * A function to retrieve headers sent from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ getHeader: GetHeader; /** * The status of the http request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ httpStatus: number; /** * The error message code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ messageCode: string; /** * Additional error message(s). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ messages: string[]; /** * The query parameters sent with the http request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ requestOptions: any; /** * Indicates if the request required https. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ ssl: boolean; /** * The error message subcode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ subCode: number; /** * The URL of the request that returned an error message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ url: string; @@ -26274,19 +27065,19 @@ declare namespace __esri { /** * An object with the following properties that describe the request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ export interface RequestOptions extends Object { /** * 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) */ query?: any; /** - * Response format. When this value is `image` the `headers` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image - * + * Response format. When this value is `image` the `timeout` option is 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; @@ -26295,7 +27086,7 @@ declare namespace __esri { * ```js * const controller = new AbortController(); * const signal = controller.signal; - * + * * esriRequest(url, { signal }) * .then((response) => { * // The request went OK @@ -26307,61 +27098,61 @@ declare namespace __esri { * 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"`. - * + * Headers to use for the request. This is an object whose property names are header names. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ headers?: any; /** * Indicates the amount of time in milliseconds to wait for a response from the server. Set to `0` to wait for the response indefinitely. This option is ignored when `responseType = "image"`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ timeout?: number; /** * 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) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ body?: FormData | HTMLFormElement | string; /** * Indicates the request should use the proxy. By default this is determined automatically based on the domain of the request url. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ useProxy?: boolean; /** * Indicates whether to send an extra query parameter to ensure the server doesn't supply cached values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ cacheBust?: 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). - * + * 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). + * * | Known Value | Description | * |-------------|-------------| * | auto | The user will be signed in when a secure resource is requested. | * | anonymous | An error will be returned when a secure resource is requested. | * | immediate | The user will be signed in before the resource is requested. | * | no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ authMode?: string; @@ -26369,37 +27160,37 @@ declare namespace __esri { /** * Returns a promise that resolves to an object with the following specification. If the request returns an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html), the error object will include the details specified in [EsriErrorDetails](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ export interface RequestResponse extends Object { /** * The requested data. Should match the `responseType` with the data return type. Possible types are: [json](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object), [xml](https://developer.mozilla.org/en-US/docs/Web/API/XMLDocument), [text](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob), [array-buffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [document](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument), and [image](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ data?: any; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ requestOptions?: RequestOptions; /** * Indicates if the request required https. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ ssl?: boolean; /** * The URL used to request the data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ url?: string; /** * Method for getting a header sent from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ getHeader?: GetHeader; @@ -26408,60 +27199,58 @@ declare namespace __esri { interface ActionBase { /** * Indicates whether the action is currently active. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#active) - * + * * @default false */ active: boolean; /** * Adds a CSS class to the action's node. Can be used in conjunction with the `image` property or by itself. Any icon font may be used in this property. The [Esri Icon Font](https://developers.arcgis.com/javascript/latest/guide/esri-icon-font/index.html) is automatically made available via the ArcGIS API for JavaScript for you to use in styling custom actions. To use one of these provided icon fonts, you must prefix the class name with `esri-`. For example, the default `zoom-to` action in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) uses the font `esri-icon-zoom-in-magnifying-glass`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#className) */ className: string; /** * Indicates whether this action is disabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#disabled) - * + * * @default false */ disabled: boolean; /** * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#event:trigger-action) event. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#id) */ id: string; /** * The title of the action. _For popups_: When there are fewer than three actions defined in a popup, this text is displayed to the right of the icon or image representing the action. If there are three or more actions in the popup, then this text is used as a tooltip on the action. _For LayerList_: The first action is displayed in the layerlist with an icon. The layerlist has a menu that will display all actions with their titles - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#title) */ title: string; /** * Specifies the type of action. Choose between ["button"](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or ["toggle"](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html). Currently, these two are the only supported types. A "slider" type will follow-up in a future release. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#type) - * + * * @default null */ type: string; /** * Indicates if the action is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#visible) - * + * * @default true */ visible: boolean; } interface ActionBaseConstructor { - - - new(): ActionBase; + new (): ActionBase; } export const ActionBase: ActionBaseConstructor; @@ -26469,26 +27258,23 @@ 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/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) */ image: string; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html#clone) - * - * + * + * */ clone(): ActionButton; } interface ActionButtonConstructor { - - - - new(properties?: any): ActionButton; + new (properties?: any): ActionButton; } export const ActionButton: ActionButtonConstructor; @@ -26496,27 +27282,1001 @@ declare namespace __esri { interface ActionToggle extends ActionBase { /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html#clone) - * - * + * + * */ clone(): ActionToggle; } interface ActionToggleConstructor { - - - - new(properties?: any): ActionToggle; + new (properties?: any): ActionToggle; } export const ActionToggle: ActionToggleConstructor; + /** + * A convenience module for importing [ContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-ContentElement.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing content elements one at a time like this: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html) + */ + namespace ContentElement { + /** + * Popup content element types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#ContentElement) + */ + export type ContentElement = __esri.Text | __esri.Media | __esri.Fields | __esri.Attachments; + + /** + * TextContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Text) + */ + export type Text = __esri.Text; + export const Text: typeof __esri.Text; + + /** + * MediaContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Media) + */ + export type Media = __esri.Media; + export const Media: typeof __esri.Media; + + /** + * FieldsContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Fields) + */ + export type Fields = __esri.Fields; + export const Fields: typeof __esri.Fields; + + /** + * AttachmentsContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Attachments) + */ + export type Attachments = __esri.Attachments; + export const Attachments: typeof __esri.Attachments; + } + + interface Attachments extends ContentElementContentElement, JSONSupport { + /** + * An array of [AttachmentInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html) objects used to display within the popup's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#attachmentInfos) + */ + attachmentInfos: AttachmentInfo; + /** + * A string value indicating how to display the attachment. Possible values are: preview | list If `list` is specified, attachments show as links. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#displayType) + */ + displayType: string; + + /** + * Creates a deep clone of the AttachmentsContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#clone) + * + * + */ + clone(): Attachments; + } + + interface AttachmentsConstructor { + /** + * An AttachmentsContentElement represents an attachment element associated with a feature. This resource is available only if the [FeatureLayer's capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html) + */ + + new (properties?: AttachmentsProperties): Attachments; + + fromJSON(json: any): Attachments; + } + + export const Attachments: AttachmentsConstructor; + + interface AttachmentsProperties extends ContentElementContentElementProperties { + /** + * An array of [AttachmentInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html) objects used to display within the popup's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#attachmentInfos) + */ + attachmentInfos?: AttachmentInfoProperties; + /** + * A string value indicating how to display the attachment. Possible values are: preview | list If `list` is specified, attachments show as links. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#displayType) + */ + displayType?: string; + } + + interface ContentElementContentElement extends Accessor, JSONSupport { + /** + * The type of popup element displayed. **Possible values**: text | fields | media | attachments + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-ContentElement.html#type) + */ + readonly type: string; + } + + interface ContentElementContentElementConstructor { + /** + * Content elements define what should display within the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) content. There are four specific element types: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-ContentElement.html) + */ + + new (properties?: ContentElementContentElementProperties): ContentElementContentElement; + + fromJSON(json: any): ContentElementContentElement; + } + + export const ContentElementContentElement: ContentElementContentElementConstructor; + + interface ContentElementContentElementProperties {} + + interface Fields extends ContentElementContentElement, JSONSupport { + /** + * Object array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html). If the `fieldInfos` property is not provided directly within the content, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html#fieldInfos) + */ + fieldInfos: FieldInfo[]; + + /** + * Creates a deep clone of the FieldsContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html#clone) + * + * + */ + clone(): Fields; + } + + interface FieldsConstructor { + /** + * A FieldsContentElement represents [fieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) associated with a feature. If this is not set within the content, it will revert to whatever may be set within the [PopupTemplate.Fieldinfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html) + */ + + new (properties?: FieldsProperties): Fields; + + fromJSON(json: any): Fields; + } + + export const Fields: FieldsConstructor; + + interface FieldsProperties extends ContentElementContentElementProperties { + /** + * Object array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html). If the `fieldInfos` property is not provided directly within the content, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html#fieldInfos) + */ + fieldInfos?: FieldInfoProperties[]; + } + + interface Media extends ContentElementContentElement, JSONSupport { + /** + * Contains the media elements representing images or charts to display within the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). This can be an individual chart or image element, or an array containing a combination of any of these types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html#mediaInfos) + */ + mediaInfos: BarChart | ColumnChart | Image | LineChart | PieChart | any[]; + + /** + * Creates a deep clone of the MediaContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html#clone) + * + * + */ + clone(): Media; + } + + interface MediaConstructor { + /** + * A `MediaContentElement` represents an individual or array of [Media](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html) elements to display within a popup's content. Examples of these types of media are [charts](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html) and/or [images](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html) + */ + + new (properties?: MediaProperties): Media; + + fromJSON(json: any): Media; + } + + export const Media: MediaConstructor; + + interface MediaProperties extends ContentElementContentElementProperties { + /** + * Contains the media elements representing images or charts to display within the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). This can be an individual chart or image element, or an array containing a combination of any of these types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html#mediaInfos) + */ + mediaInfos?: + | BarChartProperties + | ColumnChartProperties + | ImageProperties + | LineChartProperties + | PieChartProperties + | any[]; + } + + interface BarChart extends Chart, JSONSupport { + /** + * Creates a deep clone of the MediaBarChartContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-BarChart.html#clone) + * + * + */ + clone(): BarChart; + } + + interface BarChartConstructor { + new (properties?: BarChartProperties): BarChart; + + fromJSON(json: any): BarChart; + } + + export const BarChart: BarChartConstructor; + + interface BarChartProperties extends ChartProperties {} + + interface Chart extends MediaMedia, JSONSupport { + /** + * Defines the chart value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html#value) + */ + value: Value; + } + + interface ChartConstructor { + new (properties?: ChartProperties): Chart; + + fromJSON(json: any): Chart; + } + + export const Chart: ChartConstructor; + + interface ChartProperties extends MediaMediaProperties { + /** + * Defines the chart value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html#value) + */ + value?: ValueProperties; + } + + interface Series extends Accessor { + /** + * String value indicating the tooltip for a series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#tooltipField) + */ + tooltipField: string; + /** + * Numerical value indicating the x-value for the chart series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#x) + */ + x: number; + /** + * Numerical value indicating the y-value for the chart series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#y) + */ + y: number; + + /** + * Creates a deep clone of the MediaInfoChartSeries class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#clone) + * + * + */ + clone(): Series; + } + + interface SeriesConstructor { + new (properties?: SeriesProperties): Series; + } + + export const Series: SeriesConstructor; + + interface SeriesProperties { + /** + * String value indicating the tooltip for a series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#tooltipField) + */ + tooltipField?: string; + /** + * Numerical value indicating the x-value for the chart series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#x) + */ + x?: number; + /** + * Numerical value indicating the y-value for the chart series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#y) + */ + y?: number; + } + + interface Value extends Accessor, JSONSupport { + /** + * An array of strings, with each string containing the name of a field to display in the chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#fields) + */ + fields: string[]; + /** + * A string containing the name of a field. The values of all fields in the chart will be normalized (divided) by the value of this field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#normalizeField) + */ + normalizeField: string; + /** + * An array of [Series](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html) objects which provide information of x/y data data that is plotted in a chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#series) + */ + series: Series[]; + /** + * Used for chart values. Defines a new Dojo theme, only valid for chart types. View the [Dojox Charting Theme Preview](https://download.dojotoolkit.org/release-1.10.0/dojo-release-1.10.0/dojox/charting/tests/theme_preview.html) to see some of the theme options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#theme) + */ + theme: string; + /** + * String value indicating the tooltip for a chart specified from another field. This field is needed when related records are not used. It is used for showing tooltips from another field in the same layer or related layer/table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#tooltipField) + */ + tooltipField: string; + + /** + * Creates a deep clone of the MediaInfoChartValue class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#clone) + * + * + */ + clone(): Value; + } + + interface ValueConstructor { + new (properties?: ValueProperties): Value; + + fromJSON(json: any): Value; + } + + export const Value: ValueConstructor; + + interface ValueProperties { + /** + * An array of strings, with each string containing the name of a field to display in the chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#fields) + */ + fields?: string[]; + /** + * A string containing the name of a field. The values of all fields in the chart will be normalized (divided) by the value of this field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#normalizeField) + */ + normalizeField?: string; + /** + * An array of [Series](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html) objects which provide information of x/y data data that is plotted in a chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#series) + */ + series?: SeriesProperties[]; + /** + * Used for chart values. Defines a new Dojo theme, only valid for chart types. View the [Dojox Charting Theme Preview](https://download.dojotoolkit.org/release-1.10.0/dojo-release-1.10.0/dojox/charting/tests/theme_preview.html) to see some of the theme options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#theme) + */ + theme?: string; + /** + * String value indicating the tooltip for a chart specified from another field. This field is needed when related records are not used. It is used for showing tooltips from another field in the same layer or related layer/table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#tooltipField) + */ + tooltipField?: string; + } + + interface ColumnChart extends Chart, JSONSupport { + /** + * Creates a deep clone of the MediaColumnChartContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-ColumnChart.html#clone) + * + * + */ + clone(): ColumnChart; + } + + interface ColumnChartConstructor { + new (properties?: ColumnChartProperties): ColumnChart; + + fromJSON(json: any): ColumnChart; + } + + export const ColumnChart: ColumnChartConstructor; + + interface ColumnChartProperties extends ChartProperties {} + + interface Image extends MediaMedia, JSONSupport { + /** + * Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of `0` indicates auto refresh is not enabled. If the property does not exist, it is equivalent to having a value of `0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#refreshInterval) + */ + refreshInterval: number; + /** + * Defines the value format of the image media element and how the images should be retrieved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#value) + */ + value: ImageValue; + + /** + * Creates a deep clone of the MediaImageContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#clone) + * + * + */ + clone(): Image; + } + + interface ImageConstructor { + new (properties?: ImageProperties): Image; + + fromJSON(json: any): Image; + } + + export const Image: ImageConstructor; + + interface ImageProperties extends MediaMediaProperties { + /** + * Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of `0` indicates auto refresh is not enabled. If the property does not exist, it is equivalent to having a value of `0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#refreshInterval) + */ + refreshInterval?: number; + /** + * Defines the value format of the image media element and how the images should be retrieved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#value) + */ + value?: ImageValueProperties; + } + + interface ImageValue extends Accessor, JSONSupport { + /** + * A string containing a URL to be launched in a browser when a user clicks the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#linkURL) + */ + linkURL: string; + /** + * A string containing the URL to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#sourceURL) + */ + sourceURL: string; + + /** + * Creates a deep clone of the MediaInfoImageValue class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#clone) + * + * + */ + clone(): ImageValue; + } + + interface ImageValueConstructor { + new (properties?: ImageValueProperties): ImageValue; + + fromJSON(json: any): ImageValue; + } + + export const ImageValue: ImageValueConstructor; + + interface ImageValueProperties { + /** + * A string containing a URL to be launched in a browser when a user clicks the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#linkURL) + */ + linkURL?: string; + /** + * A string containing the URL to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#sourceURL) + */ + sourceURL?: string; + } + + interface LineChart extends Chart, JSONSupport { + /** + * Creates a deep clone of the MediaLineChartContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-LineChart.html#clone) + * + * + */ + clone(): LineChart; + } + + interface LineChartConstructor { + new (properties?: LineChartProperties): LineChart; + + fromJSON(json: any): LineChart; + } + + export const LineChart: LineChartConstructor; + + interface LineChartProperties extends ChartProperties {} + + interface MediaMedia extends Accessor, JSONSupport { + /** + * Defines a caption for the media. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#caption) + */ + caption: string; + /** + * The title of the media element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#title) + */ + title: string; + /** + * The type of media element displayed. **Possible values**: image | bar-chart | column-chart | line-chart | pie-chart + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#type) + */ + readonly type: string; + } + + interface MediaMediaConstructor { + new (properties?: MediaMediaProperties): MediaMedia; + + fromJSON(json: any): MediaMedia; + } + + export const MediaMedia: MediaMediaConstructor; + + interface MediaMediaProperties { + /** + * Defines a caption for the media. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#caption) + */ + caption?: string; + /** + * The title of the media element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#title) + */ + title?: string; + } + + interface PieChart extends Chart, JSONSupport { + /** + * Creates a deep clone of the MediaPieChartContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-PieChart.html#clone) + * + * + */ + clone(): PieChart; + } + + interface PieChartConstructor { + new (properties?: PieChartProperties): PieChart; + + fromJSON(json: any): PieChart; + } + + export const PieChart: PieChartConstructor; + + interface PieChartProperties extends ChartProperties {} + + interface Text extends ContentElementContentElement, JSONSupport { + /** + * The formatted string content to display. This may contain a field name enclosed in `{}`, such as `{FIELDNAME}`, or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression name, referenced as `{expression/EXPRESSIONNAME}`. Text content may also leverage HTML tags such as ``, `

`, and `
` for formatting the look and feel of the content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html#text) + */ + text: string; + + /** + * Creates a deep clone of the TextContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html#clone) + * + * + */ + clone(): Text; + } + + interface TextConstructor { + /** + * A `TextContentElement` is used to define descriptive text as an element within the [PopupTemplate's](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html) + */ + + new (properties?: TextProperties): Text; + + fromJSON(json: any): Text; + } + + export const Text: TextConstructor; + + interface TextProperties extends ContentElementContentElementProperties { + /** + * The formatted string content to display. This may contain a field name enclosed in `{}`, such as `{FIELDNAME}`, or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression name, referenced as `{expression/EXPRESSIONNAME}`. Text content may also leverage HTML tags such as ``, `

`, and `
` for formatting the look and feel of the content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html#text) + */ + text?: string; + } + + /** + * AttachmentsContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Attachments) + */ + export type ContentElementAttachments = Attachments; + + /** + * Popup content element types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#ContentElement) + */ + export type supportContentElementContentElement = Text | Media | Fields | Attachments; + + /** + * FieldsContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Fields) + */ + export type ContentElementFields = Fields; + + /** + * MediaContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Media) + */ + export type ContentElementMedia = Media; + + /** + * TextContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Text) + */ + export type ContentElementText = Text; + + interface ExpressionInfo extends Accessor, JSONSupport { + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string, number, dictionary, or array. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#expression) + */ + expression: string; + /** + * The name of the expression. This is used to reference the value of the given `expression` in the popupTemplate's [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) property by wrapping it in curly braces and prefacing it with `expression/` (e.g. `{expression/expressionName}`). See the code snippets below for more examples. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#name) + */ + name: string; + /** + * Indicates the return type of the Arcade expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#returnType) + */ + returnType: string | number; + /** + * The title used to describe the value returned by the expression in the popup. This will display if the value is referenced in a [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#title) + */ + title: string; + + /** + * Creates a deep clone of the ExpressionInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#clone) + * + * + */ + clone(): ExpressionInfo; + } + + interface ExpressionInfoConstructor { + new (properties?: ExpressionInfoProperties): ExpressionInfo; + + fromJSON(json: any): ExpressionInfo; + } + + export const ExpressionInfo: ExpressionInfoConstructor; + + interface ExpressionInfoProperties { + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string, number, dictionary, or array. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#expression) + */ + expression?: string; + /** + * The name of the expression. This is used to reference the value of the given `expression` in the popupTemplate's [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) property by wrapping it in curly braces and prefacing it with `expression/` (e.g. `{expression/expressionName}`). See the code snippets below for more examples. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#name) + */ + name?: string; + /** + * Indicates the return type of the Arcade expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#returnType) + */ + returnType?: string | number; + /** + * The title used to describe the value returned by the expression in the popup. This will display if the value is referenced in a [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#title) + */ + title?: string; + } + + interface FieldInfo extends Accessor, JSONSupport { + /** + * The field name as defined by the service or the `name` of an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. Arcade expression names are defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#expressionInfos) property. When referencing Arcade expressions, you must preface the name with `expression/`, such as `expression/percent-total`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#fieldName) + */ + fieldName: string; + /** + * Class which provides formatting options for numerical or date fields and how they should display within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#format) + */ + format: FieldInfoFormat; + /** + * A Boolean determining whether users can edit this field. This is not applicable to Arcade expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#isEditable) + * + * @default false + */ + isEditable: boolean; + /** + * A string containing the field alias. Not applicable to Arcade expressions as the title is used instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#label) + */ + label: string; + /** + * Used in a `one:many` or `many:many` relationship to compute the statistics on the field to show in the popup. If the property is present, must be one of the following values: **Possible Values:** count | sum | min | max | avg | stddev | var + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#statisticType) + */ + statisticType: string; + /** + * A string determining what type of input box editors see when editing the field. Applies only to string fields. This is not applicable to Arcade expressions. If this property is present, it must be one of the following values: **Possible Values:** rich-text | text-area | text-box + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#stringFieldOption) + * + * @default text-box + */ + stringFieldOption: string; + /** + * A string providing an editing hint for editors of the field. This is not applicable to Arcade expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#tooltip) + */ + tooltip: string; + /** + * Indicates whether the field is visible in the popup window. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#visible) + * + * @default true + */ + visible: boolean; + + /** + * Creates a deep clone of the FieldInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#clone) + * + * + */ + clone(): FieldInfo; + } + + interface FieldInfoConstructor { + new (properties?: FieldInfoProperties): FieldInfo; + + fromJSON(json: any): FieldInfo; + } + + export const FieldInfo: FieldInfoConstructor; + + interface FieldInfoProperties { + /** + * The field name as defined by the service or the `name` of an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. Arcade expression names are defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#expressionInfos) property. When referencing Arcade expressions, you must preface the name with `expression/`, such as `expression/percent-total`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#fieldName) + */ + fieldName?: string; + /** + * Class which provides formatting options for numerical or date fields and how they should display within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#format) + */ + format?: FieldInfoFormatProperties; + /** + * A Boolean determining whether users can edit this field. This is not applicable to Arcade expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#isEditable) + * + * @default false + */ + isEditable?: boolean; + /** + * A string containing the field alias. Not applicable to Arcade expressions as the title is used instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#label) + */ + label?: string; + /** + * Used in a `one:many` or `many:many` relationship to compute the statistics on the field to show in the popup. If the property is present, must be one of the following values: **Possible Values:** count | sum | min | max | avg | stddev | var + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#statisticType) + */ + statisticType?: string; + /** + * A string determining what type of input box editors see when editing the field. Applies only to string fields. This is not applicable to Arcade expressions. If this property is present, it must be one of the following values: **Possible Values:** rich-text | text-area | text-box + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#stringFieldOption) + * + * @default text-box + */ + stringFieldOption?: string; + /** + * A string providing an editing hint for editors of the field. This is not applicable to Arcade expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#tooltip) + */ + tooltip?: string; + /** + * Indicates whether the field is visible in the popup window. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#visible) + * + * @default true + */ + visible?: boolean; + } + + interface FieldInfoFormat extends Accessor, JSONSupport { + /** + * Used only with `Date` fields. Specifies how the date should appear in a popup. **Possible Values**: short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#dateFormat) + */ + dateFormat: string; + /** + * Used only with `Number` fields. A value of `true` indicates the number should have a digit (or thousands) separator when the value appears in popups. A value of `false` means that no separator will be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#digitSeparator) + * + * @default false + */ + digitSeparator: boolean; + /** + * Used only with `Number` fields to specify the number of supported decimal places that should appear in popups. Any places beyond this value are rounded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#places) + */ + places: number; + } + + interface FieldInfoFormatConstructor { + /** + * An object used with numerical or date fields to provide more detail about how the value should be displayed in a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html) + */ + + new (properties?: FieldInfoFormatProperties): FieldInfoFormat; + + fromJSON(json: any): FieldInfoFormat; + } + + export const FieldInfoFormat: FieldInfoFormatConstructor; + + interface FieldInfoFormatProperties { + /** + * Used only with `Date` fields. Specifies how the date should appear in a popup. **Possible Values**: short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#dateFormat) + */ + dateFormat?: string; + /** + * Used only with `Number` fields. A value of `true` indicates the number should have a digit (or thousands) separator when the value appears in popups. A value of `false` means that no separator will be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#digitSeparator) + * + * @default false + */ + digitSeparator?: boolean; + /** + * Used only with `Number` fields to specify the number of supported decimal places that should appear in popups. Any places beyond this value are rounded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#places) + */ + places?: number; + } + + interface LayerOptions extends Accessor, JSONSupport { + /** + * Applicable to [Imagery Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). Indicates whether records without data should display within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayerOptions.html#showNoDataRecords) + * + * @default true + */ + showNoDataRecords: boolean; + + /** + * Creates a deep clone of the LayerOptions class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayerOptions.html#clone) + * + * + */ + clone(): LayerOptions; + } + + interface LayerOptionsConstructor { + new (properties?: LayerOptionsProperties): LayerOptions; + + fromJSON(json: any): LayerOptions; + } + + export const LayerOptions: LayerOptionsConstructor; + + interface LayerOptionsProperties { + /** + * Applicable to [Imagery Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). Indicates whether records without data should display within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayerOptions.html#showNoDataRecords) + * + * @default true + */ + showNoDataRecords?: boolean; + } + interface LayersMixin { /** - * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). - * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. + * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). + * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. * > ```js * > var layer = new GraphicsLayer(); * > // The layer belongs to map1 @@ -26525,90 +28285,88 @@ declare namespace __esri { * > // and implicitly does: map1.layers.remove(layer) * > map2.layers.add(layer); * > ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) */ layers: Collection; /** * Adds a layer to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) - * + * * @param layer Layer or a Promise<Layer> to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). * @param index A layer can be added at a specified index in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). If no index is specified or the index specified is greater than the current number of layers, the layer is automatically appended to the list of layers in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) and the index is normalized. - * + * */ add(layer: Layer | IPromise, index?: number): void; /** * Adds a layer or an array of layers to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) - * + * * @param layers Layer(s) to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). * @param index A layer can be added at a specified index in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). If no index is specified or the index specified is greater than the current number of layers, the layer is automatically appended to the list of layers in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) and the index is normalized. - * + * */ addMany(layers: Layer[], index?: number): void; /** * Returns a layer based on the given layer id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#findLayerById) - * + * * @param layerId The ID assigned to the layer. - * + * */ findLayerById(layerId: string): Layer; /** * Removes the specified layer from the layers collection. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#remove) - * + * * @param layer Layer to remove from the layers collection. - * + * */ remove(layer: Layer): Layer; /** * Removes all layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#removeAll) - * - * + * + * */ removeAll(): Layer[]; /** * Removes the specified layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#removeMany) - * + * * @param layers Array of layers to remove from the layers collection. - * + * */ removeMany(layers: Layer[]): Layer[]; /** * Changes the layer order. The first layer added is always the base layer, even if its order is changed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#reorder) - * + * * @param layer The layer to be moved. * @param index The index location for placing the layer. The bottom-most layer has an index of `0`. - * + * */ reorder(layer: Layer, index: number): Layer; } interface LayersMixinConstructor { - - - new(): LayersMixin; + new (): LayersMixin; } export const LayersMixin: LayersMixinConstructor; interface LayersMixinProperties { /** - * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). - * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. + * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). + * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. * > ```js * > var layer = new GraphicsLayer(); * > // The layer belongs to map1 @@ -26617,29 +28375,359 @@ declare namespace __esri { * > // and implicitly does: map1.layers.remove(layer) * > map2.layers.add(layer); * > ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) */ layers?: CollectionProperties | LayerProperties[]; } - /** - * A convenience module for importing [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing symbols one at a time like this: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html) - */ - interface symbols { + interface RelatedRecordsInfo extends Accessor, JSONSupport { + /** + * An array of [FieldOrder](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html) objects indicating the field display order for the related records and whether they should be sorted in ascending `asc` or descending `desc` order. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#orderByFields) + */ + orderByFields: FieldOrder[]; + /** + * Indicates whether to display related records in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#showRelatedRecords) + */ + showRelatedRecords: boolean; + + /** + * Creates a deep clone of the RelatedRecordsInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#clone) + * + * + */ + clone(): RelatedRecordsInfo; } - export const symbols: symbols; + interface RelatedRecordsInfoConstructor { + new (properties?: RelatedRecordsInfoProperties): RelatedRecordsInfo; + + fromJSON(json: any): RelatedRecordsInfo; + } + + export const RelatedRecordsInfo: RelatedRecordsInfoConstructor; + + interface RelatedRecordsInfoProperties { + /** + * An array of [FieldOrder](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html) objects indicating the field display order for the related records and whether they should be sorted in ascending `asc` or descending `desc` order. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#orderByFields) + */ + orderByFields?: FieldOrderProperties[]; + /** + * Indicates whether to display related records in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#showRelatedRecords) + */ + showRelatedRecords?: boolean; + } + + interface FieldOrder extends Accessor, JSONSupport { + /** + * The attribute value of the field selected that will drive the sorting of related records. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#field) + */ + field: string; + /** + * Set the ascending or descending sort order of the returned related records. **Possible Values**: asc | desc + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#order) + */ + order: string; + + /** + * Creates a deep clone of the FieldOrder class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#clone) + * + * + */ + clone(): FieldOrder; + } + + interface FieldOrderConstructor { + new (properties?: FieldOrderProperties): FieldOrder; + + fromJSON(json: any): FieldOrder; + } + + export const FieldOrder: FieldOrderConstructor; + + interface FieldOrderProperties { + /** + * The attribute value of the field selected that will drive the sorting of related records. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#field) + */ + field?: string; + /** + * Set the ascending or descending sort order of the returned related records. **Possible Values**: asc | desc + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#order) + */ + order?: string; + } + + /** + * A convenience module for importing [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing symbols one at a time like this: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html) + */ + namespace symbols { + /** + * ExtrudeSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#ExtrudeSymbol3DLayer) + */ + export type ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; + export const ExtrudeSymbol3DLayer: typeof __esri.ExtrudeSymbol3DLayer; + + /** + * FillSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#FillSymbol3DLayer) + */ + export type FillSymbol3DLayer = __esri.FillSymbol3DLayer; + export const FillSymbol3DLayer: typeof __esri.FillSymbol3DLayer; + + /** + * Font. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Font) + */ + export type Font = __esri.Font; + export const Font: typeof __esri.Font; + + /** + * IconSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#IconSymbol3DLayer) + */ + export type IconSymbol3DLayer = __esri.IconSymbol3DLayer; + export const IconSymbol3DLayer: typeof __esri.IconSymbol3DLayer; + + /** + * LabelSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LabelSymbol3D) + */ + export type LabelSymbol3D = __esri.LabelSymbol3D; + export const LabelSymbol3D: typeof __esri.LabelSymbol3D; + + /** + * LineSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LineSymbol3D) + */ + export type LineSymbol3D = __esri.LineSymbol3D; + export const LineSymbol3D: typeof __esri.LineSymbol3D; + + /** + * LineSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LineSymbol3DLayer) + */ + export type LineSymbol3DLayer = __esri.LineSymbol3DLayer; + export const LineSymbol3DLayer: typeof __esri.LineSymbol3DLayer; + + /** + * MeshSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#MeshSymbol3D) + */ + export type MeshSymbol3D = __esri.MeshSymbol3D; + export const MeshSymbol3D: typeof __esri.MeshSymbol3D; + + /** + * ObjectSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#ObjectSymbol3DLayer) + */ + export type ObjectSymbol3DLayer = __esri.ObjectSymbol3DLayer; + export const ObjectSymbol3DLayer: typeof __esri.ObjectSymbol3DLayer; + + /** + * PathSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PathSymbol3DLayer) + */ + export type PathSymbol3DLayer = __esri.PathSymbol3DLayer; + export const PathSymbol3DLayer: typeof __esri.PathSymbol3DLayer; + + /** + * PictureFillSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PictureFillSymbol) + */ + export type PictureFillSymbol = __esri.PictureFillSymbol; + export const PictureFillSymbol: typeof __esri.PictureFillSymbol; + + /** + * PictureMarkerSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PictureMarkerSymbol) + */ + export type PictureMarkerSymbol = __esri.PictureMarkerSymbol; + export const PictureMarkerSymbol: typeof __esri.PictureMarkerSymbol; + + /** + * PointSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PointSymbol3D) + */ + export type PointSymbol3D = __esri.PointSymbol3D; + export const PointSymbol3D: typeof __esri.PointSymbol3D; + + /** + * PolygonSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PolygonSymbol3D) + */ + export type PolygonSymbol3D = __esri.PolygonSymbol3D; + export const PolygonSymbol3D: typeof __esri.PolygonSymbol3D; + + /** + * SimpleFillSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleFillSymbol) + */ + export type SimpleFillSymbol = __esri.SimpleFillSymbol; + export const SimpleFillSymbol: typeof __esri.SimpleFillSymbol; + + /** + * SimpleLineSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleLineSymbol) + */ + export type SimpleLineSymbol = __esri.SimpleLineSymbol; + export const SimpleLineSymbol: typeof __esri.SimpleLineSymbol; + + /** + * SimpleMarkerSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleMarkerSymbol) + */ + export type SimpleMarkerSymbol = __esri.SimpleMarkerSymbol; + export const SimpleMarkerSymbol: typeof __esri.SimpleMarkerSymbol; + + /** + * TextSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#TextSymbol) + */ + export type TextSymbol = __esri.TextSymbol; + export const TextSymbol: typeof __esri.TextSymbol; + + /** + * TextSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#TextSymbol3DLayer) + */ + export type TextSymbol3DLayer = __esri.TextSymbol3DLayer; + export const TextSymbol3DLayer: typeof __esri.TextSymbol3DLayer; + + /** + * WebStyleSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#WebStyleSymbol) + */ + export type WebStyleSymbol = __esri.WebStyleSymbol; + export const WebStyleSymbol: typeof __esri.WebStyleSymbol; + + /** + * FillSymbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#FillSymbol) + */ + export type FillSymbol = __esri.PictureFillSymbol | __esri.SimpleFillSymbol; + + /** + * MarkerSymbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#MarkerSymbol) + */ + export type MarkerSymbol = __esri.PictureMarkerSymbol | __esri.SimpleMarkerSymbol; + + /** + * Symbol2D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol2D) + */ + export type Symbol2D = + | __esri.PictureFillSymbol + | __esri.PictureMarkerSymbol + | __esri.SimpleFillSymbol + | __esri.SimpleLineSymbol + | __esri.SimpleMarkerSymbol + | __esri.TextSymbol; + + /** + * Symbol2D3D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol2D3D) + */ + export type Symbol2D3D = + | __esri.PictureFillSymbol + | __esri.PictureMarkerSymbol + | __esri.SimpleFillSymbol + | __esri.SimpleLineSymbol + | __esri.SimpleMarkerSymbol + | __esri.TextSymbol + | __esri.Symbol2D + | __esri.LabelSymbol3D + | __esri.LineSymbol3D + | __esri.MeshSymbol3D + | __esri.PointSymbol3D + | __esri.PolygonSymbol3D; + + /** + * Symbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol) + */ + export type Symbol = __esri.Symbol2D | __esri.symbolsSymbol3D | __esri.WebStyleSymbol; + + /** + * Symbol3DLayer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol3DLayer) + */ + export type Symbol3DLayer = + | __esri.ExtrudeSymbol3DLayer + | __esri.FillSymbol3DLayer + | __esri.IconSymbol3DLayer + | __esri.LineSymbol3DLayer + | __esri.ObjectSymbol3DLayer + | __esri.PathSymbol3DLayer + | __esri.TextSymbol3DLayer; + + /** + * Symbol3D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol3D) + */ + export type Symbol3D = + | __esri.LabelSymbol3D + | __esri.LineSymbol3D + | __esri.MeshSymbol3D + | __esri.PointSymbol3D + | __esri.PolygonSymbol3D; + } interface Callout3D extends Accessor, JSONSupport { /** * Creates a deep clone of the callout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html#clone) - * - * + * + * */ clone(): Callout3D; } @@ -26647,57 +28735,55 @@ declare namespace __esri { interface Callout3DConstructor { /** * When symbols have an offset from their position, it's important to still see what the real location is. This can be achieved with callouts: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) */ - new(properties?: Callout3DProperties): Callout3D; + new (properties?: Callout3DProperties): Callout3D; fromJSON(json: any): Callout3D; } export const Callout3D: Callout3DConstructor; - interface Callout3DProperties { - - } + interface Callout3DProperties {} interface LineCallout3D extends Callout3D { /** * The border settings of the callout line. The border of the callout line can be used to improve the contrast of the callout line color against various background colors. If the border is `null`, then no border will be visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) */ border: LineCallout3DBorder; /** * The color of the callout line. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#color) - * + * * @default black */ color: Color; /** * The width of the callout line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#size) - * + * * @default 1px */ size: number; /** * For LineCallout3D the type is always `line`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#type) */ type: string; /** * Creates a deep clone of the callout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#clone) - * - * + * + * */ clone(): LineCallout3D; } @@ -26705,11 +28791,11 @@ declare namespace __esri { interface LineCallout3DConstructor { /** * This type of callout displays a line to connect a symbol or a label with its actual location in the scene. For example when displaying points of interest in a city, visualizing them with a callout line helps to understand where the points are actually located: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) */ - new(properties?: LineCallout3DProperties): LineCallout3D; + new (properties?: LineCallout3DProperties): LineCallout3D; fromJSON(json: any): LineCallout3D; } @@ -26719,41 +28805,40 @@ declare namespace __esri { interface LineCallout3DProperties extends Callout3DProperties { /** * The border settings of the callout line. The border of the callout line can be used to improve the contrast of the callout line color against various background colors. If the border is `null`, then no border will be visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) */ border?: LineCallout3DBorderProperties; /** * The color of the callout line. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#color) - * + * * @default black */ color?: Color | number[] | string; /** * The width of the callout line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#size) - * + * * @default 1px */ size?: number | string; /** * For LineCallout3D the type is always `line`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#type) */ type?: string; } - export interface LineCallout3DBorderProperties extends Object { /** * The color of the callout line border. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) - * + * * @default white */ color?: Color; @@ -26762,9 +28847,9 @@ declare namespace __esri { export interface LineCallout3DBorder extends AnonymousAccessor { /** * The color of the callout line border. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) - * + * * @default white */ color?: Color; @@ -26773,35 +28858,35 @@ declare namespace __esri { interface Edges3D extends Accessor, JSONSupport { /** * The color of the edges. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#color) - * + * * @default black */ color: Color; /** * A size in points by which to extend edges beyond their original end points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#extensionLength) - * + * * @default "0" */ extensionLength: number; /** * The size of the edges in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#size) - * + * * @default 1px */ size: number; /** * Creates a deep clone of the edges. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#clone) - * - * + * + * */ clone(): Edges3D; } @@ -26809,11 +28894,11 @@ declare namespace __esri { interface Edges3DConstructor { /** * Edges3D is the base class for symbol classes that add edge rendering visualization to existing symbols. Edge rendering visualization is specific for 3D visualizations and can only be applied to [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html) on [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html) on [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html) */ - new(properties?: Edges3DProperties): Edges3D; + new (properties?: Edges3DProperties): Edges3D; fromJSON(json: any): Edges3D; } @@ -26823,25 +28908,25 @@ declare namespace __esri { interface Edges3DProperties { /** * The color of the edges. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#color) - * + * * @default black */ color?: Color | number[] | string; /** * A size in points by which to extend edges beyond their original end points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#extensionLength) - * + * * @default "0" */ extensionLength?: number | string; /** * The size of the edges in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#size) - * + * * @default 1px */ size?: number | string; @@ -26850,17 +28935,17 @@ declare namespace __esri { interface SketchEdges3D extends Edges3D { /** * For SketchEdges3D the type is always `sketch`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SketchEdges3D.html#type) */ type: "sketch"; /** * Creates a deep clone of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SketchEdges3D.html#clone) - * - * + * + * */ clone(): SketchEdges3D; } @@ -26868,11 +28953,11 @@ declare namespace __esri { interface SketchEdges3DConstructor { /** * SketchEdges3D is a symbol type that visualizes edges of [3D Object SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), extruded polygons or mesh geometries with a sketched line. It can be used to emphasize the form of 3D objects and to improve the three-dimensional spatial understanding. A sketched line aims to look like a hand-drawn line. In architecture this is useful for visualizing planned urban projects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SketchEdges3D.html) */ - new(properties?: SketchEdges3DProperties): SketchEdges3D; + new (properties?: SketchEdges3DProperties): SketchEdges3D; fromJSON(json: any): SketchEdges3D; } @@ -26882,7 +28967,7 @@ declare namespace __esri { interface SketchEdges3DProperties extends Edges3DProperties { /** * For SketchEdges3D the type is always `sketch`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SketchEdges3D.html#type) */ type?: "sketch"; @@ -26891,17 +28976,17 @@ declare namespace __esri { interface SolidEdges3D extends Edges3D { /** * For SolidEdges3D the type is always `solid`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SolidEdges3D.html#type) */ type: "solid"; /** * Creates a deep clone of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SolidEdges3D.html#clone) - * - * + * + * */ clone(): SolidEdges3D; } @@ -26909,11 +28994,11 @@ declare namespace __esri { interface SolidEdges3DConstructor { /** * SolidEdges3D is a symbol type that visualizes edges of [3D Object SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), extruded polygons or mesh geometries with a solid line. It can be used to emphasize the form of 3D objects and to improve the three-dimensional spatial understanding. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SolidEdges3D.html) */ - new(properties?: SolidEdges3DProperties): SolidEdges3D; + new (properties?: SolidEdges3DProperties): SolidEdges3D; fromJSON(json: any): SolidEdges3D; } @@ -26923,7 +29008,7 @@ declare namespace __esri { interface SolidEdges3DProperties extends Edges3DProperties { /** * For SolidEdges3D the type is always `solid`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SolidEdges3D.html#type) */ type?: "solid"; @@ -26932,31 +29017,31 @@ declare namespace __esri { interface ExtrudeSymbol3DLayer extends Symbol3DLayer { /** * Sets the contour edges on polygons symbolized with ExtrudeSymbol3DLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#edges) */ edges: Edges3D; /** * The height of the extrusion in meters. Negative values will extrude the polygon surface downward towards or below the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#size) - * + * * @default 1 */ size: number; /** * For ExtrudeSymbol3DLayer the type is always `extrude`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#type) */ readonly type: "extrude"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#clone) - * - * + * + * */ clone(): ExtrudeSymbol3DLayer; } @@ -26964,11 +29049,11 @@ declare namespace __esri { interface ExtrudeSymbol3DLayerConstructor { /** * ExtrudeSymbol3DLayer is used to render [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries by extruding them upward from the ground, creating a 3D volumetric object. This is done with a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html) */ - new(properties?: ExtrudeSymbol3DLayerProperties): ExtrudeSymbol3DLayer; + new (properties?: ExtrudeSymbol3DLayerProperties): ExtrudeSymbol3DLayer; fromJSON(json: any): ExtrudeSymbol3DLayer; } @@ -26978,15 +29063,15 @@ declare namespace __esri { interface ExtrudeSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * Sets the contour edges on polygons symbolized with ExtrudeSymbol3DLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#edges) */ edges?: Edges3DProperties; /** * The height of the extrusion in meters. Negative values will extrude the polygon surface downward towards or below the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#size) - * + * * @default 1 */ size?: number; @@ -26995,7 +29080,7 @@ declare namespace __esri { interface FillSymbol extends Symbol { /** * The outline of the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html#outline) */ outline: SimpleLineSymbol; @@ -27004,11 +29089,11 @@ declare namespace __esri { interface FillSymbolConstructor { /** * Fill symbols are used to draw [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) graphics in a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) or a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). To create new fill symbols, use either [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html) or [PictureFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) */ - new(properties?: FillSymbolProperties): FillSymbol; + new (properties?: FillSymbolProperties): FillSymbol; fromJSON(json: any): FillSymbol; } @@ -27018,7 +29103,7 @@ declare namespace __esri { interface FillSymbolProperties extends SymbolProperties { /** * The outline of the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html#outline) */ outline?: SimpleLineSymbolProperties; @@ -27027,29 +29112,29 @@ 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/assets/img/apiref/symbols/symbol3d-edges-solid-2.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#edges) */ edges: Edges3D; /** * The outline used to draw a line around the filled geometry. This property is not supported in [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) symbol layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ outline: FillSymbol3DLayerOutline; /** * For FillSymbol3DLayer the type is always `fill`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#type) */ readonly type: "fill"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#clone) - * - * + * + * */ clone(): FillSymbol3DLayer; } @@ -27057,11 +29142,11 @@ declare namespace __esri { interface FillSymbol3DLayerConstructor { /** * FillSymbol3DLayer is used to render the surfaces of flat 2D [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries and 3D volumetric meshes in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html) */ - new(properties?: FillSymbol3DLayerProperties): FillSymbol3DLayer; + new (properties?: FillSymbol3DLayerProperties): FillSymbol3DLayer; fromJSON(json: any): FillSymbol3DLayer; } @@ -27071,29 +29156,28 @@ 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/assets/img/apiref/symbols/symbol3d-edges-solid-2.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#edges) */ edges?: Edges3DProperties; /** * The outline used to draw a line around the filled geometry. This property is not supported in [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) symbol layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ outline?: FillSymbol3DLayerOutlineProperties; } - export interface FillSymbol3DLayerOutlineProperties extends Object { /** * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ color?: Color | number[] | string; /** * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ size?: number | string; @@ -27102,13 +29186,13 @@ declare namespace __esri { export interface FillSymbol3DLayerOutline extends AnonymousAccessor { /** * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ color: Color; /** * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ size: number; @@ -27116,63 +29200,62 @@ declare namespace __esri { interface Font extends Accessor, JSONSupport { /** - * The text decoration. **Possible Values:** underline | line-through | none + * The text decoration. **Possible Values:** underline | line-through | none * > **Known Limitations** This property is currently not 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-symbols-Font.html#decoration) - * + * * @default none */ decoration: "underline" | "line-through" | "none"; /** - * The font family of the text. The possible values are dependent upon the: layer type, rendering mechanism, and if you working with 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). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. - * + * The font family of the text. The possible values are dependent upon the layer type, and if you working with 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). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) - * + * * @default sans-serif */ family: string; /** * The font size in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * > **Known Limitations** In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [TextSymbol3DLayer.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) property is set, it will override this [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) - * + * * @default 9 */ 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 [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. - * + * 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 [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) labels. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#style) - * + * * @default normal */ 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 [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. - * + * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter + * > **Known Limitations** `bolder` and `lighter` are not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) labels. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) - * + * * @default normal */ weight: "normal" | "bold" | "bolder" | "lighter"; /** * Creates a deep clone of the font object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#clone) - * - * + * + * */ clone(): Font; } interface FontConstructor { - - - new(properties?: FontProperties): Font; + new (properties?: FontProperties): Font; fromJSON(json: any): Font; } @@ -27181,45 +29264,46 @@ declare namespace __esri { interface FontProperties { /** - * The text decoration. **Possible Values:** underline | line-through | none + * The text decoration. **Possible Values:** underline | line-through | none * > **Known Limitations** This property is currently not 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-symbols-Font.html#decoration) - * + * * @default none */ decoration?: "underline" | "line-through" | "none"; /** - * The font family of the text. The possible values are dependent upon the: layer type, rendering mechanism, and if you working with 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). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. - * + * The font family of the text. The possible values are dependent upon the layer type, and if you working with 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). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) - * + * * @default sans-serif */ family?: string; /** * The font size in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * > **Known Limitations** In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [TextSymbol3DLayer.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) property is set, it will override this [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) - * + * * @default 9 */ 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 [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. - * + * 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 [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) labels. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#style) - * + * * @default normal */ 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 [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. - * + * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter + * > **Known Limitations** `bolder` and `lighter` are not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) labels. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) - * + * * @default normal */ weight?: "normal" | "bold" | "bolder" | "lighter"; @@ -27228,47 +29312,47 @@ declare namespace __esri { interface IconSymbol3DLayer extends Symbol3DLayer { /** * The positioning of the icon relative to the geometry. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) - * + * * @default center */ anchor: string; /** * The outline of the icon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) */ outline: IconSymbol3DLayerOutline; /** * The shape (`primitive`) or image URL (`href`) used to visualize the features. If both properties are present, `href` takes precedence and `primitive` is ignored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) - * + * * @default { primitive: "circle" } */ resource: IconSymbol3DLayerResource; /** * The size of the icon in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#size) - * + * * @default 12 */ size: number; /** * For IconSymbol3DLayer the type is always `icon`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#type) */ readonly type: "icon"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#clone) - * - * + * + * */ clone(): IconSymbol3DLayer; } @@ -27276,11 +29360,11 @@ declare namespace __esri { interface IconSymbol3DLayerConstructor { /** * IconSymbol3DLayer is used to render [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries using a flat 2D icon (e.g. a circle) with a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features may also be rendered with IconSymbol3DLayers, but the icon symbol layer must be contained within a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html), not a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in that scenario. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) */ - new(properties?: IconSymbol3DLayerProperties): IconSymbol3DLayer; + new (properties?: IconSymbol3DLayerProperties): IconSymbol3DLayer; fromJSON(json: any): IconSymbol3DLayer; } @@ -27290,51 +29374,50 @@ declare namespace __esri { interface IconSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * The positioning of the icon relative to the geometry. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) - * + * * @default center */ anchor?: string; /** * The outline of the icon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) */ outline?: IconSymbol3DLayerOutlineProperties; /** * The shape (`primitive`) or image URL (`href`) used to visualize the features. If both properties are present, `href` takes precedence and `primitive` is ignored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) - * + * * @default { primitive: "circle" } */ resource?: IconSymbol3DLayerResource; /** * The size of the icon in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#size) - * + * * @default 12 */ size?: number | string; } - export interface IconSymbol3DLayerOutlineProperties extends Object { /** * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) - * + * * @default black */ color?: Color | number[] | string; /** * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) - * + * * @default 1.125 */ size?: number | string; @@ -27343,27 +29426,26 @@ declare namespace __esri { export interface IconSymbol3DLayerOutline extends AnonymousAccessor { /** * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) - * + * * @default black */ color?: Color; /** * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) - * + * * @default 1.125 */ size?: number; } - export interface IconSymbol3DLayerResource extends Object { /** - * Uses a built-in shape. See the table below for list of possible values. - * + * Uses a built-in shape. See the table below for list of possible values. + * * Value | Description * ------|------------ * circle | ![s3d-icon-circle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-circle.png) @@ -27371,14 +29453,14 @@ declare namespace __esri { * 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) */ primitive?: string; /** * The URL or data URI for the image. If the external resource is an SVG then the SVG root node must have a set width and height, otherwise it will not render at the correct size. SVG is not supported in IE11. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) */ href?: string; @@ -27387,29 +29469,29 @@ declare namespace __esri { interface LabelSymbol3D extends Symbol3D { /** * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type `line` are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) */ callout: Callout3D; /** * For LabelSymbol3D the type is always `label-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#type) */ readonly type: "label-3d"; /** * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) `verticalOffset` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ verticalOffset: LabelSymbol3DVerticalOffset; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#clone) - * - * + * + * */ clone(): LabelSymbol3D; } @@ -27417,11 +29499,11 @@ declare namespace __esri { interface LabelSymbol3DConstructor { /** * LabelSymbol3D is used to render labels for features from a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) */ - new(properties?: LabelSymbol3DProperties): LabelSymbol3D; + new (properties?: LabelSymbol3DProperties): LabelSymbol3D; fromJSON(json: any): LabelSymbol3D; } @@ -27431,35 +29513,34 @@ declare namespace __esri { interface LabelSymbol3DProperties extends Symbol3DProperties { /** * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type `line` are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) */ callout?: Callout3DProperties; /** * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) `verticalOffset` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ verticalOffset?: LabelSymbol3DVerticalOffsetProperties; } - export interface LabelSymbol3DVerticalOffsetProperties extends Object { /** * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ 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/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/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ maxWorldLength?: number; @@ -27468,38 +29549,30 @@ declare namespace __esri { export interface LabelSymbol3DVerticalOffset extends AnonymousAccessor { /** * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ 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/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/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ maxWorldLength?: number; } interface LineSymbol extends Symbol { - /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#color) - * - * @default "black" - */ - color: Color; /** * The width of the symbol in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#width) - * + * * @default 0.75 */ width: number; @@ -27508,11 +29581,11 @@ declare namespace __esri { interface LineSymbolConstructor { /** * Line symbols are used to draw [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html) */ - new(properties?: LineSymbolProperties): LineSymbol; + new (properties?: LineSymbolProperties): LineSymbol; fromJSON(json: any): LineSymbol; } @@ -27520,19 +29593,11 @@ declare namespace __esri { export const LineSymbol: LineSymbolConstructor; interface LineSymbolProperties extends SymbolProperties { - /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#color) - * - * @default "black" - */ - color?: Color | number[] | string; /** * The width of the symbol in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#width) - * + * * @default 0.75 */ width?: number | string; @@ -27541,17 +29606,17 @@ declare namespace __esri { interface LineSymbol3D extends Symbol3D { /** * For LineSymbol3D the type is always `line-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html#type) */ readonly type: "line-3d"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html#clone) - * - * + * + * */ clone(): LineSymbol3D; } @@ -27559,43 +29624,41 @@ declare namespace __esri { interface LineSymbol3DConstructor { /** * LineSymbol3D is used to render features with [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) */ - new(properties?: LineSymbol3DProperties): LineSymbol3D; + new (properties?: LineSymbol3DProperties): LineSymbol3D; fromJSON(json: any): LineSymbol3D; } export const LineSymbol3D: LineSymbol3DConstructor; - interface LineSymbol3DProperties extends Symbol3DProperties { - - } + interface LineSymbol3DProperties extends Symbol3DProperties {} interface LineSymbol3DLayer extends Symbol3DLayer { /** * The width of the line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#size) - * + * * @default "1px" */ size: number; /** * For LineSymbol3DLayer the type is always `line`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#type) */ readonly type: "line"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#clone) - * - * + * + * */ clone(): LineSymbol3DLayer; } @@ -27603,11 +29666,11 @@ declare namespace __esri { interface LineSymbol3DLayerConstructor { /** * LineSymbol3DLayer renders [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries using a flat 2D line with a [LineSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html) */ - new(properties?: LineSymbol3DLayerProperties): LineSymbol3DLayer; + new (properties?: LineSymbol3DLayerProperties): LineSymbol3DLayer; fromJSON(json: any): LineSymbol3DLayer; } @@ -27617,9 +29680,9 @@ declare namespace __esri { interface LineSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * The width of the line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#size) - * + * * @default "1px" */ size?: number | string; @@ -27627,29 +29690,29 @@ declare namespace __esri { interface MarkerSymbol extends Symbol { /** - * The angle of the marker in degrees. + * The angle of the marker in degrees. * > **Known Limitations** This property is currently not 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-symbols-MarkerSymbol.html#angle) - * + * * @default 0 */ angle: number; /** - * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-MarkerSymbol.html#xoffset) - * + * * @default 0 */ xoffset: number; /** - * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-MarkerSymbol.html#yoffset) - * + * * @default 0 */ yoffset: number; @@ -27658,11 +29721,11 @@ declare namespace __esri { interface MarkerSymbolConstructor { /** * Marker symbols are used to draw [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) graphics in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). To create new marker symbols, use either [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) or [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) */ - new(properties?: MarkerSymbolProperties): MarkerSymbol; + new (properties?: MarkerSymbolProperties): MarkerSymbol; fromJSON(json: any): MarkerSymbol; } @@ -27671,29 +29734,29 @@ declare namespace __esri { interface MarkerSymbolProperties extends SymbolProperties { /** - * The angle of the marker in degrees. + * The angle of the marker in degrees. * > **Known Limitations** This property is currently not 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-symbols-MarkerSymbol.html#angle) - * + * * @default 0 */ angle?: number; /** - * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-MarkerSymbol.html#xoffset) - * + * * @default 0 */ xoffset?: number | string; /** - * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-MarkerSymbol.html#yoffset) - * + * * @default 0 */ yoffset?: number | string; @@ -27702,17 +29765,17 @@ declare namespace __esri { interface MeshSymbol3D extends Symbol3D { /** * For MeshSymbol3D, the type is always `mesh-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html#type) */ readonly type: "mesh-3d"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html#clone) - * - * + * + * */ clone(): MeshSymbol3D; } @@ -27720,99 +29783,103 @@ declare namespace __esri { interface MeshSymbol3DConstructor { /** * MeshSymbol3D is used to render 3D mesh features in a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) */ - new(properties?: MeshSymbol3DProperties): MeshSymbol3D; + new (properties?: MeshSymbol3DProperties): MeshSymbol3D; fromJSON(json: any): MeshSymbol3D; } export const MeshSymbol3D: MeshSymbol3DConstructor; - interface MeshSymbol3DProperties extends Symbol3DProperties { - - } + interface MeshSymbol3DProperties extends Symbol3DProperties {} interface ObjectSymbol3DLayer extends Symbol3DLayer { /** - * The positioning of the object relative to the geometry. The default behavior (`origin`) depends on the resource: + * The positioning of the symbol relative to the geometry. The default behavior (`origin`) depends on the resource: * * For `sphere`, `cube` and `diamond` primitives, the origin is at the center. * * For `cylinder`, `cone`, `inverted-cone` and `tetrahedron` primitives, the origin is at the bottom. * * For `href` resources, the origin coincides with the origin of the 3D model. - * - * - * **Possible Values:** center | top | bottom | origin - * + * + * + * If `anchor` is set to `relative`, the anchor is defined by [`anchorPosition`](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) as a fraction of the symbol's bounding box. **Possible Values:** center | top | bottom | origin | relative + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) - * + * * @default origin */ anchor: string; + /** + * Defines the [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) relative to the center of the [symbol layer resource](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource). It is specified as a ratio of the resource's bounding box dimensions. For example, a value of `{ x: 0, y: 0, z: 0 }` designates the center, while a value of `{ x: -0.5, y: -0.5, z: -0.5 }` places the symbol at the lower south-west corner of the symbol's bounding box. This property only applies when [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) is set to `relative`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) + */ + anchorPosition: ObjectSymbol3DLayerAnchorPosition; /** * The depth, or diameter from north to south, of the object in meters. If `undefined`, the depth will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) - * + * * @default 10 */ depth: number; /** * The clockwise rotation of the symbol in the horizontal plane (i.e., around the z axis). The rotation is specified in degrees and is relative to the y-axis. 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 this angle corresponds to the heading of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#heading) */ heading: number; /** * The height of the object in meters. If `undefined`, the height will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height) - * + * * @default 10 */ height: number; /** * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the points. If both properties are present, `primitive` takes precedence and `href` is ignored. When using the `href` property, external 3D models must be present in a specific format, which can be generated using the ArcGIS Pro SDK. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to generate a custom 3D model for use in this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) - * + * * @default { primitive: "sphere" } */ resource: ObjectSymbol3DLayerResource; /** * The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). The rotation is specified in degrees and is relative to the x-axis. At 0 degrees, the model is level. A positive value lifts the left part and lowers the right part of the model. 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 this angle corresponds to the roll of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#roll) */ roll: number; /** * The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). The rotation is specified in degrees and is relative to the y-axis. At 0 degrees, the model is level. A positive value points lifts the front and lowers the back of the model. 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 this angle corresponds to the tilt of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#tilt) */ tilt: number; /** * For ObjectSymbol3DLayer the type is always `object`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#type) */ readonly type: "object"; /** * The width, or diameter from east to west, of the object in meters. If `undefined`, the width will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width) - * + * * @default 10 */ width: number; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#clone) - * - * + * + * */ clone(): ObjectSymbol3DLayer; } @@ -27820,11 +29887,11 @@ declare namespace __esri { interface ObjectSymbol3DLayerConstructor { /** * ObjectSymbol3DLayer is used to render [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries using a volumetric 3D shape (e.g., a sphere or cylinder) with a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features may also be rendered with ObjectSymbol3DLayers, but the object symbol layer must be contained in a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html), not a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in this scenario. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) */ - new(properties?: ObjectSymbol3DLayerProperties): ObjectSymbol3DLayer; + new (properties?: ObjectSymbol3DLayerProperties): ObjectSymbol3DLayer; fromJSON(json: any): ObjectSymbol3DLayer; } @@ -27833,76 +29900,89 @@ declare namespace __esri { interface ObjectSymbol3DLayerProperties extends Symbol3DLayerProperties { /** - * The positioning of the object relative to the geometry. The default behavior (`origin`) depends on the resource: + * The positioning of the symbol relative to the geometry. The default behavior (`origin`) depends on the resource: * * For `sphere`, `cube` and `diamond` primitives, the origin is at the center. * * For `cylinder`, `cone`, `inverted-cone` and `tetrahedron` primitives, the origin is at the bottom. * * For `href` resources, the origin coincides with the origin of the 3D model. - * - * - * **Possible Values:** center | top | bottom | origin - * + * + * + * If `anchor` is set to `relative`, the anchor is defined by [`anchorPosition`](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) as a fraction of the symbol's bounding box. **Possible Values:** center | top | bottom | origin | relative + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) - * + * * @default origin */ anchor?: string; + /** + * Defines the [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) relative to the center of the [symbol layer resource](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource). It is specified as a ratio of the resource's bounding box dimensions. For example, a value of `{ x: 0, y: 0, z: 0 }` designates the center, while a value of `{ x: -0.5, y: -0.5, z: -0.5 }` places the symbol at the lower south-west corner of the symbol's bounding box. This property only applies when [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) is set to `relative`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) + */ + anchorPosition?: ObjectSymbol3DLayerAnchorPosition; /** * The depth, or diameter from north to south, of the object in meters. If `undefined`, the depth will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) - * + * * @default 10 */ depth?: number; /** * The clockwise rotation of the symbol in the horizontal plane (i.e., around the z axis). The rotation is specified in degrees and is relative to the y-axis. 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 this angle corresponds to the heading of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#heading) */ heading?: number; /** * The height of the object in meters. If `undefined`, the height will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height) - * + * * @default 10 */ height?: number; /** * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the points. If both properties are present, `primitive` takes precedence and `href` is ignored. When using the `href` property, external 3D models must be present in a specific format, which can be generated using the ArcGIS Pro SDK. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to generate a custom 3D model for use in this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) - * + * * @default { primitive: "sphere" } */ resource?: ObjectSymbol3DLayerResource; /** * The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). The rotation is specified in degrees and is relative to the x-axis. At 0 degrees, the model is level. A positive value lifts the left part and lowers the right part of the model. 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 this angle corresponds to the roll of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#roll) */ roll?: number; /** * The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). The rotation is specified in degrees and is relative to the y-axis. At 0 degrees, the model is level. A positive value points lifts the front and lowers the back of the model. 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 this angle corresponds to the tilt of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#tilt) */ tilt?: number; /** * The width, or diameter from east to west, of the object in meters. If `undefined`, the width will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width) - * + * * @default 10 */ width?: number; } + export interface ObjectSymbol3DLayerAnchorPosition extends Object { + x: number; + + y: number; + + z: number; + } export interface ObjectSymbol3DLayerResource extends Object { /** - * Uses a built-in shape. See the table below for possible values. - * + * Uses a built-in shape. See the table below for possible values. + * * Value | Description * ------|------------ * sphere | ![s3d-object-sphere](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-sphere.png) @@ -27912,14 +29992,14 @@ declare namespace __esri { * 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) */ primitive?: string; /** * The URL to the 3D model. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to create a custom 3D model. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) */ href?: string; @@ -27928,25 +30008,25 @@ declare namespace __esri { interface PathSymbol3DLayer extends Symbol3DLayer { /** * The diameter of the tube in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#size) - * + * * @default 1 */ size: number; /** * For PathSymbol3DLayer, the type is always `path`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#type) */ readonly type: "path"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#clone) - * - * + * + * */ clone(): PathSymbol3DLayer; } @@ -27954,11 +30034,11 @@ declare namespace __esri { interface PathSymbol3DLayerConstructor { /** * PathSymbol3DLayer renders [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries using a volumetric 3D tube with a [LineSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html) */ - new(properties?: PathSymbol3DLayerProperties): PathSymbol3DLayer; + new (properties?: PathSymbol3DLayerProperties): PathSymbol3DLayer; fromJSON(json: any): PathSymbol3DLayer; } @@ -27968,9 +30048,9 @@ declare namespace __esri { interface PathSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * The diameter of the tube in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#size) - * + * * @default 1 */ size?: number; @@ -27979,71 +30059,71 @@ declare namespace __esri { interface PictureFillSymbol extends FillSymbol { /** * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#height) - * + * * @default 12 */ height: number; /** * For PictureFillSymbol the type is always `picture-fill`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#type) */ readonly type: "picture-fill"; /** * The URL to the image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) */ url: string; /** * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#width) - * + * * @default 12 */ width: number; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xoffset) - * + * * @default 0 */ xoffset: number; /** * The scale factor on the x axis of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xscale) - * + * * @default 1 */ xscale: number; /** * The offset on the y-axis in pixels or points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yoffset) - * + * * @default 0 */ yoffset: number; /** * The scale factor on the y axis of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yscale) - * + * * @default 1 */ yscale: number; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#clone) - * - * + * + * */ clone(): PictureFillSymbol; } @@ -28051,11 +30131,11 @@ declare namespace __esri { interface PictureFillSymbolConstructor { /** * PictureFillSymbol uses an image in a repeating pattern to symbolize polygon features in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). A [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) must point to a valid image. In addition, the symbol can have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#outline), which is defined by a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). PictureFillSymbols may be applied to polygon features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or an individual [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html) */ - new(properties?: PictureFillSymbolProperties): PictureFillSymbol; + new (properties?: PictureFillSymbolProperties): PictureFillSymbol; fromJSON(json: any): PictureFillSymbol; } @@ -28065,55 +30145,55 @@ declare namespace __esri { interface PictureFillSymbolProperties extends FillSymbolProperties { /** * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#height) - * + * * @default 12 */ height?: number | string; /** * The URL to the image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) */ url?: string; /** * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#width) - * + * * @default 12 */ width?: number | string; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xoffset) - * + * * @default 0 */ xoffset?: number | string; /** * The scale factor on the x axis of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xscale) - * + * * @default 1 */ xscale?: number; /** * The offset on the y-axis in pixels or points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yoffset) - * + * * @default 0 */ yoffset?: number | string; /** * The scale factor on the y axis of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yscale) - * + * * @default 1 */ yscale?: number; @@ -28122,42 +30202,42 @@ declare namespace __esri { interface PictureMarkerSymbol extends MarkerSymbol { /** * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#height) - * + * * @default 12 */ height: number; /** * For PictureMarkerSymbol the type is always `picture-marker`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#type) */ readonly type: "picture-marker"; /** - * The URL to the image. To avoid CORS issues with this symbol, do one of the following: + * The URL to the image. To avoid CORS issues with this symbol, do one of the following: * * 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) */ url: string; /** * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#width) - * + * * @default 12 */ width: number; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#clone) - * - * + * + * */ clone(): PictureMarkerSymbol; } @@ -28165,11 +30245,11 @@ declare namespace __esri { interface PictureMarkerSymbolConstructor { /** * PictureMarkerSymbol renders [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) graphics 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) using an image. A [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) must point to a valid image. PictureMarkerSymbols may be applied to point features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). The image below depicts a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) whose point features are styled with a [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html) */ - new(properties?: PictureMarkerSymbolProperties): PictureMarkerSymbol; + new (properties?: PictureMarkerSymbolProperties): PictureMarkerSymbol; fromJSON(json: any): PictureMarkerSymbol; } @@ -28179,26 +30259,26 @@ declare namespace __esri { interface PictureMarkerSymbolProperties extends MarkerSymbolProperties { /** * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#height) - * + * * @default 12 */ height?: number | string; /** - * The URL to the image. To avoid CORS issues with this symbol, do one of the following: + * The URL to the image. To avoid CORS issues with this symbol, do one of the following: * * 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) */ url?: string; /** * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#width) - * + * * @default 12 */ width?: number | string; @@ -28207,29 +30287,29 @@ declare namespace __esri { interface PointSymbol3D extends Symbol3D { /** * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type line are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) */ callout: Callout3D; /** * For PointSymbol3D the type is always `point-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#type) */ readonly type: "point-3d"; /** * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) `verticalOffset` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ verticalOffset: PointSymbol3DVerticalOffset; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#clone) - * - * + * + * */ clone(): PointSymbol3D; } @@ -28237,11 +30317,11 @@ declare namespace __esri { interface PointSymbol3DConstructor { /** * PointSymbol3D is used to render features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) */ - new(properties?: PointSymbol3DProperties): PointSymbol3D; + new (properties?: PointSymbol3DProperties): PointSymbol3D; fromJSON(json: any): PointSymbol3D; } @@ -28251,35 +30331,34 @@ declare namespace __esri { interface PointSymbol3DProperties extends Symbol3DProperties { /** * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type line are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) */ callout?: Callout3DProperties; /** * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) `verticalOffset` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ verticalOffset?: PointSymbol3DVerticalOffsetProperties; } - export interface PointSymbol3DVerticalOffsetProperties extends Object { /** * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ 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/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/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ maxWorldLength?: number; @@ -28288,19 +30367,19 @@ declare namespace __esri { export interface PointSymbol3DVerticalOffset extends AnonymousAccessor { /** * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ 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/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/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ maxWorldLength?: number; @@ -28309,17 +30388,17 @@ declare namespace __esri { interface PolygonSymbol3D extends Symbol3D { /** * For PolygonSymbol3D the type is always `polygon-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html#type) */ readonly type: "polygon-3d"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html#clone) - * - * + * + * */ clone(): PolygonSymbol3D; } @@ -28327,33 +30406,23 @@ declare namespace __esri { interface PolygonSymbol3DConstructor { /** * PolygonSymbol3D is used to render features with [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. Polygon features may also be rendered as points with icons or objects at the centroid of each polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) */ - new(properties?: PolygonSymbol3DProperties): PolygonSymbol3D; + new (properties?: PolygonSymbol3DProperties): PolygonSymbol3D; fromJSON(json: any): PolygonSymbol3D; } export const PolygonSymbol3D: PolygonSymbol3DConstructor; - interface PolygonSymbol3DProperties extends Symbol3DProperties { - - } + interface PolygonSymbol3DProperties extends Symbol3DProperties {} interface SimpleFillSymbol extends FillSymbol { /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color) - * - * @default [0, 0, 0, 0.25] - black, semitransparent - */ - color: Color; - /** - * The fill style. Possible values are listed in the table below: - * + * The fill style. Possible values are listed in the table below: + * * Value | Description * ------|------------- * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) @@ -28364,27 +30433,27 @@ declare namespace __esri { * none | The polygon has no fill. * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style) - * + * * @default solid */ style: string; /** * For SimpleFillSymbol the type is always `simple-fill`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#type) */ readonly type: "simple-fill"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#clone) - * - * + * + * */ clone(): SimpleFillSymbol; } @@ -28392,11 +30461,11 @@ declare namespace __esri { interface SimpleFillSymbolConstructor { /** * SimpleFillSymbol is used for rendering 2D polygons in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It can be filled with a solid [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color), or a [pattern](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style). In addition, the symbol can have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#outline), which is defined by a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html) */ - new(properties?: SimpleFillSymbolProperties): SimpleFillSymbol; + new (properties?: SimpleFillSymbolProperties): SimpleFillSymbol; fromJSON(json: any): SimpleFillSymbol; } @@ -28405,16 +30474,8 @@ declare namespace __esri { interface SimpleFillSymbolProperties extends FillSymbolProperties { /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color) - * - * @default [0, 0, 0, 0.25] - black, semitransparent - */ - color?: Color | number[] | string; - /** - * The fill style. Possible values are listed in the table below: - * + * The fill style. Possible values are listed in the table below: + * * Value | Description * ------|------------- * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) @@ -28425,11 +30486,11 @@ declare namespace __esri { * none | The polygon has no fill. * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style) - * + * * @default solid */ style?: string; @@ -28437,51 +30498,51 @@ declare namespace __esri { interface SimpleLineSymbol extends LineSymbol { /** - * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. - * + * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. + * * Possible Value | Example * ---------------|--------- * 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** + * + * > **Known Limitations** * * This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * This property does not persist when applied to a symbol used in a layer saved to a web map or portal item. See the [web map specification](https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/) for more details about properties that persist when a SimpleLineSymbol is saved to an ArcGIS Online or Portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#cap) - * + * * @default round */ cap: "butt" | "round" | "square"; /** - * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. - * + * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. + * * Possible Value | Example * ---------------|--------- * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#join) - * + * * @default round */ join: "miter" | "round" | "bevel"; /** - * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-SimpleLineSymbol.html#miterLimit) - * + * * @default 0.75 */ miterLimit: number; /** - * Specifies the line style. Possible values are listed in the table below: - * + * Specifies the line style. Possible values are listed in the table below: + * * Value | Description * ------|------------- * dash | ![sls-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash.png) @@ -28496,27 +30557,27 @@ declare namespace __esri { * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#style) - * + * * @default solid */ style: string; /** * For SimpleLineSymbol, the type is always `simple-line`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#type) */ readonly type: "simple-line"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#clone) - * - * + * + * */ clone(): SimpleLineSymbol; } @@ -28524,11 +30585,11 @@ declare namespace __esri { interface SimpleLineSymbolConstructor { /** * SimpleLineSymbol is used for rendering 2D [polyline geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). SimpleLineSymbol is also used for rendering outlines for [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) and [fill symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html) */ - new(properties?: SimpleLineSymbolProperties): SimpleLineSymbol; + new (properties?: SimpleLineSymbolProperties): SimpleLineSymbol; fromJSON(json: any): SimpleLineSymbol; } @@ -28537,51 +30598,51 @@ declare namespace __esri { interface SimpleLineSymbolProperties extends LineSymbolProperties { /** - * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. - * + * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. + * * Possible Value | Example * ---------------|--------- * 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** + * + * > **Known Limitations** * * This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * This property does not persist when applied to a symbol used in a layer saved to a web map or portal item. See the [web map specification](https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/) for more details about properties that persist when a SimpleLineSymbol is saved to an ArcGIS Online or Portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#cap) - * + * * @default round */ cap?: "butt" | "round" | "square"; /** - * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. - * + * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. + * * Possible Value | Example * ---------------|--------- * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#join) - * + * * @default round */ join?: "miter" | "round" | "bevel"; /** - * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-SimpleLineSymbol.html#miterLimit) - * + * * @default 0.75 */ miterLimit?: number | string; /** - * Specifies the line style. Possible values are listed in the table below: - * + * Specifies the line style. Possible values are listed in the table below: + * * Value | Description * ------|------------- * dash | ![sls-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash.png) @@ -28596,77 +30657,70 @@ declare namespace __esri { * 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#style) - * + * * @default solid */ style?: string; } interface SimpleMarkerSymbol extends MarkerSymbol { - /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * > The `color` property does not apply to marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). Since these styles are wholly comprised of outlines, you must modify the [outline.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) property to set the color of symbols with those styles. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) - * - * @default [255, 255, 255, 0.25] - white, semitransparent - */ - color: Color; /** * The outline of the marker symbol. The `color` property of this object directly modifies the overall color of marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) */ outline: SimpleLineSymbol; /** - * The SVG path of the icon. + * The SVG path of the icon. * > **Known Limitations** This property is currently not 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-symbols-SimpleMarkerSymbol.html#path) */ path: string; /** * The size of the marker in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#size) - * + * * @default 12 */ size: number; /** - * The marker style. Possible values are in the table below. - * + * The marker style. Possible values are in the table below. + * > **Known Limitations** The `triangle` value is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Value | Description * ------|------------ * 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) + * triangle | ![sms_triangle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-triangle.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) - * + * * @default circle */ style: string; /** * For SimpleMarkerSymbol the type is always `simple-marker`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#type) */ readonly type: "simple-marker"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#clone) - * - * + * + * */ clone(): SimpleMarkerSymbol; } @@ -28674,11 +30728,11 @@ declare namespace __esri { interface SimpleMarkerSymbolConstructor { /** * SimpleMarkerSymbol is used for rendering 2D [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries with a simple shape and [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It may be filled with a solid [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) and have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline), which is defined with a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) */ - new(properties?: SimpleMarkerSymbolProperties): SimpleMarkerSymbol; + new (properties?: SimpleMarkerSymbolProperties): SimpleMarkerSymbol; fromJSON(json: any): SimpleMarkerSymbol; } @@ -28686,77 +30740,68 @@ declare namespace __esri { export const SimpleMarkerSymbol: SimpleMarkerSymbolConstructor; interface SimpleMarkerSymbolProperties extends MarkerSymbolProperties { - /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * > The `color` property does not apply to marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). Since these styles are wholly comprised of outlines, you must modify the [outline.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) property to set the color of symbols with those styles. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) - * - * @default [255, 255, 255, 0.25] - white, semitransparent - */ - color?: Color | number[] | string; /** * The outline of the marker symbol. The `color` property of this object directly modifies the overall color of marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) */ outline?: SimpleLineSymbolProperties; /** - * The SVG path of the icon. + * The SVG path of the icon. * > **Known Limitations** This property is currently not 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-symbols-SimpleMarkerSymbol.html#path) */ path?: string; /** * The size of the marker in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#size) - * + * * @default 12 */ size?: number | string; /** - * The marker style. Possible values are in the table below. - * + * The marker style. Possible values are in the table below. + * > **Known Limitations** The `triangle` value is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Value | Description * ------|------------ * 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) + * triangle | ![sms_triangle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-triangle.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) - * + * * @default circle */ style?: string; } - interface symbolsSupportJsonUtils { /** * Creates a new instance of an appropriate [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. When you create a [MarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) or [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html) from a JSON object, you may specify a property angle to rotate the symbol. Be aware that the angle in the JSON is different from [MarkerSymbol.angle](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#angle). The angle in the JSON follows the traditional ArcGIS specification and is rotated counter-clockwise, whereas the angle in the symbol is rotated clockwise. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-jsonUtils.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/symbol-objects.htm) for examples of the structure of various input JSON objects. - * + * */ fromJSON(json: any): Symbol; } export const symbolsSupportJsonUtils: symbolsSupportJsonUtils; - interface symbolPreview { /** * Generates a preview image of a given symbol that can be displayed in a custom widget or other DOM element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) - * + * * @param symbol The symbol for which to generate a preview image. * @param options Formatting options for the symbol preview image. * @param options.node The parent node to append to the symbol. @@ -28766,63 +30811,70 @@ declare namespace __esri { * @param options.scale Indicates whether to scale the symbol preview. * @param options.disableUpsampling Indicates whether to disable upsampling for raster images. * @param options.symbolConfig For "tall" symbols in portrait view, then the `tall` value should be used here. - * + * */ renderPreviewHTML(symbol: Symbol, options?: symbolPreviewRenderPreviewHTMLOptions): IPromise; } export const symbolPreview: symbolPreview; - export interface symbolPreviewRenderPreviewHTMLOptions extends Object { /** * The parent node to append to the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ node?: HTMLElement; /** * The size of the symbol preview in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ size?: number; /** * The maximum size of the symbol preview in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ maxSize?: number; /** * The opacity of the layer represented by the `symbol`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ opacity?: number; /** * Indicates whether to scale the symbol preview. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ scale?: boolean; /** * Indicates whether to disable upsampling for raster images. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ disableUpsampling?: boolean; /** * For "tall" symbols in portrait view, then the `tall` value should be used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ symbolConfig?: string; } interface Symbol extends Accessor, JSONSupport { + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#color) + * + * @default black + */ + color: Color; /** * The symbol type. **Possible values:** simple-marker | picture-marker | simple-line | cartographic-line-symbol | simple-fill | picture-fill | text | shield-label-symbol | point-3d | line-3d | polygon-3d | mesh-3d | label-3d - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#type) */ readonly type: string; @@ -28831,11 +30883,11 @@ 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). 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) */ - new(properties?: SymbolProperties): Symbol; + new (properties?: SymbolProperties): Symbol; fromJSON(json: any): Symbol; } @@ -28843,19 +30895,26 @@ declare namespace __esri { export const Symbol: SymbolConstructor; interface SymbolProperties { - + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#color) + * + * @default black + */ + color?: Color | number[] | string; } interface Symbol3D extends Symbol { /** * The origin of the style from which the symbol was originally referenced. A reference to the style origin can be either by styleName or by styleUrl (but not both). This information is part of the WebScene persistence model and may be used to understand where a symbol was originally sourced from. It does not affect actual appearance or rendering of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ styleOrigin: Symbol3DStyleOrigin; /** * A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) objects used to visualize the graphic or feature. Individual symbol layers may be autocast as objects and specified using the `type` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#symbolLayers) */ symbolLayers: Collection; @@ -28864,11 +30923,11 @@ declare namespace __esri { interface Symbol3DConstructor { /** * Symbol3D is the base class for all 3D symbols. It is used to render 2D [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and 3D mesh features in a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html). All 3D symbols must be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance; there is no support for 3D rendering in [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) */ - new(properties?: Symbol3DProperties): Symbol3D; + new (properties?: Symbol3DProperties): Symbol3D; fromJSON(json: any): Symbol3D; } @@ -28878,35 +30937,34 @@ declare namespace __esri { interface Symbol3DProperties extends SymbolProperties { /** * The origin of the style from which the symbol was originally referenced. A reference to the style origin can be either by styleName or by styleUrl (but not both). This information is part of the WebScene persistence model and may be used to understand where a symbol was originally sourced from. It does not affect actual appearance or rendering of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ styleOrigin?: Symbol3DStyleOrigin; /** * A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) objects used to visualize the graphic or feature. Individual symbol layers may be autocast as objects and specified using the `type` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#symbolLayers) */ symbolLayers?: CollectionProperties; } - export interface Symbol3DStyleOrigin extends Object { /** * a well-known esri-provided style, such as `EsriThematicShapesStyle` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ styleName?: string; /** * url to a style definition - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ styleUrl?: string; /** * name of the symbol in the style referenced by styleName or styleUrl - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ name: string; @@ -28915,13 +30973,13 @@ declare namespace __esri { interface Symbol3DLayer extends Accessor, JSONSupport { /** * The material used to shade the geometry. For `material` properties, see the documentation of the individual symbol layer classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#material) */ material: any; /** - * The 3D symbol layer type. See the table below for a list of possible values. - * + * The 3D symbol layer type. See the table below for a list of possible values. + * * Value | Description * ------|------------ * icon | ![s3d-icon](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-circle.png) @@ -28931,8 +30989,8 @@ declare namespace __esri { * 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) */ readonly type: string; @@ -28941,11 +30999,11 @@ declare namespace __esri { interface Symbol3DLayerConstructor { /** * Symbol layers are used to define the visualization of [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), and mesh geometries rendered with [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html). [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) may only be used to render features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), or standalone [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). There is no support for 3D symbols in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) */ - new(properties?: Symbol3DLayerProperties): Symbol3DLayer; + new (properties?: Symbol3DLayerProperties): Symbol3DLayer; fromJSON(json: any): Symbol3DLayer; } @@ -28955,7 +31013,7 @@ declare namespace __esri { interface Symbol3DLayerProperties { /** * The material used to shade the geometry. For `material` properties, see the documentation of the individual symbol layer classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#material) */ material?: any; @@ -28963,145 +31021,140 @@ declare namespace __esri { interface TextSymbol extends Symbol { /** - * The angle of the text. `0` is horizontal and the angle moves clockwise. + * The angle of the text. `0` is horizontal and the angle moves clockwise. * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#angle) - * + * * @default 0 */ angle: number; /** * The background color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#backgroundColor) */ backgroundColor: Color; /** * The border color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineColor) */ borderLineColor: Color; /** * The border size or width of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineSize) */ borderLineSize: number; /** - * The color of the text. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color) - */ - color: Color; - /** - * The font used to style the text. + * The font used to style the text. * > **Known Limitations** This property is not fully 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-symbols-TextSymbol.html#font) */ font: Font; /** - * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). - * > **Known Limitations** + * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). + * > **Known Limitations** * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) */ haloColor: Color; /** - * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). - * > **Known Limitations** + * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). + * > **Known Limitations** * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * + * * Halo size should not be 1/4 larger than the [text size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size). For example, if your text size is 12, the halo size should not be larger than 3. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) */ haloSize: number; /** - * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify + * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#horizontalAlignment) - * + * * @default center */ horizontalAlignment: string; /** * Determines whether to adjust the spacing between characters in the text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#kerning) - * + * * @default true */ kerning: boolean; /** - * Determines whether every character in the text string is rotated. + * Determines whether every character in the text string is rotated. * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#rotated) - * + * * @default false */ rotated: boolean; /** * The text string to display in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#text) */ text: string; /** * For TextSymbol, the type is always `text`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#type) */ readonly type: "text"; /** - * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom + * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#verticalAlignment) - * + * * @default baseline */ verticalAlignment: string; /** - * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#xoffset) - * + * * @default 0 */ xoffset: number; /** - * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#yoffset) - * + * * @default 0 */ yoffset: number; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#clone) - * - * + * + * */ clone(): TextSymbol; } interface TextSymbolConstructor { /** - * Text symbols are used to define the graphic for displaying labels on a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html), in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Text symbols can also be used to define the symbol property of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). With this class, you may alter the [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color), [font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font), [halo](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize), and other properties of the label graphic. - * + * Text symbols are used to define the graphic for displaying labels on a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Text symbols can also be used to define the symbol property of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) if the geometry type is [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). With this class, you may alter the [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color), [font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font), [halo](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize), and other properties of the label graphic. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) */ - new(properties?: TextSymbolProperties): TextSymbol; + new (properties?: TextSymbolProperties): TextSymbol; fromJSON(json: any): TextSymbol; } @@ -29110,117 +31163,112 @@ declare namespace __esri { interface TextSymbolProperties extends SymbolProperties { /** - * The angle of the text. `0` is horizontal and the angle moves clockwise. + * The angle of the text. `0` is horizontal and the angle moves clockwise. * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#angle) - * + * * @default 0 */ angle?: number; /** * The background color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#backgroundColor) */ backgroundColor?: Color | number[] | string; /** * The border color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineColor) */ borderLineColor?: Color | number[] | string; /** * The border size or width of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineSize) */ borderLineSize?: number; /** - * The color of the text. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color) - */ - color?: Color | number[] | string; - /** - * The font used to style the text. + * The font used to style the text. * > **Known Limitations** This property is not fully 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-symbols-TextSymbol.html#font) */ font?: FontProperties; /** - * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). - * > **Known Limitations** + * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). + * > **Known Limitations** * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) */ haloColor?: Color | number[] | string; /** - * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). - * > **Known Limitations** + * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). + * > **Known Limitations** * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * + * * Halo size should not be 1/4 larger than the [text size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size). For example, if your text size is 12, the halo size should not be larger than 3. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) */ haloSize?: number | string; /** - * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify + * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#horizontalAlignment) - * + * * @default center */ horizontalAlignment?: string; /** * Determines whether to adjust the spacing between characters in the text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#kerning) - * + * * @default true */ kerning?: boolean; /** - * Determines whether every character in the text string is rotated. + * Determines whether every character in the text string is rotated. * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#rotated) - * + * * @default false */ rotated?: boolean; /** * The text string to display in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#text) */ text?: string; /** - * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom + * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#verticalAlignment) - * + * * @default baseline */ verticalAlignment?: string; /** - * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#xoffset) - * + * * @default 0 */ xoffset?: number | string; /** - * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not 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-symbols-TextSymbol.html#yoffset) - * + * * @default 0 */ yoffset?: number | string; @@ -29229,43 +31277,43 @@ declare namespace __esri { interface TextSymbol3DLayer extends Symbol3DLayer { /** * The font of the text label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) */ font: Font; /** * The halo surrounding the text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) */ halo: TextSymbol3DLayerHalo; /** * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). When set, this property overrides the [font.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) - * + * * @default 9 */ size: number; /** * The text to be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#text) */ text: string; /** * For TextSymbol3DLayer the type is always `text`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#type) */ readonly type: "text"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#clone) - * - * + * + * */ clone(): TextSymbol3DLayer; } @@ -29273,11 +31321,11 @@ declare namespace __esri { interface TextSymbol3DLayerConstructor { /** * TextSymbol3DLayer is used to draw text labels for features of any geometry type. This is typically done by adding it to a [LabelSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) */ - new(properties?: TextSymbol3DLayerProperties): TextSymbol3DLayer; + new (properties?: TextSymbol3DLayerProperties): TextSymbol3DLayer; fromJSON(json: any): TextSymbol3DLayer; } @@ -29287,47 +31335,46 @@ declare namespace __esri { interface TextSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * The font of the text label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) */ font?: FontProperties; /** * The halo surrounding the text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) */ halo?: TextSymbol3DLayerHaloProperties; /** * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). When set, this property overrides the [font.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) - * + * * @default 9 */ size?: number | string; /** * The text to be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#text) */ text?: string; } - export interface TextSymbol3DLayerHaloProperties extends Object { /** * The color of the halo. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) - * + * * @default black */ color?: Color | number[] | string; /** * The size of the halo in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) - * + * * @default 0 */ size?: number | string; @@ -29336,17 +31383,17 @@ declare namespace __esri { export interface TextSymbol3DLayerHalo extends AnonymousAccessor { /** * The color of the halo. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) - * + * * @default black */ color?: Color; /** * The size of the halo in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) - * + * * @default 0 */ size?: number; @@ -29355,49 +31402,49 @@ declare namespace __esri { interface WebStyleSymbol extends Symbol { /** * The name of the symbol within the web style. Each symbol in a web style is identified by a unique name. Only [Esri-provided web style symbol names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#name) */ name: string; /** * The portal that contains the web style this symbol refers to. Only required when [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) is set. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) */ portal: Portal; /** * A registered web style name. Only [Esri-provided web style names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. Requires [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) property to be set. Can not be used in conjunction with [styleUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl). See class description for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) */ styleName: string; /** * URL that points to the web style definition. Cannot be used in conjunction with [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) and [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal). See class description for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl) */ styleUrl: string; /** * For WebStyleSymbol the type is always `web-style`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#type) */ readonly type: "web-style"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#clone) - * - * + * + * */ clone(): WebStyleSymbol; /** * Downloads and returns the [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) instance the WebStyleSymbol refers to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#fetchSymbol) - * - * + * + * */ fetchSymbol(): IPromise; } @@ -29405,11 +31452,11 @@ declare namespace __esri { interface WebStyleSymbolConstructor { /** * WebStyleSymbol is a class used to conveniently create realistic and thematic 3D symbols. It is a wrapper for creating [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) objects that point to a web style resource available in the API. This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html) */ - new(properties?: WebStyleSymbolProperties): WebStyleSymbol; + new (properties?: WebStyleSymbolProperties): WebStyleSymbol; fromJSON(json: any): WebStyleSymbol; } @@ -29419,39 +31466,253 @@ declare namespace __esri { interface WebStyleSymbolProperties extends SymbolProperties { /** * The name of the symbol within the web style. Each symbol in a web style is identified by a unique name. Only [Esri-provided web style symbol names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#name) */ name?: string; /** * The portal that contains the web style this symbol refers to. Only required when [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) is set. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) */ portal?: PortalProperties; /** * A registered web style name. Only [Esri-provided web style names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. Requires [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) property to be set. Can not be used in conjunction with [styleUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl). See class description for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) */ styleName?: string; /** * URL that points to the web style definition. Cannot be used in conjunction with [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) and [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal). See class description for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl) */ styleUrl?: string; } + /** + * ExtrudeSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#ExtrudeSymbol3DLayer) + */ + export type symbolsExtrudeSymbol3DLayer = ExtrudeSymbol3DLayer; + + /** + * FillSymbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#FillSymbol) + */ + export type symbolsFillSymbol = PictureFillSymbol | SimpleFillSymbol; + + /** + * FillSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#FillSymbol3DLayer) + */ + export type symbolsFillSymbol3DLayer = FillSymbol3DLayer; + + /** + * Font. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Font) + */ + export type symbolsFont = Font; + + /** + * IconSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#IconSymbol3DLayer) + */ + export type symbolsIconSymbol3DLayer = IconSymbol3DLayer; + + /** + * LabelSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LabelSymbol3D) + */ + export type symbolsLabelSymbol3D = LabelSymbol3D; + + /** + * LineSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LineSymbol3D) + */ + export type symbolsLineSymbol3D = LineSymbol3D; + + /** + * LineSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LineSymbol3DLayer) + */ + export type symbolsLineSymbol3DLayer = LineSymbol3DLayer; + + /** + * MarkerSymbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#MarkerSymbol) + */ + export type symbolsMarkerSymbol = PictureMarkerSymbol | SimpleMarkerSymbol; + + /** + * MeshSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#MeshSymbol3D) + */ + export type symbolsMeshSymbol3D = MeshSymbol3D; + + /** + * ObjectSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#ObjectSymbol3DLayer) + */ + export type symbolsObjectSymbol3DLayer = ObjectSymbol3DLayer; + + /** + * PathSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PathSymbol3DLayer) + */ + export type symbolsPathSymbol3DLayer = PathSymbol3DLayer; + + /** + * PictureFillSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PictureFillSymbol) + */ + export type symbolsPictureFillSymbol = PictureFillSymbol; + + /** + * PictureMarkerSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PictureMarkerSymbol) + */ + export type symbolsPictureMarkerSymbol = PictureMarkerSymbol; + + /** + * PointSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PointSymbol3D) + */ + export type symbolsPointSymbol3D = PointSymbol3D; + + /** + * PolygonSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PolygonSymbol3D) + */ + export type symbolsPolygonSymbol3D = PolygonSymbol3D; + + /** + * SimpleFillSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleFillSymbol) + */ + export type symbolsSimpleFillSymbol = SimpleFillSymbol; + + /** + * SimpleLineSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleLineSymbol) + */ + export type symbolsSimpleLineSymbol = SimpleLineSymbol; + + /** + * SimpleMarkerSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleMarkerSymbol) + */ + export type symbolsSimpleMarkerSymbol = SimpleMarkerSymbol; + + /** + * Symbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol) + */ + export type symbolsSymbol = Symbol2D | symbolsSymbol3D | WebStyleSymbol; + + /** + * Symbol2D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol2D) + */ + export type Symbol2D = + | PictureFillSymbol + | PictureMarkerSymbol + | SimpleFillSymbol + | SimpleLineSymbol + | SimpleMarkerSymbol + | TextSymbol; + + /** + * Symbol2D3D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol2D3D) + */ + export type Symbol2D3D = + | PictureFillSymbol + | PictureMarkerSymbol + | SimpleFillSymbol + | SimpleLineSymbol + | SimpleMarkerSymbol + | TextSymbol + | Symbol2D + | LabelSymbol3D + | LineSymbol3D + | MeshSymbol3D + | PointSymbol3D + | PolygonSymbol3D; + + /** + * Symbol3D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol3D) + */ + export type symbolsSymbol3D = LabelSymbol3D | LineSymbol3D | MeshSymbol3D | PointSymbol3D | PolygonSymbol3D; + + /** + * Symbol3DLayer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol3DLayer) + */ + export type symbolsSymbol3DLayer = + | ExtrudeSymbol3DLayer + | FillSymbol3DLayer + | IconSymbol3DLayer + | LineSymbol3DLayer + | ObjectSymbol3DLayer + | PathSymbol3DLayer + | TextSymbol3DLayer; + + /** + * TextSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#TextSymbol) + */ + export type symbolsTextSymbol = TextSymbol; + + /** + * TextSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#TextSymbol3DLayer) + */ + export type symbolsTextSymbol3DLayer = TextSymbol3DLayer; + + /** + * WebStyleSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#WebStyleSymbol) + */ + export type symbolsWebStyleSymbol = WebStyleSymbol; + interface ClosestFacilityTask extends Task { /** * Solves the closest facility. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html#solve) - * + * * @param params Defines the parameters of the closest facility analysis. * @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). - * + * */ solve(params: ClosestFacilityParameters, requestOptions?: any): IPromise; } @@ -29459,35 +31720,33 @@ declare namespace __esri { interface ClosestFacilityTaskConstructor { /** * Helps you find closest facilities around any location (incident) on a network. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html) */ - new(properties?: ClosestFacilityTaskProperties): ClosestFacilityTask; + new (properties?: ClosestFacilityTaskProperties): ClosestFacilityTask; } export const ClosestFacilityTask: ClosestFacilityTaskConstructor; - interface ClosestFacilityTaskProperties extends TaskProperties { - - } + interface ClosestFacilityTaskProperties extends TaskProperties {} interface FindTask extends Task { /** * The geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#gdbVersion) */ gdbVersion: string; /** * Sends a request to the ArcGIS REST map service resource to perform a search based on the input [params](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#execute) - * + * * @param params Specifies the layers and fields that are used for the search. * @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: FindParameters, requestOptions?: any): IPromise; } @@ -29495,11 +31754,11 @@ declare namespace __esri { interface FindTaskConstructor { /** * Search a map service exposed by the ArcGIS Server REST API based on a string value. The search can be conducted on a single field of a single layer, on many fields of a layer, or on many fields of many layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html) */ - new(properties?: FindTaskProperties): FindTask; + new (properties?: FindTaskProperties): FindTask; } export const FindTask: FindTaskConstructor; @@ -29507,7 +31766,7 @@ declare namespace __esri { interface FindTaskProperties extends TaskProperties { /** * The geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#gdbVersion) */ gdbVersion?: string; @@ -29516,198 +31775,198 @@ declare namespace __esri { interface GeometryService extends Task { /** * Computes the area and length for the input [polygons](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#areasAndLengths) - * + * * @param areasAndLengthsParameters Specify the input polygons and optionally the linear and area units. * @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). - * + * */ areasAndLengths(areasAndLengthsParameters: AreasAndLengthsParameters, requestOptions?: any): IPromise; /** * The Auto Complete operation is performed on a geometry service resource. The AutoComplete operation simplifies the process of constructing new polygons that are adjacent to other polygons. It constructs polygons that fill in the gaps between existing polygons and a set of polylines. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#autoComplete) - * + * * @param polygons The array of polygons that will provide boundaries for new polygons. * @param polylines An array of polylines that will provide the remaining boundaries for new polygons. * @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). - * + * */ autoComplete(polygons: Polygon[], polylines: Polyline[], requestOptions?: any): IPromise; /** * Creates buffer polygons at a specified distance around the given geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer) - * + * * @param bufferParameters Specifies the input geometries, buffer distances, and other options. * @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). - * + * */ buffer(bufferParameters: BufferParameters, requestOptions?: any): IPromise; /** * The convexHull operation is performed on a geometry service resource. It returns the convex hull of the input geometry. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#convexHull) - * + * * @param geometries The geometries whose convex hull is to be created. * @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). - * + * */ convexHull(geometries: Geometry[], requestOptions?: any): IPromise; /** * The cut operation is performed on a geometry service resource. This operation splits the input polyline or polygon where it crosses a cutting polyline. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#cut) - * + * * @param geometries The polylines or polygons to be cut. * @param cutter The polyline that will be used to divide the target into pieces where it crosses the target. * @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). - * + * */ cut(geometries: Geometry[], cutter: Polyline, requestOptions?: any): IPromise; /** * The densify operation is performed on a geometry service resource. This operation densifies geometries by plotting points between existing vertices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#densify) - * + * * @param densifyParameters The DensifyParameters objects contains `geometries`, `geodesic`, `lengthUnit`, and `maxSegmentLength` properties. * @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). - * + * */ densify(densifyParameters: DensifyParameters, requestOptions?: any): IPromise; /** * The difference operation is performed on a geometry service resource. This operation constructs the set-theoretic difference between an array of geometries and another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#difference) - * + * * @param geometries An array of points, multipoints, polylines or polygons. * @param geometry A single geometry of any type, with a dimension equal to or greater than the items in geometries. * @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). - * + * */ difference(geometries: Geometry[], geometry: Geometry, requestOptions?: any): IPromise; /** * Measures the planar or geodesic distance between geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#distance) - * + * * @param params Sets the input geometries to measure, distance units, and other parameters. * @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). - * + * */ distance(params: DistanceParameters, requestOptions?: any): IPromise; /** * Converts an array of well-known strings into xy-coordinates based on the conversion type and spatial reference supplied by the user. Only available with ArcGIS Server 10.3 or above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) - * + * * @param params See the object specifications table below for the structure of the `params` object. * @param params.strings An array of formatted strings as specified by `conversionType`. Example: `["01N AA 66021 00000" , "11S NT 00000 62155" , "31U BT 94071 65288"]` * @param params.sr The spatial reference or well-known ID to convert the input string coordinates to. * @param params.conversionType The conversion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd * @param params.conversionMode Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for possible values and their descriptions. * @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). - * + * */ fromGeoCoordinateString(params: GeometryServiceFromGeoCoordinateStringParams, requestOptions?: any): IPromise; /** * Generalizes the input geometries using the Douglas-Peucker algorithm. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#generalize) - * + * * @param params An array of geometries to generalize and a maximum deviation. Optionally set the deviation units. * @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). - * + * */ generalize(params: GeneralizeParameters, requestOptions?: any): IPromise; /** * The intersect operation is performed on a geometry service resource. This operation constructs the set-theoretic intersection between an array of geometries and another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#intersect) - * + * * @param geometries An array of points, multipoints, polylines, or polygons. * @param intersector A single geometry of any type, of dimension equal to or greater than the dimension of the items in `geometries`. * @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). - * + * */ intersect(geometries: Geometry[], intersector: Geometry, requestOptions?: any): IPromise; /** * Calculates an interior point for each polygon specified. These interior points can be used by clients for labeling the polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#labelPoints) - * + * * @param polygons The polygon graphics to process. * @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). - * + * */ labelPoints(polygons: Polygon[], requestOptions?: any): IPromise; /** * Gets the lengths for a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) when the geometry type is [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#lengths) - * + * * @param params Specify the polylines and optionally the length unit and the geodesic length option. * @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). - * + * */ lengths(params: LengthsParameters, requestOptions?: any): IPromise; /** * Constructs the offset of the input geometries based on a planar distance. If the offsetDistance is positive the constructed offset will be on the right side of the geometry. Left side offsets are constructed with negative values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#offset) - * + * * @param params Set the geometries to offset, distance, and units. * @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). - * + * */ offset(params: OffsetParameters, requestOptions?: any): IPromise; /** * Projects a set of geometries to a new spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#project) - * + * * @param params The input projection parameters. * @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). - * + * */ project(params: ProjectParameters, requestOptions?: any): IPromise; /** * Computes the set of pairs of geometries from the input geometry arrays that belong to the specified relation. Both arrays are assumed to be in the same spatial reference. The relations are evaluated in 2D. Z-coordinates are not used. Geometry types cannot be mixed within an array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#relation) - * + * * @param params The set of parameters required to perform the comparison. * @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). - * + * */ relation(params: RelationParameters, requestOptions?: any): IPromise; /** * The reshape operation is performed on a geometry service resource. It reshapes a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or a part of a [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) using a reshaping line. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#reshape) - * + * * @param targetGeometry The Polyline or Polygon to be reshaped. * @param reshaper The single-part polyline that performs the reshaping. * @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). - * + * */ reshape(targetGeometry: Geometry, reshaper: Geometry, requestOptions?: any): IPromise; /** * Alters the given geometries to make their definitions topologically legal with respect to their geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#simplify) - * + * * @param geometries The geometries to simplify. * @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). - * + * */ simplify(geometries: Geometry[], requestOptions?: any): IPromise; /** * Converts an array of XY-coordinates into well-known strings based on the conversion type and spatial reference supplied by the user. Only available with ArcGIS Server 10.3 or above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) - * + * * @param params See the object specifications table below for the structure of the `params` object. * @param params.sr The spatial reference (or WKID of the spatial reference) of the XY-coordinates to be converted. * @param params.coordinates An array of XY-coordinates (in JSON format) to be converted. @@ -29717,27 +31976,27 @@ declare namespace __esri { * @param params.rounding If `true`, then numeric portions of the string are rounded to the nearest whole magnitude as specified by `numOfDigits`. Otherwise, numeric portions of the string are truncated. The rounding parameter applies only to conversion types `mgrs`, `usng` and `geo-ref`. * @param params.addSpaces If `true`, then spaces are added between components of the string. The `addSpaces` parameter applies only to conversion types `mgrs`, `usng` and `utm`. The default value for `mgrs` is `false` , while the default value for both `usng` and `utm` is `true`. * @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). - * + * */ toGeoCoordinateString(params: GeometryServiceToGeoCoordinateStringParams, requestOptions?: any): IPromise; /** * Trims or extends the input polylines using the user specified guide polyline. When trimming features, the portion to the left of the cutting line is preserved in the output and the rest is discarded. If the input polyline is not cut or extended then an empty polyline is added to the output array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#trimExtend) - * + * * @param params Input parameters for the `trimExtend` operation. * @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). - * + * */ trimExtend(params: TrimExtendParameters, requestOptions?: any): IPromise; /** * The union operation is performed on a geometry service resource. This operation constructs the set-theoretic union of the geometries in the input array. All inputs must be of the same type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#union) - * + * * @param geometries An array of the geometries to be unioned. * @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). - * + * */ union(geometries: Geometry[], requestOptions?: any): IPromise; } @@ -29745,92 +32004,88 @@ declare namespace __esri { interface GeometryServiceConstructor { /** * Represents a geometry service resource exposed by the ArcGIS REST API. It is used to perform various operations on geometries such as project, simplify, buffer, and relationships. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html) */ - new(properties?: GeometryServiceProperties): GeometryService; + new (properties?: GeometryServiceProperties): GeometryService; } export const GeometryService: GeometryServiceConstructor; - interface GeometryServiceProperties extends TaskProperties { - - } - + interface GeometryServiceProperties extends TaskProperties {} export interface GeometryServiceFromGeoCoordinateStringParams extends Object { /** * An array of formatted strings as specified by `conversionType`. Example: `["01N AA 66021 00000" , "11S NT 00000 62155" , "31U BT 94071 65288"]` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ strings: string[]; /** * The spatial reference or well-known ID to convert the input string coordinates to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ sr: SpatialReference | string | number; /** * The conversion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) - * + * * @default mrgs */ conversionType?: string; /** * Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for possible values and their descriptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ conversionMode?: string; } - export interface GeometryServiceToGeoCoordinateStringParams extends Object { /** * The spatial reference (or WKID of the spatial reference) of the XY-coordinates to be converted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ sr: SpatialReference | string | number; /** * An array of XY-coordinates (in JSON format) to be converted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ coordinates: number[][]; /** * The conversion type of the input strings. **Possible values:** mgrs | usng | utm | geo-ref | gars | dms | ddm | dd - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ conversionType: string; /** * Conversion options for mgrs and utm conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/to-geocoordinatestring.htm) for valid conversion modes and their descriptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ conversionMode?: string; /** * The number of digits to output for each of the numerical portions in the string. The default value depends of `conversionType`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for default values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ numOfDigits?: number; /** * If `true`, then numeric portions of the string are rounded to the nearest whole magnitude as specified by `numOfDigits`. Otherwise, numeric portions of the string are truncated. The rounding parameter applies only to conversion types `mgrs`, `usng` and `geo-ref`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) - * + * * @default true */ rounding?: boolean; /** * If `true`, then spaces are added between components of the string. The `addSpaces` parameter applies only to conversion types `mgrs`, `usng` and `utm`. The default value for `mgrs` is `false` , while the default value for both `usng` and `utm` is `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ addSpaces?: boolean; @@ -29839,136 +32094,139 @@ declare namespace __esri { interface Geoprocessor extends Task { /** * The spatial reference of the output geometries. If not specified, the output geometries will be in the spatial reference of the input geometries. If [processSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) is specified and `outSpatialReference` is not specified, the output geometries will be in the spatial reference of the process spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * The spatial reference that the model will use to perform geometry operations. If `processSpatialReference` is specified and [outputSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outputSpatialReference) is not specified, the output geometries will be in the spatial reference of the process spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) */ processSpatialReference: SpatialReference; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#updateDelay) - * + * * @default 1000 */ updateDelay: number; /** * Cancels an asynchronous geoprocessing job. Requires an ArcGIS Server 10.1 service or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#cancelJob) - * + * * @param jobId A string that uniquely identifies a job on the server. It is created when a job is submitted for execution and later used to check its status and retrieve the results. * @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). - * + * */ cancelJob(jobId: string, requestOptions?: any): IPromise; /** * Cancels the periodic job status updates automatically initiated when [submitJob()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#submitJob) is invoked for the job identified by `jobId`. You can still obtain the status of this job by calling the [checkJobStatus()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#checkJobStatus) method at your own discretion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#cancelJobStatusUpdates) - * + * * @param jobId A string that uniquely identifies the job for which the job updates are cancelled. - * + * */ cancelJobStatusUpdates(jobId: string): void; /** * Sends a request to the GP Task for the current state of the job identified by `jobId`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#checkJobStatus) - * + * * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). * @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). - * + * */ checkJobStatus(jobId: string, requestOptions?: any): IPromise; /** * Sends a request to the server to execute a synchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#execute) - * + * * @param params ``` * Specifies the input parameters accepted by the task and their corresponding values. These input parameters are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task resource has the following input parameters: * * `` Input_Points * * `` Distance - * - * - * The `params` argument would then be an Object of the form: + * + * + * The `params` argument would then be an Object of the form: * ``` * { * Input_Points: , * Distance: * } - * + * * @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: any, requestOptions?: any): IPromise; /** * Sends a request to the GP Task to get the task result identified by `jobId` and `resultName`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultData) - * + * * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). * @param resultName The name of the result parameter as defined in Services Directory. * @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). - * + * */ getResultData(jobId: string, resultName: string, requestOptions?: any): IPromise; /** * Sends a request to the GP Task to get the task result identified by `jobId` and `resultName` as an image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultImage) - * + * * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). * @param resultName The name of the result parameter as defined in the Services Directory. * @param imageParams Specifies the properties of the result image. * @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). - * + * */ - getResultImage(jobId: string, resultName: string, imageParams: ImageParameters, requestOptions?: any): IPromise; + getResultImage( + jobId: string, + resultName: string, + imageParams: ImageParameters, + requestOptions?: any + ): IPromise; /** * Get the task result identified by `jobId` as an [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). This method supports MapImageLayer 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultMapImageLayer) - * + * * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). - * + * */ getResultMapImageLayer(jobId: string): MapImageLayer; /** * Submits a job to the server for asynchronous processing by the GP task. The task execution results can be retrieved using the [getResultData()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultData), [getResultImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultImage), or [getResultMapImageLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultMapImageLayer) methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#submitJob) - * + * * @param params ``` * specifies the input parameters accepted by the task and their corresponding values. These input parameters are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task resource has the following input parameters: * * `` Input_Points * * `` Distance - * - * - * The `params` argument would then be an Object of the form: + * + * + * The `params` argument would then be an Object of the form: * ``` * { * Input_Points: , * Distance: * } - * + * * @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). - * + * */ submitJob(params: any, requestOptions?: any): IPromise; } interface GeoprocessorConstructor { - - - new(properties?: GeoprocessorProperties): Geoprocessor; + new (properties?: GeoprocessorProperties): Geoprocessor; } export const Geoprocessor: GeoprocessorConstructor; @@ -29976,21 +32234,21 @@ declare namespace __esri { interface GeoprocessorProperties extends TaskProperties { /** * The spatial reference of the output geometries. If not specified, the output geometries will be in the spatial reference of the input geometries. If [processSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) is specified and `outSpatialReference` is not specified, the output geometries will be in the spatial reference of the process spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * The spatial reference that the model will use to perform geometry operations. If `processSpatialReference` is specified and [outputSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outputSpatialReference) is not specified, the output geometries will be in the spatial reference of the process spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) */ processSpatialReference?: SpatialReferenceProperties; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#updateDelay) - * + * * @default 1000 */ updateDelay?: number; @@ -29999,19 +32257,19 @@ declare namespace __esri { interface IdentifyTask extends Task { /** * Specifies the geodatabase version to display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#gdbVersion) */ gdbVersion: string; /** * Sends a request to the ArcGIS REST map service resource to identify features based on the [IdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html) specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#execute) - * + * * @param params Specifies the criteria used to identify the features. * @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: IdentifyParameters, requestOptions?: any): IPromise; } @@ -30019,11 +32277,11 @@ declare namespace __esri { interface IdentifyTaskConstructor { /** * Performs an identify operation on the layers of a map service exposed by the ArcGIS Server REST API. Use [IdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html) to set the parameters for the identify operation and [IdentifyResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html) to work with the results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html) */ - new(properties?: IdentifyTaskProperties): IdentifyTask; + new (properties?: IdentifyTaskProperties): IdentifyTask; } export const IdentifyTask: IdentifyTaskConstructor; @@ -30031,7 +32289,7 @@ declare namespace __esri { interface IdentifyTaskProperties extends TaskProperties { /** * Specifies the geodatabase version to display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#gdbVersion) */ gdbVersion?: string; @@ -30040,53 +32298,49 @@ declare namespace __esri { interface ImageServiceIdentifyTask extends Task { /** * Sends a request to the ArcGIS REST image service resource to identify content based on the [ImageServiceIdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html) specified in the `params` argument. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ImageServiceIdentifyTask.html#execute) - * + * * @param params Specifies the criteria used to identify the features. * @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: ImageServiceIdentifyParameters, requestOptions?: any): IPromise; } interface ImageServiceIdentifyTaskConstructor { - - - new(properties?: ImageServiceIdentifyTaskProperties): ImageServiceIdentifyTask; + new (properties?: ImageServiceIdentifyTaskProperties): ImageServiceIdentifyTask; } export const ImageServiceIdentifyTask: ImageServiceIdentifyTaskConstructor; - interface ImageServiceIdentifyTaskProperties extends TaskProperties { - - } + interface ImageServiceIdentifyTaskProperties extends TaskProperties {} interface Locator extends Task { /** * Limit 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-tasks-Locator.html#categories) */ categories: string[]; /** * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See 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-tasks-Locator.html#countryCode) */ countryCode: string; /** * The spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of the input geometries when performing a reverse geocode and in the default spatial reference returned by the service if finding locations by address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * Find address candidates for multiple input addresses. This method requires an ArcGIS Server 10.1 or greater geocode service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) - * + * * @param params See specifications below. * @param params.addresses ``` * The input addresses in the format supported by the geocode service. If the service supports 'Single Line Input' the input addresses will be in the following format: @@ -30098,17 +32352,17 @@ declare namespace __esri { * @param params.countryCode Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. * @param params.categories Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. * @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). - * + * */ addressesToLocations(params: LocatorAddressesToLocationsParams, requestOptions?: any): IPromise; /** * Sends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) - * + * * @param params Specify at least the address and optionally other properties. See the object specifications table below. * @param params.address visit the ArcGIS Online Geocoding Service help for more details on the World Geocoder. - * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: + * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: * ```js * { * Street: "1234 W Main St", @@ -30116,16 +32370,16 @@ declare namespace __esri { * State: "WA", * Zone: "99027" * } - * + * * ``` - * + * * Locators published using ArcGIS 10 or later support a single line address field, which * can be specified using the following syntax where field_name is the name of the single * line address field. You can find this name by viewing the help or services directory for * your locator services. Common values are *SingleLine* and *SingleLineFieldName*: - * + * * ```js - * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; + * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; * ``` * The Services Directory can be used to find out the required and optional address fields * and the correct names for the input name fields. If you are using the World Geocoding Service @@ -30139,32 +32393,32 @@ declare namespace __esri { * @param params.outFields The list of fields included in the returned result set. This list is a comma delimited list of field names. If you specify the shape field in the list of return fields, it is ignored. For non-intersection addresses you can specify the candidate fields as defined in the geocode service. For intersection addresses you can specify the intersection candidate fields. * @param params.searchExtent Defines the extent within which the geocode server will search. Requires ArcGIS Server version 10.1 or greater. * @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). - * + * */ addressToLocations(params: LocatorAddressToLocationsParams, requestOptions?: any): IPromise; /** * Locates an address based on a given point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#locationToAddress) - * + * * @param location The point at which to search for the closest address. The location should be in the same spatial reference as that of the geocode service. * @param distance The distance in meters from the given location within which a matching address should be searched. If this parameter is not provided or an invalid value is provided, a default value of 0 meters 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 (will override requestOptions defined during construction). - * + * */ locationToAddress(location: Point, distance?: number, requestOptions?: any): IPromise; /** * Get character by character auto complete suggestions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) - * + * * @param params An object that defines suggest parameters. See specifications below. * @param params.categories A place or address type which can be used to filter suggest results. The parameter supports input of single category values or multiple comma-separated values. * @param params.distance Used with the `location` property. The `distance` property specifies the radial distance from the location. * @param params.location Defines a normalized location point that is used with the distance parameter to sort geocoding candidates based upon their proximity to the given location. * @param params.text The input text entered by a user which is used by the suggest operation to generate a list of possible matches. * @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). - * + * */ suggestLocations(params: LocatorSuggestLocationsParams, requestOptions?: any): IPromise; } @@ -30172,11 +32426,11 @@ declare namespace __esri { interface LocatorConstructor { /** * Represents a geocode service resource exposed by the ArcGIS Server REST API. It is used to generate candidates for an address. It is also used to generate batch results for a set of addresses. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) */ - new(properties?: LocatorProperties): Locator; + new (properties?: LocatorProperties): Locator; } export const Locator: LocatorConstructor; @@ -30184,25 +32438,24 @@ declare namespace __esri { interface LocatorProperties extends TaskProperties { /** * Limit 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-tasks-Locator.html#categories) */ categories?: string[]; /** * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See 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-tasks-Locator.html#countryCode) */ countryCode?: string; /** * The spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of the input geometries when performing a reverse geocode and in the default spatial reference returned by the service if finding locations by address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; } - export interface LocatorAddressesToLocationsParams extends Object { /** * The input addresses in the format supported by the geocode service. If the service supports 'Single Line Input' the input addresses will be in the following format: @@ -30212,28 +32465,27 @@ declare namespace __esri { * "Single Line Input":"440 Arguello Blvd, 94118" * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) */ addresses: any[]; /** * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See 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-tasks-Locator.html#addressesToLocations) */ countryCode: string; /** * Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) */ categories: string[]; } - export interface LocatorAddressToLocationsParams extends Object { /** - * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: + * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: * ```js * { * Street: "1234 W Main St", @@ -30241,103 +32493,102 @@ declare namespace __esri { * State: "WA", * Zone: "99027" * } - * + * * ``` - * + * * Locators published using ArcGIS 10 or later support a single line address field, which * can be specified using the following syntax where field_name is the name of the single * line address field. You can find this name by viewing the help or services directory for * your locator services. Common values are *SingleLine* and *SingleLineFieldName*: - * + * * ```js - * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; + * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; * ``` * The Services Directory can be used to find out the required and optional address fields * and the correct names for the input name fields. If you are using the World Geocoding Service * visit the ArcGIS Online Geocoding Service help for more details on the World Geocoder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ address: any; /** * Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ categories: string[]; /** * Limit result to a specific country. For example, "US" for United States or "SE" for Sweden. Only applies to the World Geocode Service. See Geocode coverage (World Geocoding Service) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ countryCode: string; /** * Used in combination with `location` option to weight returned results within this distance (meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ distance: number; /** * Allows the results of single geocode transactions to be persisted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ forStorage: boolean; /** * Used in combination with `distance` option to weight returned results for a specified area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ location: Point; /** * A `suggestLocations` result ID (magicKey). Used to query for a specific results information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ magicKey: string; /** * Maximum results to return from the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ maxLocations: number; /** * The list of fields included in the returned result set. This list is a comma delimited list of field names. If you specify the shape field in the list of return fields, it is ignored. For non-intersection addresses you can specify the candidate fields as defined in the geocode service. For intersection addresses you can specify the intersection candidate fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ outFields: string[]; /** * Defines the extent within which the geocode server will search. Requires ArcGIS Server version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ searchExtent: Extent; } - export interface LocatorSuggestLocationsParams extends Object { /** * A place or address type which can be used to filter suggest results. The parameter supports input of single category values or multiple comma-separated values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) */ categories: string[]; /** * Used with the `location` property. The `distance` property specifies the radial distance from the location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) */ distance: number; /** * Defines a normalized location point that is used with the distance parameter to sort geocoding candidates based upon their proximity to the given location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) */ location: Point; /** * The input text entered by a user which is used by the suggest operation to generate a list of possible matches. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) */ text: string; @@ -30345,25 +32596,25 @@ declare namespace __esri { /** * Describes the object representing the result of the [suggestLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) */ export interface SuggestionResult extends Object { /** * Indicates if the result is a Collection. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) */ isCollection: boolean; /** * ID used in combination with the `text` property to uniquely identify a suggestion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) */ magicKey: string; /** * The string name of the suggested location to geocode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) */ text: string; @@ -30372,29 +32623,29 @@ declare namespace __esri { interface PrintTask extends Task { /** * The mode for the print task execution. **Possible Values:** async | sync - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#mode) - * + * * @default sync */ readonly mode: string; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#updateDelay) - * + * * @default 1000 */ updateDelay: number; /** * 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) - * + * * @param params Defines the printing options. * @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; } @@ -30402,11 +32653,11 @@ declare namespace __esri { interface PrintTaskConstructor { /** * The PrintTask generates a printer-ready version of the map using an [Export Web Map Task](https://developers.arcgis.com/rest/services-reference/export-web-map-task.htm) available with ArGIS Server 10.1 and later. This class is used when you want to have more granular control over the user interface, for example, if you want to provide users the ability to define what appears on the printed page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html) */ - new(properties?: PrintTaskProperties): PrintTask; + new (properties?: PrintTaskProperties): PrintTask; } export const PrintTask: PrintTaskConstructor; @@ -30414,23 +32665,23 @@ declare namespace __esri { interface PrintTaskProperties extends TaskProperties { /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#updateDelay) - * + * * @default 1000 */ updateDelay?: number; } /** - * Represents the reponse of the [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#execute) method. - * + * Represents the response 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; @@ -30439,81 +32690,87 @@ declare namespace __esri { interface QueryTask extends Task { /** * 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 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) - * + * * @param query Specifies the attributes and spatial filter of the 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). - * + * */ execute(query: Query | QueryProperties, requestOptions?: any): IPromise; /** - * 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). - * + * 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's [capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to false. + * * [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; + 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) - * + * * @param query Specifies the attributes and spatial filter of the 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). - * + * */ 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. 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) - * + * * @param params Specifies the attributes and spatial filter of the 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). - * + * */ executeForExtent(params: Query, requestOptions?: any): IPromise; /** * 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) - * + * * @param query Specifies the attributes and spatial filter of the 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). - * + * */ executeForIds(query: Query | QueryProperties, requestOptions?: any): IPromise; /** * 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 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). - * + * */ - executeRelationshipQuery(relationshipQuery: RelationshipQuery | RelationshipQueryProperties, requestOptions?: any): IPromise; + executeRelationshipQuery( + relationshipQuery: RelationshipQuery | RelationshipQueryProperties, + requestOptions?: any + ): IPromise; } interface QueryTaskConstructor { /** * 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) */ - new(properties?: QueryTaskProperties): QueryTask; + new (properties?: QueryTaskProperties): QueryTask; } export const QueryTask: QueryTaskConstructor; @@ -30521,7 +32778,7 @@ declare namespace __esri { interface QueryTaskProperties extends TaskProperties { /** * 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; @@ -30529,43 +32786,43 @@ declare namespace __esri { /** * 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 { + export interface QueryTaskAttachmentInfo 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; @@ -30574,12 +32831,12 @@ declare namespace __esri { interface RouteTask extends Task { /** * Solves the route against the route layer with the route parameters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html#solve) - * + * * @param params Route parameters used as input to generate the route. * @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). - * + * */ solve(params: RouteParameters, requestOptions?: any): IPromise; } @@ -30587,28 +32844,26 @@ declare namespace __esri { interface RouteTaskConstructor { /** * Find routes between two or more locations and optionally get driving directions. The RouteTask uses ArcGIS Server network analysis services to calculate routes. Network analysis services allow you to solve simple routing problems as well as complex ones that take into account multiple stops, barriers, and time windows. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) */ - new(properties?: RouteTaskProperties): RouteTask; + new (properties?: RouteTaskProperties): RouteTask; } export const RouteTask: RouteTaskConstructor; - interface RouteTaskProperties extends TaskProperties { - - } + interface RouteTaskProperties extends TaskProperties {} interface ServiceAreaTask extends Task { /** * Determines the service area based on a set of parameters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html#solve) - * + * * @param params The parameters needed to define the service area. * @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). - * + * */ solve(params: ServiceAreaParameters, requestOptions?: any): IPromise; } @@ -30616,56 +32871,52 @@ declare namespace __esri { interface ServiceAreaTaskConstructor { /** * ServiceAreaTask helps you find service areas around any location on a network. A network service area is a region that encompasses all accessible streets (streets that are within a specified impedance). For instance, the 5-minute service area for a point includes all the streets that can be reached within five minutes from that point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html) */ - new(properties?: ServiceAreaTaskProperties): ServiceAreaTask; + new (properties?: ServiceAreaTaskProperties): ServiceAreaTask; } export const ServiceAreaTask: ServiceAreaTaskConstructor; - interface ServiceAreaTaskProperties extends TaskProperties { - - } + interface ServiceAreaTaskProperties extends TaskProperties {} interface AddressCandidate extends Accessor, JSONSupport { /** * Address of the candidate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address) */ address: string; /** * Name value pairs of field name and field value as defined in `outFields` in [Locator.addressToLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#attributes) */ attributes: any; /** * The minimum and maximum X and Y coordinates of a bounding box of the address candidate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#extent) */ extent: Extent; /** * The [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object representing the location of the [address](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#location) */ location: Point; /** * Numeric score between `0` and `100` for geocode candidates. A candidate with a score of `100` means a perfect match, and `0` means no match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#score) */ score: number; } interface AddressCandidateConstructor { - - - new(properties?: AddressCandidateProperties): AddressCandidate; + new (properties?: AddressCandidateProperties): AddressCandidate; fromJSON(json: any): AddressCandidate; } @@ -30675,31 +32926,31 @@ declare namespace __esri { interface AddressCandidateProperties { /** * Address of the candidate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address) */ address?: string; /** * Name value pairs of field name and field value as defined in `outFields` in [Locator.addressToLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#attributes) */ attributes?: any; /** * The minimum and maximum X and Y coordinates of a bounding box of the address candidate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#extent) */ extent?: ExtentProperties; /** * The [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object representing the location of the [address](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#location) */ location?: PointProperties; /** * Numeric score between `0` and `100` for geocode candidates. A candidate with a score of `100` means a perfect match, and `0` means no match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#score) */ score?: number; @@ -30708,50 +32959,48 @@ declare namespace __esri { interface AreasAndLengthsParameters extends Accessor { /** * The area unit in which areas of polygons will be calculated. Use the strings listed below or [any other valid area unit](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | hectares | square-miles | square-kilometers | square-meters | square-feet | square-yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#areaUnit) */ areaUnit: string; /** - * Defines the type of calculation for the geometry. The type can be one of the following: - * + * Defines the type of calculation for the geometry. The type can be one of the following: + * * Value | Description * ------|------------ * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference. Otherwise use `preserveShape`. * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid (for geometries defined in a projected or geographic coordinate system). This method preserves the shape of the geometry in its coordinate system, which means the true area or length will be calculated for the geometry that is displayed on the map. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#calculationType) */ calculationType: string; /** * The length unit in which perimeters of polygons will be calculated. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#lengthUnit) */ lengthUnit: string; /** * Polygon geometries for which to compute areas and lengths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#polygons) */ polygons: Polygon[]; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface AreasAndLengthsParametersConstructor { - - - new(properties?: AreasAndLengthsParametersProperties): AreasAndLengthsParameters; + new (properties?: AreasAndLengthsParametersProperties): AreasAndLengthsParameters; } export const AreasAndLengthsParameters: AreasAndLengthsParametersConstructor; @@ -30759,32 +33008,32 @@ declare namespace __esri { interface AreasAndLengthsParametersProperties { /** * The area unit in which areas of polygons will be calculated. Use the strings listed below or [any other valid area unit](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | hectares | square-miles | square-kilometers | square-meters | square-feet | square-yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#areaUnit) */ areaUnit?: string; /** - * Defines the type of calculation for the geometry. The type can be one of the following: - * + * Defines the type of calculation for the geometry. The type can be one of the following: + * * Value | Description * ------|------------ * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference. Otherwise use `preserveShape`. * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid (for geometries defined in a projected or geographic coordinate system). This method preserves the shape of the geometry in its coordinate system, which means the true area or length will be calculated for the geometry that is displayed on the map. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#calculationType) */ calculationType?: string; /** * The length unit in which perimeters of polygons will be calculated. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#lengthUnit) */ lengthUnit?: string; /** * Polygon geometries for which to compute areas and lengths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#polygons) */ polygons?: PolygonProperties[]; @@ -30793,53 +33042,53 @@ declare namespace __esri { 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; } @@ -30847,11 +33096,11 @@ declare namespace __esri { 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; + new (properties?: AttachmentQueryProperties): AttachmentQuery; fromJSON(json: any): AttachmentQuery; } @@ -30861,43 +33110,43 @@ declare namespace __esri { 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; @@ -30906,61 +33155,59 @@ declare namespace __esri { 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#bufferSpatialReference) */ bufferSpatialReference: SpatialReference; /** * The distances the input features are buffered. The distance units are specified by `unit`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#distances) */ distances: number[]; /** * If the input geometries are in a geographic coordinate system, set geodesic to `true` to generate a buffer polygon using a geodesic distance. The `bufferSpatialReference` property is ignored when geodesic is set to `true`. Requires ArcGIS Server 10.1 or greater geometry service. For more information, see the ArcGIS REST API documentation on the GeometryService buffer operation and the geodesic property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geodesic) */ geodesic: boolean; /** * The input geometries to buffer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geometries) */ geometries: Geometry[]; /** * The spatial reference for the returned geometries. If `outSpatialReference` is not specified, the output geometries are in the spatial reference specified by `bufferSpatialReference`. If `bufferSpatialReference` also is not specified, they are in the spatial reference of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * If `true`, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unionResults) */ unionResults: boolean; /** * The units for calculating each buffer distance. If `unit` is not specified, the units are derived from `bufferSpatialReference`. If `bufferSpatialReference` is not specified, the units are derived from the features. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unit) */ unit: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface BufferParametersConstructor { - - - new(properties?: BufferParametersProperties): BufferParameters; + new (properties?: BufferParametersProperties): BufferParameters; } export const BufferParameters: BufferParametersConstructor; @@ -30968,43 +33215,43 @@ declare namespace __esri { interface BufferParametersProperties { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#bufferSpatialReference) */ bufferSpatialReference?: SpatialReferenceProperties; /** * The distances the input features are buffered. The distance units are specified by `unit`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#distances) */ distances?: number[]; /** * If the input geometries are in a geographic coordinate system, set geodesic to `true` to generate a buffer polygon using a geodesic distance. The `bufferSpatialReference` property is ignored when geodesic is set to `true`. Requires ArcGIS Server 10.1 or greater geometry service. For more information, see the ArcGIS REST API documentation on the GeometryService buffer operation and the geodesic property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geodesic) */ geodesic?: boolean; /** * The input geometries to buffer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * The spatial reference for the returned geometries. If `outSpatialReference` is not specified, the output geometries are in the spatial reference specified by `bufferSpatialReference`. If `bufferSpatialReference` also is not specified, they are in the spatial reference of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * If `true`, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unionResults) */ unionResults?: boolean; /** * The units for calculating each buffer distance. If `unit` is not specified, the units are derived from `bufferSpatialReference`. If `bufferSpatialReference` is not specified, the units are derived from the features. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unit) */ unit?: string; @@ -31013,241 +33260,247 @@ declare namespace __esri { interface ClosestFacilityParameters extends Accessor { /** * The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#accumulateAttributes) */ accumulateAttributes: string[]; /** * An array of attribute parameter values that determine which network elements can be used by a vehicle. View the object specifications below for properties of the individual objects in this array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ attributeParameterValues: ClosestFacilityParametersAttributeParameterValues[]; /** * The cutoff value used to determine when to stop traversing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultCutoff) */ defaultCutoff: number; /** * The number of facilities to find. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultTargetFacilityCount) */ defaultTargetFacilityCount: number; /** * The language used when generating driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If an unsupported language code is specified, the service returns the directions using the default language, English. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLanguage) */ directionsLanguage: string; /** * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) */ directionsLengthUnits: string; /** * Defines the amount of direction information returned. The default value is standard. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsOutputType) */ directionsOutputType: string; /** * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsStyleName) */ directionsStyleName: string; /** * The name of the attribute field that contains the drive time values. If not specified, the task will use the attribute field defined by the routing network layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsTimeAttribute) */ directionsTimeAttribute: string; /** * When `true`, restricted network elements should be considered when finding network locations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements: boolean; /** * The set of facilities loaded as network locations during analysis. These can be specified as either a [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#facilities) */ facilities: DataLayer | FeatureSet; /** * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#impedanceAttribute) */ impedanceAttribute: string; /** * The set of incidents loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#incidents) */ incidents: DataLayer | FeatureSet; /** * The output geometry precision. When `0`, no generalization of the output geometry is performed. Positive values represent the `MaximumAllowableOffset` parameter used by generalize. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecision) */ outputGeometryPrecision: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. - * + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. + * * Possible Value | Description * ---------------|------------ * none | No lines are returned * straight | Only returns straight lines * true-shape | Return the true shape of the lines * true-shape-with-measure | Return the true shape of the lines with their measurements - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) */ outputLines: string; /** * The well-known id of the spatial reference or the spatial reference object for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference | string; /** * The set of point barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#pointBarriers) */ pointBarriers: DataLayer | FeatureSet; /** * The set of polygon barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polygonBarriers) */ polygonBarriers: DataLayer | FeatureSet; /** * The set of polyline barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polylineBarriers) */ polylineBarriers: DataLayer | FeatureSet; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are listed in the Service Directory under Network Dataset > Network Attributes. You can also specify a value of none to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. Use `["none"]` to override the service defaults and specify that no restrictions should be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictionAttributes) */ restrictionAttributes: string[]; /** * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) */ restrictUTurns: string; /** * Indicates whether the service should generate driving directions for each route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) - * + * * @default false */ returnDirections: boolean; /** * If `true`, facilities will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnFacilities) - * + * * @default false */ returnFacilities: boolean; /** * If `true`, incidents will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnIncidents) - * + * * @default false */ returnIncidents: boolean; /** * If `true`, point barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPointBarriers) - * + * * @default false */ returnPointBarriers: boolean; /** * If `true`, polygon barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers: boolean; /** * If `true`, polyline barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers: boolean; /** * When `true`, closest facility routes will be generated and returned in the route property of each [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnRoutes) - * + * * @default true */ returnRoutes: boolean; /** * The arrival or departure date and time. For example, if the travelDirection is set to `to-facility` and `timeOfDayUsage` is set to `end` and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) */ timeOfDay: Date; /** * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Possible Values:** start | end - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) */ timeOfDayUsage: string; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. - * + * Options for traveling to or from the facility. Default values are defined by the network layer. + * * Possible Value | Description * ---------------|------------ * from-facility | Sets travel direction from the facility * to-facility | Sets travel direction to the facility - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) */ travelDirection: string; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelMode) + */ + travelMode: any; /** * If `true`, the hierarchy attribute for the network will be used in analysis. The default is defined in the routing network layer used by the [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#useHierarchy) - * + * * @default false */ useHierarchy: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } @@ -31255,11 +33508,11 @@ declare namespace __esri { interface ClosestFacilityParametersConstructor { /** * Input parameters for [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html) */ - new(properties?: ClosestFacilityParametersProperties): ClosestFacilityParameters; + new (properties?: ClosestFacilityParametersProperties): ClosestFacilityParameters; } export const ClosestFacilityParameters: ClosestFacilityParametersConstructor; @@ -31267,253 +33520,258 @@ declare namespace __esri { interface ClosestFacilityParametersProperties { /** * The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#accumulateAttributes) */ accumulateAttributes?: string[]; /** * An array of attribute parameter values that determine which network elements can be used by a vehicle. View the object specifications below for properties of the individual objects in this array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ attributeParameterValues?: ClosestFacilityParametersAttributeParameterValues[]; /** * The cutoff value used to determine when to stop traversing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultCutoff) */ defaultCutoff?: number; /** * The number of facilities to find. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultTargetFacilityCount) */ defaultTargetFacilityCount?: number; /** * The language used when generating driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If an unsupported language code is specified, the service returns the directions using the default language, English. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLanguage) */ directionsLanguage?: string; /** * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) */ directionsLengthUnits?: string; /** * Defines the amount of direction information returned. The default value is standard. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsOutputType) */ directionsOutputType?: string; /** * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsStyleName) */ directionsStyleName?: string; /** * The name of the attribute field that contains the drive time values. If not specified, the task will use the attribute field defined by the routing network layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsTimeAttribute) */ directionsTimeAttribute?: string; /** * When `true`, restricted network elements should be considered when finding network locations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements?: boolean; /** * The set of facilities loaded as network locations during analysis. These can be specified as either a [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#facilities) */ facilities?: DataLayerProperties | FeatureSetProperties; /** * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#impedanceAttribute) */ impedanceAttribute?: string; /** * The set of incidents loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#incidents) */ incidents?: DataLayerProperties | FeatureSetProperties; /** * The output geometry precision. When `0`, no generalization of the output geometry is performed. Positive values represent the `MaximumAllowableOffset` parameter used by generalize. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecision) */ outputGeometryPrecision?: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits?: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. - * + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. + * * Possible Value | Description * ---------------|------------ * none | No lines are returned * straight | Only returns straight lines * true-shape | Return the true shape of the lines * true-shape-with-measure | Return the true shape of the lines with their measurements - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) */ outputLines?: string; /** * The well-known id of the spatial reference or the spatial reference object for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties | string; /** * The set of point barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#pointBarriers) */ pointBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polygon barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polygonBarriers) */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polyline barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polylineBarriers) */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are listed in the Service Directory under Network Dataset > Network Attributes. You can also specify a value of none to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. Use `["none"]` to override the service defaults and specify that no restrictions should be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictionAttributes) */ restrictionAttributes?: string[]; /** * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) */ restrictUTurns?: string; /** * Indicates whether the service should generate driving directions for each route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) - * + * * @default false */ returnDirections?: boolean; /** * If `true`, facilities will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnFacilities) - * + * * @default false */ returnFacilities?: boolean; /** * If `true`, incidents will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnIncidents) - * + * * @default false */ returnIncidents?: boolean; /** * If `true`, point barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPointBarriers) - * + * * @default false */ returnPointBarriers?: boolean; /** * If `true`, polygon barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers?: boolean; /** * If `true`, polyline barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers?: boolean; /** * When `true`, closest facility routes will be generated and returned in the route property of each [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnRoutes) - * + * * @default true */ returnRoutes?: boolean; /** * The arrival or departure date and time. For example, if the travelDirection is set to `to-facility` and `timeOfDayUsage` is set to `end` and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) */ timeOfDay?: DateProperties; /** * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Possible Values:** start | end - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) */ timeOfDayUsage?: string; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. - * + * Options for traveling to or from the facility. Default values are defined by the network layer. + * * Possible Value | Description * ---------------|------------ * from-facility | Sets travel direction from the facility * to-facility | Sets travel direction to the facility - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) */ travelDirection?: string; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelMode) + */ + travelMode?: any; /** * If `true`, the hierarchy attribute for the network will be used in analysis. The default is defined in the routing network layer used by the [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#useHierarchy) - * + * * @default false */ useHierarchy?: boolean; } - export interface ClosestFacilityParametersAttributeParameterValues extends Object { /** * The name of the attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ attributeName: string; /** * The parameter name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ parameterName: string; /** * The parameter value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ value: string; @@ -31522,49 +33780,49 @@ declare namespace __esri { interface ClosestFacilitySolveResult extends Accessor, JSONSupport { /** * An array of directions. A direction is an instance of [DirectionsFeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html). Route directions are returned if `returnDirections = true` (default is false). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#directions) */ directions: DirectionsFeatureSet; /** * An array of points representing facilities. Only returned when `ClosestFacilityParameters.returnFacilities = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#facilities) */ facilities: Point[]; /** * An array of points representing incidents. Only returned when `ClosestFacilityParameters.returnIncidents = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#incidents) */ incidents: Point[]; /** * Message received when the solve is complete. If a closest facility cannot be solved, the message returned by the server identifies the incident that could not be solved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#messages) */ messages: NAMessage[]; /** * The point barriers are an array of points. They are returned only if `ClosestFacilityParameters.returnPointBarriers` was set to `true` (which is not the default). If you send in the point barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#pointBarriers) */ pointBarriers: Point[]; /** * The polygon barriers are an array of polygons. They are returned only if `ClosestFacilityParameters.returnPolygonBarriers` was set to `true` (which is not the default). If you send in the polygon barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polygonBarriers) */ polygonBarriers: Polygon[]; /** * The polyline barriers are an array of polylines. They are returned only if `ClosestFacilityParameters.returnPolylineBarriers` was set to `true` (which is not the default). If you send in the polyline barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polylineBarriers) */ polylineBarriers: Polyline[]; /** * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `none`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#routes) */ routes: Graphic[]; @@ -31573,11 +33831,11 @@ declare namespace __esri { interface ClosestFacilitySolveResultConstructor { /** * The result from [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html) */ - new(properties?: ClosestFacilitySolveResultProperties): ClosestFacilitySolveResult; + new (properties?: ClosestFacilitySolveResultProperties): ClosestFacilitySolveResult; fromJSON(json: any): ClosestFacilitySolveResult; } @@ -31587,49 +33845,49 @@ declare namespace __esri { interface ClosestFacilitySolveResultProperties { /** * An array of directions. A direction is an instance of [DirectionsFeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html). Route directions are returned if `returnDirections = true` (default is false). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#directions) */ directions?: DirectionsFeatureSetProperties; /** * An array of points representing facilities. Only returned when `ClosestFacilityParameters.returnFacilities = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#facilities) */ facilities?: PointProperties[]; /** * An array of points representing incidents. Only returned when `ClosestFacilityParameters.returnIncidents = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#incidents) */ incidents?: PointProperties[]; /** * Message received when the solve is complete. If a closest facility cannot be solved, the message returned by the server identifies the incident that could not be solved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#messages) */ messages?: NAMessageProperties[]; /** * The point barriers are an array of points. They are returned only if `ClosestFacilityParameters.returnPointBarriers` was set to `true` (which is not the default). If you send in the point barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#pointBarriers) */ pointBarriers?: PointProperties[]; /** * The polygon barriers are an array of polygons. They are returned only if `ClosestFacilityParameters.returnPolygonBarriers` was set to `true` (which is not the default). If you send in the polygon barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polygonBarriers) */ polygonBarriers?: PolygonProperties[]; /** * The polyline barriers are an array of polylines. They are returned only if `ClosestFacilityParameters.returnPolylineBarriers` was set to `true` (which is not the default). If you send in the polyline barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polylineBarriers) */ polylineBarriers?: PolylineProperties[]; /** * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `none`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#routes) */ routes?: GraphicProperties[]; @@ -31638,22 +33896,20 @@ declare namespace __esri { interface DataFile extends Accessor, JSONSupport { /** * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater services that support uploads, this class can be used to specify an uploaded item as input by specifying the ItemID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#itemId) */ itemId: string; /** * URL to the location of the data file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#url) */ url: string; } interface DataFileConstructor { - - - new(properties?: DataFileProperties): DataFile; + new (properties?: DataFileProperties): DataFile; fromJSON(json: any): DataFile; } @@ -31663,13 +33919,13 @@ declare namespace __esri { interface DataFileProperties { /** * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater services that support uploads, this class can be used to specify an uploaded item as input by specifying the ItemID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#itemId) */ itemId?: string; /** * URL to the location of the data file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#url) */ url?: string; @@ -31678,19 +33934,19 @@ declare namespace __esri { interface DataLayer extends Accessor { /** * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) is applied to this geometry while performing the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#geometry) */ geometry: Geometry; /** * The name of the data layer in the map service that is being referenced. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#name) */ name: string; /** - * The spatial relationship to be applied on the input geometry while performing the query. - * + * The spatial relationship to be applied on the input geometry while performing the query. + * * Possible Value | Description * ---------------|------------ * intersects | Part of a feature from feature class 1 is contained in a feature from feature class 2. @@ -31702,24 +33958,24 @@ declare namespace __esri { * touches | The feature from feature class 1 touches the border of a feature from feature class 2. * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) */ spatialRelationship: string; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#where) */ where: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#toJSON) - * - * + * + * */ toJSON(): any; } @@ -31727,11 +33983,11 @@ declare namespace __esri { interface DataLayerConstructor { /** * Input for properties of ClosestFacilityParameters,RouteParameters or ServiceAreaParameters. The DataLayer can be used to define the following for each paramater type: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) */ - new(properties?: DataLayerProperties): DataLayer; + new (properties?: DataLayerProperties): DataLayer; } export const DataLayer: DataLayerConstructor; @@ -31739,19 +33995,19 @@ declare namespace __esri { interface DataLayerProperties { /** * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) is applied to this geometry while performing the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#geometry) */ geometry?: GeometryProperties; /** * The name of the data layer in the map service that is being referenced. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#name) */ name?: string; /** - * The spatial relationship to be applied on the input geometry while performing the query. - * + * The spatial relationship to be applied on the input geometry while performing the query. + * * Possible Value | Description * ---------------|------------ * intersects | Part of a feature from feature class 1 is contained in a feature from feature class 2. @@ -31763,14 +34019,14 @@ declare namespace __esri { * touches | The feature from feature class 1 touches the border of a feature from feature class 2. * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) */ spatialRelationship?: string; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#where) */ where?: string; @@ -31779,24 +34035,22 @@ declare namespace __esri { interface supportDate extends Accessor, JSONSupport { /** * Date value returned from server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#date) */ date: Date; /** * The format of the date used in the date property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#format) - * + * * @default EEE MMM dd HH:mm:ss zzz yyyy */ format: string; } interface supportDateConstructor { - - - new(properties?: supportDateProperties): supportDate; + new (properties?: supportDateProperties): supportDate; fromJSON(json: any): supportDate; } @@ -31806,15 +34060,15 @@ declare namespace __esri { interface supportDateProperties { /** * Date value returned from server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#date) */ date?: DateProperties; /** * The format of the date used in the date property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#format) - * + * * @default EEE MMM dd HH:mm:ss zzz yyyy */ format?: string; @@ -31823,43 +34077,41 @@ declare namespace __esri { interface DensifyParameters extends Accessor { /** * If `true`, Geographic Coordinate System spatial references are used or densify geodesic will be performed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geodesic) */ geodesic: boolean; /** * The array of geometries to be densified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geometries) */ geometries: Geometry[]; /** * The length unit of `maxSegmentLength`. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#lengthUnit) */ lengthUnit: string; /** * All segments longer than `maxSegmentLength` are replaced with sequences of lines no longer than `maxSegmentLength.` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#maxSegmentLength) */ maxSegmentLength: number; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface DensifyParametersConstructor { - - - new(properties?: DensifyParametersProperties): DensifyParameters; + new (properties?: DensifyParametersProperties): DensifyParameters; } export const DensifyParameters: DensifyParametersConstructor; @@ -31867,25 +34119,25 @@ declare namespace __esri { interface DensifyParametersProperties { /** * If `true`, Geographic Coordinate System spatial references are used or densify geodesic will be performed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geodesic) */ geodesic?: boolean; /** * The array of geometries to be densified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * The length unit of `maxSegmentLength`. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#lengthUnit) */ lengthUnit?: string; /** * All segments longer than `maxSegmentLength` are replaced with sequences of lines no longer than `maxSegmentLength.` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#maxSegmentLength) */ maxSegmentLength?: number; @@ -31894,49 +34146,49 @@ declare namespace __esri { interface DirectionsFeatureSet extends FeatureSet, Accessor { /** * The extent of the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#extent) */ extent: Extent; /** * A single polyline representing the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#mergedGeometry) */ mergedGeometry: Polyline; /** * The ID of the route returned from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeId) */ routeId: string; /** * Name specified in [RouteParameters.stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeName) */ routeName: string; /** * Lists additional information about the directions depending on the value of [RouteParameters.directionsOutputType](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#strings) */ strings: any[]; /** * Actual drive time calculated for the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalDriveTime) */ totalDriveTime: number; /** * The length of the route as specified in the units set in [RouteParameters.directionsLengthUnits](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalLength) */ totalLength: number; /** * The total time calculated for the route as specified in the units set in [RouteParameters.directionsTimeAttribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalTime) */ totalTime: number; @@ -31945,11 +34197,11 @@ declare namespace __esri { interface DirectionsFeatureSetConstructor { /** * A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) that has properties specific to routing. The [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#features) property contains the turn by turn directions text and geometry of the route. The attributes for each feature provide information associated with the corresponding route segment. The following attributes are returned: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html) */ - new(properties?: DirectionsFeatureSetProperties): DirectionsFeatureSet; + new (properties?: DirectionsFeatureSetProperties): DirectionsFeatureSet; fromJSON(json: any): DirectionsFeatureSet; } @@ -31959,49 +34211,49 @@ declare namespace __esri { interface DirectionsFeatureSetProperties extends FeatureSetProperties { /** * The extent of the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#extent) */ extent?: ExtentProperties; /** * A single polyline representing the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#mergedGeometry) */ mergedGeometry?: PolylineProperties; /** * The ID of the route returned from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeId) */ routeId?: string; /** * Name specified in [RouteParameters.stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeName) */ routeName?: string; /** * Lists additional information about the directions depending on the value of [RouteParameters.directionsOutputType](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#strings) */ strings?: any[]; /** * Actual drive time calculated for the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalDriveTime) */ totalDriveTime?: number; /** * The length of the route as specified in the units set in [RouteParameters.directionsLengthUnits](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalLength) */ totalLength?: number; /** * The total time calculated for the route as specified in the units set in [RouteParameters.directionsTimeAttribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalTime) */ totalTime?: number; @@ -32010,43 +34262,41 @@ declare namespace __esri { interface DistanceParameters extends Accessor { /** * Specifies the units for measuring distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2). If the unit is not specified the units are derived from the spatial reference. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#distanceUnit) */ distanceUnit: string; /** * When `true`, the geodesic distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) is measured. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geodesic) */ geodesic: boolean; /** * The geometry from which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) */ geometry1: Geometry[]; /** * The geometry to which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) */ geometry2: Geometry[]; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface DistanceParametersConstructor { - - - new(properties?: DistanceParametersProperties): DistanceParameters; + new (properties?: DistanceParametersProperties): DistanceParameters; } export const DistanceParameters: DistanceParametersConstructor; @@ -32054,25 +34304,25 @@ declare namespace __esri { interface DistanceParametersProperties { /** * Specifies the units for measuring distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2). If the unit is not specified the units are derived from the spatial reference. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#distanceUnit) */ distanceUnit?: string; /** * When `true`, the geodesic distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) is measured. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geodesic) */ geodesic?: boolean; /** * The geometry from which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) */ geometry1?: GeometryProperties[]; /** * The geometry to which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) */ geometry2?: GeometryProperties[]; @@ -32081,46 +34331,44 @@ declare namespace __esri { interface FeatureSet extends Accessor, JSONSupport { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. This is only applicable when the FeatureSet is returned from a task. It is ignored when the FeatureSet is used as input to a geoprocessing task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#displayFieldName) */ displayFieldName: string; /** * Typically, a layer has a limit on the number of features (i.e., records) returned by the query operation. If `maxRecordCount` is configured for a layer, `exceededTransferLimit` will be `true` if a query matches more than the `maxRecordCount` features. It will be `false` otherwise. Supported by ArcGIS Server version 10.1 and later. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#exceededTransferLimit) */ exceededTransferLimit: boolean; /** * The array of graphics returned from a task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#features) */ features: Graphic[]; /** * Information about each field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#fields) */ fields: Field[]; /** * The geometry type of the FeatureSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#geometryType) */ geometryType: string; /** * When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. This value can be changed. When a FeatureSet is returned from a task, the value is the result as returned from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#spatialReference) */ spatialReference: SpatialReference; } interface FeatureSetConstructor { - - - new(properties?: FeatureSetProperties): FeatureSet; + new (properties?: FeatureSetProperties): FeatureSet; fromJSON(json: any): FeatureSet; } @@ -32130,37 +34378,37 @@ declare namespace __esri { interface FeatureSetProperties { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. This is only applicable when the FeatureSet is returned from a task. It is ignored when the FeatureSet is used as input to a geoprocessing task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#displayFieldName) */ displayFieldName?: string; /** * Typically, a layer has a limit on the number of features (i.e., records) returned by the query operation. If `maxRecordCount` is configured for a layer, `exceededTransferLimit` will be `true` if a query matches more than the `maxRecordCount` features. It will be `false` otherwise. Supported by ArcGIS Server version 10.1 and later. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#exceededTransferLimit) */ exceededTransferLimit?: boolean; /** * The array of graphics returned from a task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#features) */ features?: GraphicProperties[]; /** * Information about each field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#fields) */ fields?: FieldProperties[]; /** * The geometry type of the FeatureSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#geometryType) */ geometryType?: string; /** * When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. This value can be changed. When a FeatureSet is returned from a task, the value is the result as returned from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; @@ -32169,71 +34417,69 @@ declare namespace __esri { interface FindParameters extends Accessor { /** * Determines whether to look for an exact match of the search text or not. If `true`, searches for a value that contains the provided [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText). This is a case-insensitive search. If `false`, searches for an exact match of the [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) string. The exact match is case-sensitive. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#contains) - * + * * @default true */ contains: boolean; /** * Specify the number of decimal places for the geometries returned by the task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#geometryPrecision) */ geometryPrecision: number; /** * The layers to perform the find operation on. The layers are specified as a comma-separated list of layer ids. The list of ids is returned in [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) layerInfos. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#layerIds) */ layerIds: number[]; /** * The maximum allowable offset used for generalizing geometries returned by the find operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference). If [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) is not defined, the spatial reference of the map is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#maxAllowableOffset) */ maxAllowableOffset: number; /** * The spatial reference of the output geometries. If this is not specified, the output geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * If `true`, the output will include the geometry associated with each result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * The names of the fields of a layer to search. The fields are specified as a comma-separated list of field names. If this parameter is not specified, all fields are searched by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) */ searchFields: string[]; /** * The text that is searched across the layers and the fields as specified in the `layers` and [searchFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) */ searchText: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface FindParametersConstructor { - - - new(properties?: FindParametersProperties): FindParameters; + new (properties?: FindParametersProperties): FindParameters; } export const FindParameters: FindParametersConstructor; @@ -32241,53 +34487,53 @@ declare namespace __esri { interface FindParametersProperties { /** * Determines whether to look for an exact match of the search text or not. If `true`, searches for a value that contains the provided [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText). This is a case-insensitive search. If `false`, searches for an exact match of the [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) string. The exact match is case-sensitive. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#contains) - * + * * @default true */ contains?: boolean; /** * Specify the number of decimal places for the geometries returned by the task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#geometryPrecision) */ geometryPrecision?: number; /** * The layers to perform the find operation on. The layers are specified as a comma-separated list of layer ids. The list of ids is returned in [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) layerInfos. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#layerIds) */ layerIds?: number[]; /** * The maximum allowable offset used for generalizing geometries returned by the find operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference). If [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) is not defined, the spatial reference of the map is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** * The spatial reference of the output geometries. If this is not specified, the output geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * If `true`, the output will include the geometry associated with each result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; /** * The names of the fields of a layer to search. The fields are specified as a comma-separated list of field names. If this parameter is not specified, all fields are searched by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) */ searchFields?: string[]; /** * The text that is searched across the layers and the fields as specified in the `layers` and [searchFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) */ searchText?: string; @@ -32296,46 +34542,44 @@ declare namespace __esri { interface FindResult extends Accessor, JSONSupport { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#displayFieldName) */ displayFieldName: string; /** * The found feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#feature) */ feature: Graphic; /** * The name of the field that contains the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#foundFieldName) */ foundFieldName: string; /** * Unique ID of the layer that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerId) */ layerId: number; /** * The layer name that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerName) */ layerName: string; /** * The value of the `foundFieldName` in the feature's attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#value) */ value: void; } interface FindResultConstructor { - - - new(properties?: FindResultProperties): FindResult; + new (properties?: FindResultProperties): FindResult; fromJSON(json: any): FindResult; } @@ -32345,37 +34589,37 @@ declare namespace __esri { interface FindResultProperties { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#displayFieldName) */ displayFieldName?: string; /** * The found feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#feature) */ feature?: GraphicProperties; /** * The name of the field that contains the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#foundFieldName) */ foundFieldName?: string; /** * Unique ID of the layer that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerId) */ layerId?: number; /** * The layer name that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerName) */ layerName?: string; /** * The value of the `foundFieldName` in the feature's attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#value) */ value?: void; @@ -32384,37 +34628,35 @@ declare namespace __esri { interface GeneralizeParameters extends Accessor { /** * The maximum deviation unit. If the unit is not specified, units are derived from the spatial reference. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#deviationUnit) */ deviationUnit: string; /** * The array of input geometries to generalize. All geometries in this array must be of the same geometry type (e.g. `esriGeometryPolyline` or `esriGeometryPolygon`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#geometries) */ geometries: Geometry[]; /** * The maximum deviation for constructing a generalized geometry based on the input geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#maxDeviation) */ maxDeviation: number; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface GeneralizeParametersConstructor { - - - new(properties?: GeneralizeParametersProperties): GeneralizeParameters; + new (properties?: GeneralizeParametersProperties): GeneralizeParameters; } export const GeneralizeParameters: GeneralizeParametersConstructor; @@ -32422,19 +34664,19 @@ declare namespace __esri { interface GeneralizeParametersProperties { /** * The maximum deviation unit. If the unit is not specified, units are derived from the spatial reference. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#deviationUnit) */ deviationUnit?: string; /** * The array of input geometries to generalize. All geometries in this array must be of the same geometry type (e.g. `esriGeometryPolyline` or `esriGeometryPolygon`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * The maximum deviation for constructing a generalized geometry based on the input geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#maxDeviation) */ maxDeviation?: number; @@ -32443,22 +34685,20 @@ declare namespace __esri { interface GPMessage extends Accessor, JSONSupport { /** * The geoprocessing message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#description) */ description: string; /** * The geoprocessing message type. **Possible Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#type) */ type: string; } interface GPMessageConstructor { - - - new(properties?: GPMessageProperties): GPMessage; + new (properties?: GPMessageProperties): GPMessage; fromJSON(json: any): GPMessage; } @@ -32468,13 +34708,13 @@ declare namespace __esri { interface GPMessageProperties { /** * The geoprocessing message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#description) */ description?: string; /** * The geoprocessing message type. **Possible Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#type) */ type?: string; @@ -32483,140 +34723,138 @@ declare namespace __esri { interface IdentifyParameters extends Accessor { /** * Resolution of the current map view in dots per inch. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) - * + * * @default 96 */ dpi: number; /** * The geometry used to select features during the Identify operation. The type of the geometry is specified by [Geometry.type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type). The most common geometry used with Identify is a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometry) */ geometry: Geometry; /** * Specify the number of decimal places for the geometries returned by the task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometryPrecision) */ geometryPrecision: number; /** * Height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height) - * + * * @default 400 */ height: number; /** * The layers on which to perform the identify operation. The layers are specified as a comma-separated list of layer IDs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerIds) */ layerIds: number[]; /** - * Specifies which layers to use when using Identify. - * + * Specifies which layers to use when using Identify. + * * Possible values | Description * --------------- | ----------- * top | Only the top-most visible layer is identified. * visible | All visible layers are identified. * all | All layers are identified, even if they are not visible. If your service has many layers, a request using this option will not perform well. A visible layer means you can see it in the map at the current extent. If a layer is turned off or not in range based on its scale dependency settings, it cannot be identified. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerOption) - * + * * @default top */ layerOption: string; /** * The Extent or bounding box of the current map view. The `mapExtent` property is assumed to be in the spatial reference of the map unless [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) has been specified. The values for [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent), [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width), and [dpi](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) are used to determine the current map scale. Once the scale is known, the map service can exclude layers based on their scale dependency settings. The map service is not performing a spatial intersection based on the provided extent. These properties are also used to calculate the search distance on the map based on the tolerance in screen pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent) */ mapExtent: Extent; /** * The maximum allowable offset used for generalizing geometries returned by the identify operation. The offset is in the units of the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference). If a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) is not defined the spatial reference of the view is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#maxAllowableOffset) */ maxAllowableOffset: number; /** * If `true`, field names will be returned instead of field aliases. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnFieldName) - * + * * @default false */ returnFieldName: boolean; /** * If `true`, the result set includes the geometry associated with each result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * When `true`, indicates that M values will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnM) - * + * * @default false */ returnM: boolean; /** * If `true`, the values in the result will not be formatted i.e. numbers will returned as is and dates will be returned as epoch values. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnUnformattedValues) - * + * * @default false */ returnUnformattedValues: boolean; /** * When `true`, indicates that M values will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnZ) - * + * * @default false */ returnZ: boolean; /** * The spatial reference of the input and output geometries as well as of the [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent). If the spatial reference is not specified, the geometry and the extent are assumed to be in the spatial reference of the view, and the output geometries will also be in the spatial reference of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) */ spatialReference: SpatialReference; /** * The distance in screen pixels from the specified geometry within which the identify should be performed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#tolerance) */ tolerance: number; /** * Width of the current map view in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width) - * + * * @default 400 */ width: number; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface IdentifyParametersConstructor { - - - new(properties?: IdentifyParametersProperties): IdentifyParameters; + new (properties?: IdentifyParametersProperties): IdentifyParameters; } export const IdentifyParameters: IdentifyParametersConstructor; @@ -32624,122 +34862,122 @@ declare namespace __esri { interface IdentifyParametersProperties { /** * Resolution of the current map view in dots per inch. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) - * + * * @default 96 */ dpi?: number; /** * The geometry used to select features during the Identify operation. The type of the geometry is specified by [Geometry.type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type). The most common geometry used with Identify is a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometry) */ geometry?: GeometryProperties; /** * Specify the number of decimal places for the geometries returned by the task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometryPrecision) */ geometryPrecision?: number; /** * Height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height) - * + * * @default 400 */ height?: number; /** * The layers on which to perform the identify operation. The layers are specified as a comma-separated list of layer IDs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerIds) */ layerIds?: number[]; /** - * Specifies which layers to use when using Identify. - * + * Specifies which layers to use when using Identify. + * * Possible values | Description * --------------- | ----------- * top | Only the top-most visible layer is identified. * visible | All visible layers are identified. * all | All layers are identified, even if they are not visible. If your service has many layers, a request using this option will not perform well. A visible layer means you can see it in the map at the current extent. If a layer is turned off or not in range based on its scale dependency settings, it cannot be identified. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerOption) - * + * * @default top */ layerOption?: string; /** * The Extent or bounding box of the current map view. The `mapExtent` property is assumed to be in the spatial reference of the map unless [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) has been specified. The values for [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent), [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width), and [dpi](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) are used to determine the current map scale. Once the scale is known, the map service can exclude layers based on their scale dependency settings. The map service is not performing a spatial intersection based on the provided extent. These properties are also used to calculate the search distance on the map based on the tolerance in screen pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent) */ mapExtent?: ExtentProperties; /** * The maximum allowable offset used for generalizing geometries returned by the identify operation. The offset is in the units of the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference). If a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) is not defined the spatial reference of the view is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** * If `true`, field names will be returned instead of field aliases. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnFieldName) - * + * * @default false */ returnFieldName?: boolean; /** * If `true`, the result set includes the geometry associated with each result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; /** * When `true`, indicates that M values will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnM) - * + * * @default false */ returnM?: boolean; /** * If `true`, the values in the result will not be formatted i.e. numbers will returned as is and dates will be returned as epoch values. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnUnformattedValues) - * + * * @default false */ returnUnformattedValues?: boolean; /** * When `true`, indicates that M values will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnZ) - * + * * @default false */ returnZ?: boolean; /** * The spatial reference of the input and output geometries as well as of the [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent). If the spatial reference is not specified, the geometry and the extent are assumed to be in the spatial reference of the view, and the output geometries will also be in the spatial reference of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * The distance in screen pixels from the specified geometry within which the identify should be performed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#tolerance) */ tolerance?: number; /** * Width of the current map view in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width) - * + * * @default 400 */ width?: number; @@ -32748,34 +34986,32 @@ declare namespace __esri { interface IdentifyResult extends Accessor, JSONSupport { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#displayFieldName) */ displayFieldName: string; /** * An identified feature from the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#feature) */ feature: Graphic; /** * Unique ID of the layer that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerId) */ layerId: number; /** * The layer name that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerName) */ layerName: string; } interface IdentifyResultConstructor { - - - new(properties?: IdentifyResultProperties): IdentifyResult; + new (properties?: IdentifyResultProperties): IdentifyResult; fromJSON(json: any): IdentifyResult; } @@ -32785,25 +35021,25 @@ declare namespace __esri { interface IdentifyResultProperties { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#displayFieldName) */ displayFieldName?: string; /** * An identified feature from the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#feature) */ feature?: GraphicProperties; /** * Unique ID of the layer that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerId) */ layerId?: number; /** * The layer name that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerName) */ layerName?: string; @@ -32812,77 +35048,75 @@ declare namespace __esri { interface ImageServiceIdentifyParameters extends Accessor { /** * Input geometry that defines the location to be identified. The location can be a point or a polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#geometry) */ geometry: Point | Polygon; /** * Specifies the mosaic rules defining the image sorting order. When a mosaic rule is not specified, `center` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#mosaicRule) */ mosaicRule: MosaicRule; /** * The pixel or RGB color value representing no information. It can be defined as a number `noData = 0` representing a pixel value or as a string `noData = "58,128,187"` representing an RGB color value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#noData) */ noData: string | number; /** * Specifies the pixel level being identified on the x and y axis. Defaults to the base resolution of the dataset when not specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSize) */ pixelSize: Symbol; /** * The pixel level being identified (or the resolution being looked at) on the x-axis. If not specified, it will default to the base resolution of the dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeX) */ pixelSizeX: number; /** * The pixel level being identified (or the resolution being looked at) on the y-axis. If not specified, it will default to the base resolution of the dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeY) */ pixelSizeY: number; /** * Specifies the rendering rule for how the requested image should be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#renderingRule) */ renderingRule: RasterFunction; /** * If `true`, returns both geometry and attributes of the catalog items. Set to `false` when catalog items are not needed to significantly improve identify operation's performance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnCatalogItems) - * + * * @default true */ returnCatalogItems: boolean; /** * When `true`, each feature in the catalog items includes the geometry. Set to `false` to not display the features on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface ImageServiceIdentifyParametersConstructor { - - - new(properties?: ImageServiceIdentifyParametersProperties): ImageServiceIdentifyParameters; + new (properties?: ImageServiceIdentifyParametersProperties): ImageServiceIdentifyParameters; } export const ImageServiceIdentifyParameters: ImageServiceIdentifyParametersConstructor; @@ -32890,59 +35124,59 @@ declare namespace __esri { interface ImageServiceIdentifyParametersProperties { /** * Input geometry that defines the location to be identified. The location can be a point or a polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#geometry) */ geometry?: PointProperties | PolygonProperties; /** * Specifies the mosaic rules defining the image sorting order. When a mosaic rule is not specified, `center` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#mosaicRule) */ mosaicRule?: MosaicRuleProperties; /** * The pixel or RGB color value representing no information. It can be defined as a number `noData = 0` representing a pixel value or as a string `noData = "58,128,187"` representing an RGB color value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#noData) */ noData?: string | number; /** * Specifies the pixel level being identified on the x and y axis. Defaults to the base resolution of the dataset when not specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSize) */ pixelSize?: SymbolProperties; /** * The pixel level being identified (or the resolution being looked at) on the x-axis. If not specified, it will default to the base resolution of the dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeX) */ pixelSizeX?: number; /** * The pixel level being identified (or the resolution being looked at) on the y-axis. If not specified, it will default to the base resolution of the dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeY) */ pixelSizeY?: number; /** * Specifies the rendering rule for how the requested image should be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#renderingRule) */ renderingRule?: RasterFunctionProperties; /** * If `true`, returns both geometry and attributes of the catalog items. Set to `false` when catalog items are not needed to significantly improve identify operation's performance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnCatalogItems) - * + * * @default true */ returnCatalogItems?: boolean; /** * When `true`, each feature in the catalog items includes the geometry. Set to `false` to not display the features on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; @@ -32951,52 +35185,50 @@ declare namespace __esri { interface ImageServiceIdentifyResult extends Accessor, JSONSupport { /** * The set of catalog items that overlap the input geometry. Catalog Items are returned only when the image service source is a mosaic dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItems) */ catalogItems: FeatureSet; /** * The set of visible areas for the identified catalog items. `CatalogItemVisibilities` are returned only when the image service source is a mosaic dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItemVisibilities) */ catalogItemVisibilities: number[]; /** * The identified location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#location) */ location: Point; /** * The identify property name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#name) */ name: string; /** * The identify property id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#objectId) */ objectId: number; /** * The attributes of the identified object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#properties) */ properties: any; /** * The identify property pixel value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#value) */ value: string; } interface ImageServiceIdentifyResultConstructor { - - - new(properties?: ImageServiceIdentifyResultProperties): ImageServiceIdentifyResult; + new (properties?: ImageServiceIdentifyResultProperties): ImageServiceIdentifyResult; fromJSON(json: any): ImageServiceIdentifyResult; } @@ -33006,43 +35238,43 @@ declare namespace __esri { interface ImageServiceIdentifyResultProperties { /** * The set of catalog items that overlap the input geometry. Catalog Items are returned only when the image service source is a mosaic dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItems) */ catalogItems?: FeatureSetProperties; /** * The set of visible areas for the identified catalog items. `CatalogItemVisibilities` are returned only when the image service source is a mosaic dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItemVisibilities) */ catalogItemVisibilities?: number[]; /** * The identified location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#location) */ location?: PointProperties; /** * The identify property name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#name) */ name?: string; /** * The identify property id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#objectId) */ objectId?: number; /** * The attributes of the identified object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#properties) */ properties?: any; /** * The identify property pixel value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#value) */ value?: string; @@ -33051,28 +35283,26 @@ declare namespace __esri { interface JobInfo extends Accessor, JSONSupport { /** * The unique job ID assigned by ArcGIS Server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobId) */ jobId: string; /** * The job status. **Possible Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobStatus) */ jobStatus: string; /** * An array of messages that include the message type and a description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#messages) */ messages: GPMessage[]; } interface JobInfoConstructor { - - - new(properties?: JobInfoProperties): JobInfo; + new (properties?: JobInfoProperties): JobInfo; fromJSON(json: any): JobInfo; } @@ -33082,19 +35312,19 @@ declare namespace __esri { interface JobInfoProperties { /** * The unique job ID assigned by ArcGIS Server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobId) */ jobId?: string; /** * The job status. **Possible Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobStatus) */ jobStatus?: string; /** * An array of messages that include the message type and a description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#messages) */ messages?: GPMessageProperties[]; @@ -33103,28 +35333,26 @@ declare namespace __esri { interface LegendLayer extends Accessor { /** * The id of the operational layer to include in the printout's legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#layerId) */ layerId: string; /** * The ids of the sublayers to include in the printout's legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#subLayerIds) */ subLayerIds: string[]; /** * The title of the feature layer. Use this property to modify feature layer name in the legend for the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#title) */ title: string; } interface LegendLayerConstructor { - - - new(properties?: LegendLayerProperties): LegendLayer; + new (properties?: LegendLayerProperties): LegendLayer; } export const LegendLayer: LegendLayerConstructor; @@ -33132,19 +35360,19 @@ declare namespace __esri { interface LegendLayerProperties { /** * The id of the operational layer to include in the printout's legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#layerId) */ layerId?: string; /** * The ids of the sublayers to include in the printout's legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#subLayerIds) */ subLayerIds?: string[]; /** * The title of the feature layer. Use this property to modify feature layer name in the legend for the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#title) */ title?: string; @@ -33152,84 +35380,82 @@ declare namespace __esri { interface LengthsParameters extends Accessor { /** - * Defines the type of calculation for the geometry. The type can be one of the following: - * + * Defines the type of calculation for the geometry. The type can be one of the following: + * * Value | Description * ---------------|--------------- * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference otherwise use `preserve-shape`. * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid, for geometries defined in a projected or geographic coordinate system. This method preserves the shape of the geometry in its coordinate system which means the true area or length will be calculated for the geometry that is displayed on the map. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#calculationType) */ calculationType: string; /** * If polylines are in a geographic coordinate system, then geodesic needs to be set to `true` in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. If `lengthUnit` is not specified, the output is returned in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#geodesic) */ geodesic: boolean; /** * The length unit in which perimeters of polygons will be calculated. For a list of valid units, see [linear unit codes](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#lengthUnit) */ lengthUnit: number | string; /** * The array of polylines whose lengths are to be computed. The structure of each polyline in the array is same as the structure of the JSON polyline objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#polylines) */ polylines: Polyline[]; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface LengthsParametersConstructor { - - - new(properties?: LengthsParametersProperties): LengthsParameters; + new (properties?: LengthsParametersProperties): LengthsParameters; } export const LengthsParameters: LengthsParametersConstructor; interface LengthsParametersProperties { /** - * Defines the type of calculation for the geometry. The type can be one of the following: - * + * Defines the type of calculation for the geometry. The type can be one of the following: + * * Value | Description * ---------------|--------------- * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference otherwise use `preserve-shape`. * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid, for geometries defined in a projected or geographic coordinate system. This method preserves the shape of the geometry in its coordinate system which means the true area or length will be calculated for the geometry that is displayed on the map. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#calculationType) */ calculationType?: string; /** * If polylines are in a geographic coordinate system, then geodesic needs to be set to `true` in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. If `lengthUnit` is not specified, the output is returned in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#geodesic) */ geodesic?: boolean; /** * The length unit in which perimeters of polygons will be calculated. For a list of valid units, see [linear unit codes](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#lengthUnit) */ lengthUnit?: number | string; /** * The array of polylines whose lengths are to be computed. The structure of each polyline in the array is same as the structure of the JSON polyline objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#polylines) */ polylines?: PolylineProperties[]; @@ -33238,24 +35464,22 @@ declare namespace __esri { interface LinearUnit extends Accessor, JSONSupport { /** * Specifies the value of the linear distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#distance) - * + * * @default 0 */ distance: number; /** * Specifies the unit type of the linear distance. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#units) */ units: string; } interface LinearUnitConstructor { - - - new(properties?: LinearUnitProperties): LinearUnit; + new (properties?: LinearUnitProperties): LinearUnit; fromJSON(json: any): LinearUnit; } @@ -33265,15 +35489,15 @@ declare namespace __esri { interface LinearUnitProperties { /** * Specifies the value of the linear distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#distance) - * + * * @default 0 */ distance?: number; /** * Specifies the unit type of the linear distance. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#units) */ units?: string; @@ -33282,22 +35506,20 @@ declare namespace __esri { interface NAMessage extends Accessor, JSONSupport { /** * A description of the network analyst message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#description) */ description: string; /** * The network analyst message type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#type) */ type: any; } interface NAMessageConstructor { - - - new(properties?: NAMessageProperties): NAMessage; + new (properties?: NAMessageProperties): NAMessage; fromJSON(json: any): NAMessage; } @@ -33307,13 +35529,13 @@ declare namespace __esri { interface NAMessageProperties { /** * A description of the network analyst message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#description) */ description?: string; /** * The network analyst message type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#type) */ type?: any; @@ -33322,56 +35544,54 @@ declare namespace __esri { interface OffsetParameters extends Accessor { /** * The `bevelRatio` is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. When mitered is specified, the value set for `bevelRatio` is ignored and `10` is used internally. If beveled is specified, `1.1` will be used if no value is set for bevelRatio. The bevelRatio is ignored when `rounded` is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#bevelRatio) */ bevelRatio: number; /** * The array of geometries to be offset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#geometries) */ geometries: Geometry[]; /** * Specifies the planar distance for constructing an offset based on the input geometries. If the `offsetDistance` parameter is positive, the constructed offset will be on the right side of the curve. Left side offsets are constructed with negative values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetDistance) */ offsetDistance: number; /** - * Options that determine how the ends intersect. Set to one of the following options: - * + * Options that determine how the ends intersect. Set to one of the following options: + * * Possible Value | Description * ---------------|------------- * bevelled | Squares off the corner after a given ratio distance. * mitered | Attempts to allow extended offsets to naturally intersect. If the intersection occurs too far from a corner, the corner will be beveled off at a fixed distance. * rounded | Rounds the corner between extended offsets. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetHow) */ offsetHow: string; /** * The offset distance unit. For a list of valid units see [esriSRUnitType constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnitType.htm) or [esriSRUnit2Type constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnit2Type.htm). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetUnit) */ offsetUnit: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface OffsetParametersConstructor { - - - new(properties?: OffsetParametersProperties): OffsetParameters; + new (properties?: OffsetParametersProperties): OffsetParameters; } export const OffsetParameters: OffsetParametersConstructor; @@ -33379,38 +35599,38 @@ declare namespace __esri { interface OffsetParametersProperties { /** * The `bevelRatio` is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. When mitered is specified, the value set for `bevelRatio` is ignored and `10` is used internally. If beveled is specified, `1.1` will be used if no value is set for bevelRatio. The bevelRatio is ignored when `rounded` is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#bevelRatio) */ bevelRatio?: number; /** * The array of geometries to be offset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * Specifies the planar distance for constructing an offset based on the input geometries. If the `offsetDistance` parameter is positive, the constructed offset will be on the right side of the curve. Left side offsets are constructed with negative values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetDistance) */ offsetDistance?: number; /** - * Options that determine how the ends intersect. Set to one of the following options: - * + * Options that determine how the ends intersect. Set to one of the following options: + * * Possible Value | Description * ---------------|------------- * bevelled | Squares off the corner after a given ratio distance. * mitered | Attempts to allow extended offsets to naturally intersect. If the intersection occurs too far from a corner, the corner will be beveled off at a fixed distance. * rounded | Rounds the corner between extended offsets. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetHow) */ offsetHow?: string; /** * The offset distance unit. For a list of valid units see [esriSRUnitType constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnitType.htm) or [esriSRUnit2Type constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnit2Type.htm). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetUnit) */ offsetUnit?: string; @@ -33419,13 +35639,13 @@ declare namespace __esri { interface ParameterValue extends Accessor, JSONSupport { /** * Specifies the parameter's data type. **Possible Values:** string | double | long | boolean | date | linear-unit | data-file | raster-data | record-set | raster-data-layer | feature-record-set-layer | multi-value - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#dataType) */ dataType: string; /** - * The value of the parameter. The data structure of this value depends on the `dataType`. - * + * The value of the parameter. The data structure of this value depends on the `dataType`. + * * Data Type | JavaScript Type * ----------|---------------- * string | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) @@ -33440,17 +35660,15 @@ declare namespace __esri { * raster-data-layer | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html) * feature-record-set-layer | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) * multi-value | [String[]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#value) */ value: any; } interface ParameterValueConstructor { - - - new(properties?: ParameterValueProperties): ParameterValue; + new (properties?: ParameterValueProperties): ParameterValue; fromJSON(json: any): ParameterValue; } @@ -33460,13 +35678,13 @@ declare namespace __esri { interface ParameterValueProperties { /** * Specifies the parameter's data type. **Possible Values:** string | double | long | boolean | date | linear-unit | data-file | raster-data | record-set | raster-data-layer | feature-record-set-layer | multi-value - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#dataType) */ dataType?: string; /** - * The value of the parameter. The data structure of this value depends on the `dataType`. - * + * The value of the parameter. The data structure of this value depends on the `dataType`. + * * Data Type | JavaScript Type * ----------|---------------- * string | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) @@ -33481,8 +35699,8 @@ declare namespace __esri { * raster-data-layer | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html) * feature-record-set-layer | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) * multi-value | [String[]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#value) */ value?: any; @@ -33491,34 +35709,32 @@ declare namespace __esri { interface PrintParameters extends Accessor { /** * Additional parameters for the print service. When an arcpy script is published as a custom print service there may be additional parameters associated with the print service. To determine the extra parameters visit the ArcGIS REST Services Directory page for the print service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#extraParameters) */ extraParameters: any; /** * Specify the output spatial reference for the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * Defines the layout template used for the printed map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#template) */ template: PrintTemplate; /** * The view to print. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#view) */ view: MapView; } interface PrintParametersConstructor { - - - new(properties?: PrintParametersProperties): PrintParameters; + new (properties?: PrintParametersProperties): PrintParameters; } export const PrintParameters: PrintParametersConstructor; @@ -33526,25 +35742,25 @@ declare namespace __esri { interface PrintParametersProperties { /** * Additional parameters for the print service. When an arcpy script is published as a custom print service there may be additional parameters associated with the print service. To determine the extra parameters visit the ArcGIS REST Services Directory page for the print service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#extraParameters) */ extraParameters?: any; /** * Specify the output spatial reference for the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * Defines the layout template used for the printed map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#template) */ template?: PrintTemplateProperties; /** * The view to print. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#view) */ view?: MapViewProperties; @@ -33553,37 +35769,37 @@ declare namespace __esri { interface PrintTemplate extends Accessor { /** * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#attributionVisible) - * + * * @default true */ attributionVisible: boolean; /** * Define the map width, height and dpi. Required when `layout = 'map-only'`. See the object specification table below for available options to set for exportOptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ exportOptions: PrintTemplateExportOptions; /** * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#forceFeatureAttributes) - * + * * @default false */ forceFeatureAttributes: boolean; /** * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#format) - * + * * @default png32 */ format: string; /** * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: - * + * * Value | Description * | --- | --- * map-only | Map does not contain any layout elements. Only map image is printed. @@ -33595,49 +35811,47 @@ declare namespace __esri { * letter-ansi-a-portrait | Letter ANSI A Portrait * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) - * + * * @default map-only */ layout: string; /** * Defines the layout elements. It's an object with the following properties: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ layoutOptions: PrintTemplateLayoutOptions; /** * The optional map scale of the printed map. Only applies when `preserveScale = true`. If `outScale` is less than 1, then the printed map will use the scale of the input map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#outScale) - * + * * @default 0 */ outScale: number; /** * Define whether the printed map should preserve map scale or map extent. If `true`, the printed map will use the `outScale` property or default to the scale of the input map. If `false`, the printed map will use the same extent as the input map and thus scale might change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#preserveScale) - * + * * @default true */ preserveScale: boolean; /** * When `true`, labels will be shown on the layout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#showLabels) - * + * * @default true */ showLabels: boolean; } interface PrintTemplateConstructor { - - - new(properties?: PrintTemplateProperties): PrintTemplate; + new (properties?: PrintTemplateProperties): PrintTemplate; } export const PrintTemplate: PrintTemplateConstructor; @@ -33645,37 +35859,37 @@ declare namespace __esri { interface PrintTemplateProperties { /** * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#attributionVisible) - * + * * @default true */ attributionVisible?: boolean; /** * Define the map width, height and dpi. Required when `layout = 'map-only'`. See the object specification table below for available options to set for exportOptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ exportOptions?: PrintTemplateExportOptions; /** * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#forceFeatureAttributes) - * + * * @default false */ forceFeatureAttributes?: boolean; /** * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#format) - * + * * @default png32 */ format?: string; /** * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: - * + * * Value | Description * | --- | --- * map-only | Map does not contain any layout elements. Only map image is printed. @@ -33687,104 +35901,102 @@ declare namespace __esri { * letter-ansi-a-portrait | Letter ANSI A Portrait * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) - * + * * @default map-only */ layout?: string; /** * Defines the layout elements. It's an object with the following properties: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ layoutOptions?: PrintTemplateLayoutOptions; /** * The optional map scale of the printed map. Only applies when `preserveScale = true`. If `outScale` is less than 1, then the printed map will use the scale of the input map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#outScale) - * + * * @default 0 */ outScale?: number; /** * Define whether the printed map should preserve map scale or map extent. If `true`, the printed map will use the `outScale` property or default to the scale of the input map. If `false`, the printed map will use the same extent as the input map and thus scale might change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#preserveScale) - * + * * @default true */ preserveScale?: boolean; /** * When `true`, labels will be shown on the layout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#showLabels) - * + * * @default true */ showLabels?: boolean; } - export interface PrintTemplateExportOptions extends Object { /** * Map width. Default value is 800. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ width?: number; /** * Map height. Default value is 1100. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ height?: number; /** * Resolution in dots per inch. If modified when `layout = 'map-only'`, the `width` and `height` will also need to be modified proportional to the `dpi` change. Default value is 96. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ dpi?: number; } - export interface PrintTemplateLayoutOptions extends Object { /** * The text used for the map title if the specified layout contains a title text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ titleText: string; /** * The text used for the author if the specified layout contains an author text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ authorText: string; /** * The text used for the copyright if the specified layout contains an copyright text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ copyrightText: string; /** * The unit used for the scalebar. **Possible Values:** `Miles` | `Kilometers` | `Meters` | `Feet` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) - * + * * @default Miles */ 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 (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) */ legendLayers: LegendLayer[]; /** * An array of name-value pairs. Use this property to update the text for custom text elements on the page layout. Values must be strings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ customTextElements: any[]; @@ -33793,49 +36005,47 @@ declare namespace __esri { interface ProjectParameters extends Accessor { /** * The input geometries to project. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#geometries) */ geometries: Geometry[]; /** * The spatial reference to which you are projecting the geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * The spatial reference to which you are projecting the geometries. Use [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSR) */ outSR: SpatialReference; /** * The well-known id {wkid:number} or well-known text {wkt:string} of the datum transformation to be applied to the projected geometries. See [Datum transformations](https://developers.arcgis.com/rest/services-reference/datum-transformations.htm) for a list of valid datum transformations that may be used here. If a transformation is specified, a value must also be specified in the [transformForward](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) */ transformation: ProjectParametersTransformation; /** * Indicates whether to transform forward or not. The forward or reverse direction of transformation is implied in the name of the transformation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) */ transformForward: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface ProjectParametersConstructor { - - - new(properties?: ProjectParametersProperties): ProjectParameters; + new (properties?: ProjectParametersProperties): ProjectParameters; } export const ProjectParameters: ProjectParametersConstructor; @@ -33843,47 +36053,46 @@ declare namespace __esri { interface ProjectParametersProperties { /** * The input geometries to project. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * The spatial reference to which you are projecting the geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * The spatial reference to which you are projecting the geometries. Use [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSR) */ outSR?: SpatialReferenceProperties; /** * The well-known id {wkid:number} or well-known text {wkt:string} of the datum transformation to be applied to the projected geometries. See [Datum transformations](https://developers.arcgis.com/rest/services-reference/datum-transformations.htm) for a list of valid datum transformations that may be used here. If a transformation is specified, a value must also be specified in the [transformForward](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) */ transformation?: ProjectParametersTransformation; /** * Indicates whether to transform forward or not. The forward or reverse direction of transformation is implied in the name of the transformation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) */ transformForward?: boolean; } - export interface ProjectParametersTransformation extends Object { /** * The well-known ID of the datum transformation to apply to the projection. [List of valid IDs for Datum transformations](https://developers.arcgis.com/rest/services-reference/datum-transformations.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) */ wkid?: number; /** * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to [setup and use a proxy page](https://developers.arcgis.com/javascript/latest/guide/proxies/index.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) */ wkt?: string; @@ -33892,202 +36101,202 @@ declare namespace __esri { interface Query extends Accessor, JSONSupport { /** * Datum transformation used for projecting geometries in the query results when [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) is different than the layer's spatial reference. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#datumTransformation) */ datumTransformation: number; /** * Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) in a spatial query. The [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) indicates the unit of measurement. In essence, setting this property creates a buffer at the specified size around the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). The query will use that buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship). If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) capability must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) */ distance: number; /** * Specifies the geodatabase version to display for feature service queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#gdbVersion) */ gdbVersion: string; /** - * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. * > **Known Limitations** [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) geometry types are currently not supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) */ geometry: Geometry; /** * Specifies the number of decimal places for geometries returned by the query operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometryPrecision) */ geometryPrecision: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#historicMoment) */ historicMoment: Date; /** - * 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. + * 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) */ maxAllowableOffset: number; /** - * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. + * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxRecordCountFactor) - * + * * @default 1 */ maxRecordCountFactor: number; /** * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint`. If indicated, the xy footprint of each multipatch geometry will be returned in the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#multipatchOption) */ multipatchOption: string; /** - * 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-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. + * 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-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. * > **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) */ num: number; /** * A comma delimited list of ObjectIDs for the features in the layer being queried. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) */ objectIds: number[]; /** - * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. - * > **Known Limitations** + * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. + * > **Known Limitations** * * If querying a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), then `supportsAdvancedQueries` must be `true` on the service. * * For [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), `FeatureLayer.capabilities.queryRelated.supportsOrderBy` must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields) */ orderByFields: string[]; /** - * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. 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 smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. - * > **Known Limitations** + * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. 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 smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. + * > **Known Limitations** * * If specifying outFields as expressions on a feature service-based [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), the service capabilities `advancedQueryCapabilities.supportsOutFieldSQLExpression` and `useStandardizedQueries` must both be true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.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 not specified, the geometry is returned in the spatial reference of the queried layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** - * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). + * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). * > **Known Limitations** For service-based queries, `outStatistics` is only supported on layers where `supportsStatistics = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) */ outStatistics: StatisticDefinition[]; /** * Filters features from the layer based on pre-authored parameterized filters. When value is not specified for any parameter in a request, the default value, that is assigned during authoring time, gets used. Requires an ArcGIS Enterprise service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ parameterValues: QueryParameterValues[]; /** * Specifies the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#pixelSize) */ pixelSize: Symbol; /** - * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. Geometry coordinates are converted to integers by building a grid with a resolution matching the `quantizationParameters.tolerance`. Each coordinate is then snapped to one pixel on the grid. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ quantizationParameters: QueryQuantizationParameters; /** * Filters features from the layer that are within the specified range values. Requires ArcGIS Enterprise services 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ rangeValues: QueryRangeValues[]; /** - * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. + * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. * > **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) */ relationParameter: string; /** - * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnCentroid) - * + * * @default false */ returnCentroid: boolean; /** - * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). - * > **Known Limitations** + * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). + * > **Known Limitations** * * For service-based queries, this parameter applies only if the `supportsAdvancedQueries` capability of the layer is `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnDistinctValues) - * + * * @default false */ returnDistinctValues: boolean; /** - * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. + * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnExceededLimitFeatures) - * + * * @default true */ returnExceededLimitFeatures: boolean; /** - * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. * > **Known Limitations** For [FeatureLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html) queries, the precision of the returned geometries will only be as high as the view's scale resolution since geometries are quantized for improved performance on the view. The smaller the scale, the lower the resolution of the geometries. This limitation does not apply to [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [CSVLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are included in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) */ returnM: boolean; /** * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are included in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnZ) */ returnZ: boolean; /** - * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: - * + * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: + * * Value | Description * ------|------------- * intersects | Returns features from the layer or layer view that intersect the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). @@ -34099,58 +36308,58 @@ declare namespace __esri { * touches | Returns features from the layer or layer view that touch the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * within | Returns features from the layer or layer view that are completely within the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). If this value is specified, then the [relationParameter](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) must also be specified. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) - * + * * @default intersects */ spatialRelationship: string; /** - * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native + * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native * > **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#sqlFormat) - * + * * @default none */ sqlFormat: string; /** - * The zero-based index indicating where to begin retrieving features. This property hould be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * The zero-based index indicating where to begin retrieving features. This property should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. * > **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) */ start: number; /** * Shorthand for a where clause using "like". The field used is the display field defined in the services directory. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text) - * + * * @default null */ text: string; /** - * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). + * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). * > **Known Limitations** For service-based queries, this parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. * **Possible Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) */ units: string; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. Be sure to have the correct sequence of single and double quotes when writing the where clause in JavaScript. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) */ where: string; /** * Creates a deep clone of Query object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#clone) - * - * + * + * */ clone(): Query; } @@ -34158,11 +36367,11 @@ declare namespace __esri { interface QueryConstructor { /** * This class defines parameters for executing queries for features from a layer or layer view. Once a Query object's properties are defined, it can then be passed into an [executable function](?search=queryfeatures), which will return the features in a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) */ - new(properties?: QueryProperties): Query; + new (properties?: QueryProperties): Query; fromJSON(json: any): Query; } @@ -34172,202 +36381,202 @@ declare namespace __esri { interface QueryProperties { /** * Datum transformation used for projecting geometries in the query results when [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) is different than the layer's spatial reference. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#datumTransformation) */ datumTransformation?: number; /** * Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) in a spatial query. The [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) indicates the unit of measurement. In essence, setting this property creates a buffer at the specified size around the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). The query will use that buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship). If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) capability must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) */ distance?: number; /** * Specifies the geodatabase version to display for feature service queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#gdbVersion) */ gdbVersion?: string; /** - * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. * > **Known Limitations** [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) geometry types are currently not supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) */ geometry?: GeometryProperties; /** * Specifies the number of decimal places for geometries returned by the query operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometryPrecision) */ geometryPrecision?: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#historicMoment) */ historicMoment?: DateProperties; /** - * 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. + * 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) */ maxAllowableOffset?: number; /** - * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. + * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxRecordCountFactor) - * + * * @default 1 */ maxRecordCountFactor?: number; /** * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint`. If indicated, the xy footprint of each multipatch geometry will be returned in the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#multipatchOption) */ multipatchOption?: string; /** - * 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-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. + * 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-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. * > **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) */ num?: number; /** * A comma delimited list of ObjectIDs for the features in the layer being queried. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) */ objectIds?: number[]; /** - * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. - * > **Known Limitations** + * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. + * > **Known Limitations** * * If querying a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), then `supportsAdvancedQueries` must be `true` on the service. * * For [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), `FeatureLayer.capabilities.queryRelated.supportsOrderBy` must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields) */ orderByFields?: string[]; /** - * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. 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 smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. - * > **Known Limitations** + * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. 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 smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. + * > **Known Limitations** * * If specifying outFields as expressions on a feature service-based [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), the service capabilities `advancedQueryCapabilities.supportsOutFieldSQLExpression` and `useStandardizedQueries` must both be true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.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 not specified, the geometry is returned in the spatial reference of the queried layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** - * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). + * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). * > **Known Limitations** For service-based queries, `outStatistics` is only supported on layers where `supportsStatistics = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) */ outStatistics?: StatisticDefinitionProperties[]; /** * Filters features from the layer based on pre-authored parameterized filters. When value is not specified for any parameter in a request, the default value, that is assigned during authoring time, gets used. Requires an ArcGIS Enterprise service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ parameterValues?: QueryParameterValues[]; /** * Specifies the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#pixelSize) */ pixelSize?: SymbolProperties; /** - * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. Geometry coordinates are converted to integers by building a grid with a resolution matching the `quantizationParameters.tolerance`. Each coordinate is then snapped to one pixel on the grid. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ quantizationParameters?: QueryQuantizationParameters; /** * Filters features from the layer that are within the specified range values. Requires ArcGIS Enterprise services 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ rangeValues?: QueryRangeValues[]; /** - * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. + * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. * > **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) */ relationParameter?: string; /** - * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnCentroid) - * + * * @default false */ returnCentroid?: boolean; /** - * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). - * > **Known Limitations** + * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). + * > **Known Limitations** * * For service-based queries, this parameter applies only if the `supportsAdvancedQueries` capability of the layer is `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnDistinctValues) - * + * * @default false */ returnDistinctValues?: boolean; /** - * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. + * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnExceededLimitFeatures) - * + * * @default true */ returnExceededLimitFeatures?: boolean; /** - * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. * > **Known Limitations** For [FeatureLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html) queries, the precision of the returned geometries will only be as high as the view's scale resolution since geometries are quantized for improved performance on the view. The smaller the scale, the lower the resolution of the geometries. This limitation does not apply to [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [CSVLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; /** * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are included in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) */ returnM?: boolean; /** * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are included in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnZ) */ returnZ?: boolean; /** - * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: - * + * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: + * * Value | Description * ------|------------- * intersects | Returns features from the layer or layer view that intersect the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). @@ -34379,110 +36588,109 @@ declare namespace __esri { * touches | Returns features from the layer or layer view that touch the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * within | Returns features from the layer or layer view that are completely within the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). If this value is specified, then the [relationParameter](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) must also be specified. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) - * + * * @default intersects */ spatialRelationship?: string; /** - * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native + * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native * > **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#sqlFormat) - * + * * @default none */ sqlFormat?: string; /** - * The zero-based index indicating where to begin retrieving features. This property hould be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * The zero-based index indicating where to begin retrieving features. This property should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. * > **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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) */ start?: number; /** * Shorthand for a where clause using "like". The field used is the display field defined in the services directory. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text) - * + * * @default null */ text?: string; /** - * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). + * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). * > **Known Limitations** For service-based queries, this parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. * **Possible Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) */ units?: string; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. Be sure to have the correct sequence of single and double quotes when writing the where clause in JavaScript. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) */ where?: string; } - export interface QueryParameterValues extends Object { /** * The parameter name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ name: string; /** * Single value or array of values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ value: string | string[] | number | number[] | Date | Date[]; } - export interface QueryQuantizationParameters extends Object { /** * An extent defining the quantization grid bounds. Its [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) matches the input geometry spatial reference if one is specified for the query. Otherwise, the extent will be in the layer's spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ extent?: Extent; /** - * Geometry coordinates are optimized for viewing and displaying of data. **Possible Values:** view - * + * Geometry coordinates are optimized for viewing and displaying of data. **Possible Values:** view | edit + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ mode?: string; /** - * The integer's coordinates will be returned relative to the origin position defined by this property value. **Possible Values:** upper-left | lower-left - * + * The integer's coordinates will be returned relative to the origin position defined by this property value. **Possible Values:** upper-left | lower-left + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) - * + * * @default upper-left */ originPosition?: string; /** - * The size of one pixel in the units of outSpatialReference. This number is used to convert coordinates to integers by building a grid with a resolution matching the tolerance. Each coordinate is then snapped to one pixel on the grid. Consecutive coordinates snapped to the same pixel are removed for reducing the overall response size. The units of tolerance will match the units of outSpatialReference. If outSpatialReference is not specified, then tolerance is assumed to be in the units of the spatial reference of the layer. If tolerance is not specified, the maxAllowableOffset is used. If tolerance and maxAllowableOffset are not specified, a grid of 10,000 * 10,000 grid is used by default. - * + * The size of one pixel in the units of the [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). This number is used to convert coordinates to integers by building a grid with a resolution matching the tolerance. Each coordinate is then snapped to one pixel on the grid. Consecutive coordinates snapped to the same pixel are removed for reducing the overall response size. The units of tolerance will match the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). If `outSpatialReference` is not specified, then tolerance is assumed to be in the units of the spatial reference of the layer. If tolerance is not specified, the [maxAllowableOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) is used. If tolerance and `maxAllowableOffset` are not specified, a grid of 10,000 * 10,000 grid is used by default. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) + * + * @default 1 */ tolerance?: number; } - export interface QueryRangeValues extends Object { /** * The range id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ name: string; /** * Single value or value range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ values: number | number[]; @@ -34491,28 +36699,26 @@ declare namespace __esri { interface RasterData extends Accessor, JSONSupport { /** * Specifies the format of the raster data, such as "jpg", "tif", etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#format) */ format: string; /** * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater, this class can be used to specify an uploaded item as input by specifying the ItemID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#itemId) */ itemId: string; /** * URL to the location of the raster data file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#url) */ url: string; } interface RasterDataConstructor { - - - new(properties?: RasterDataProperties): RasterData; + new (properties?: RasterDataProperties): RasterData; fromJSON(json: any): RasterData; } @@ -34522,19 +36728,19 @@ declare namespace __esri { interface RasterDataProperties { /** * Specifies the format of the raster data, such as "jpg", "tif", etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#format) */ format?: string; /** * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater, this class can be used to specify an uploaded item as input by specifying the ItemID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#itemId) */ itemId?: string; /** * URL to the location of the raster data file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#url) */ url?: string; @@ -34543,19 +36749,19 @@ declare namespace __esri { interface RelationParameters extends Accessor { /** * The first array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries1) */ geometries1: Geometry[]; /** * The second array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries2) */ geometries2: Geometry[]; /** - * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. - * + * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. + * * Value | Description * ------|------------ * cross | Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline in common on the interior of the polygon which is not equivalent to the entire polyline. Cross is a Clementini operator. If either one of the geometries is empty, the geometries do not cross. @@ -34570,32 +36776,30 @@ declare namespace __esri { * relation | Allows specification of any relationship defined using the Shape Comparison Language. If this value is used, a value for `relationParameter` must be specified. * touch | The union of point touch and line touch. Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. For example, a point touches a polyline only if the point is coincident with one of the polyline end points. If either one of the two geometries is empty, the geometries are not touched. * within | Same as `in` but also allows polylines that are strictly on the boundaries of polygons to be considered in the polygon. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relation) */ relation: string; /** * The string describes the spatial relationship to be tested when `RelationParameters.relation = 'relation'`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. An example of a valid string is: `FFFTTT**`. Also see the description of [geometryEngine.relate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) for additional examples of valid strings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relationParameter) */ relationParameter: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface RelationParametersConstructor { - - - new(properties?: RelationParametersProperties): RelationParameters; + new (properties?: RelationParametersProperties): RelationParameters; } export const RelationParameters: RelationParametersConstructor; @@ -34603,19 +36807,19 @@ declare namespace __esri { interface RelationParametersProperties { /** * The first array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries1) */ geometries1?: GeometryProperties[]; /** * The second array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries2) */ geometries2?: GeometryProperties[]; /** - * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. - * + * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. + * * Value | Description * ------|------------ * cross | Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline in common on the interior of the polygon which is not equivalent to the entire polyline. Cross is a Clementini operator. If either one of the geometries is empty, the geometries do not cross. @@ -34630,14 +36834,14 @@ declare namespace __esri { * relation | Allows specification of any relationship defined using the Shape Comparison Language. If this value is used, a value for `relationParameter` must be specified. * touch | The union of point touch and line touch. Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. For example, a point touches a polyline only if the point is coincident with one of the polyline end points. If either one of the two geometries is empty, the geometries are not touched. * within | Same as `in` but also allows polylines that are strictly on the boundaries of polygons to be considered in the polygon. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relation) */ relation?: string; /** * The string describes the spatial relationship to be tested when `RelationParameters.relation = 'relation'`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. An example of a valid string is: `FFFTTT**`. Also see the description of [geometryEngine.relate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) for additional examples of valid strings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relationParameter) */ relationParameter?: string; @@ -34646,81 +36850,79 @@ declare namespace __esri { interface RelationshipQuery extends Accessor, JSONSupport { /** * 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 query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#gdbVersion) */ gdbVersion: string; /** * Specify the number of decimal places for the geometries returned by the query operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#geometryPrecision) */ geometryPrecision: number; /** * 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 [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; /** * 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. 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 `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 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) */ relationshipId: number; /** * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry makes up a significant portion of the response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * Creates a deep clone of RelationshipQuery object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#clone) - * - * + * + * */ clone(): RelationshipQuery; } interface RelationshipQueryConstructor { - - - new(properties?: RelationshipQueryProperties): RelationshipQuery; + new (properties?: RelationshipQueryProperties): RelationshipQuery; fromJSON(json: any): RelationshipQuery; } @@ -34730,63 +36932,63 @@ declare namespace __esri { interface RelationshipQueryProperties { /** * 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 query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#gdbVersion) */ gdbVersion?: string; /** * Specify the number of decimal places for the geometries returned by the query operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#geometryPrecision) */ geometryPrecision?: number; /** * 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 [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; /** * 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. 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 `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 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) */ relationshipId?: number; /** * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry makes up a significant portion of the response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; @@ -34795,71 +36997,71 @@ declare namespace __esri { interface RouteParameters extends Accessor { /** * The list of network attribute names to be accumulated with the analysis. For example, which attributes should be returned as part of the response. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. See also [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#accumulateAttributes) */ accumulateAttributes: string[]; /** * Each element in the array is an object that describes the parameter values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) */ attributeParameterValues: AttributeParamValue; /** * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1 an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#barriers) */ barriers: DataLayer | FeatureSet; /** * The language used when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). By default, NAServer gets installed with `en_US` only - it is up to the server administrator to add additional languages. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLanguage) */ directionsLanguage: string; /** * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) */ directionsLengthUnits: string; /** * Defines the amount of direction information returned. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType) - * + * * @default standard */ directionsOutputType: string; /** * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsStyleName) */ directionsStyleName: string; /** * The name of network attribute to use for the drive time when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute) */ directionsTimeAttribute: string; /** * If `true`, avoids network elements restricted by barriers or restrictions specified in [restrictionAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements: boolean; /** - * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: + * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: * ```js * routeParams.findBestSequence = true; * routeParams.preserveFirstStop = false; * routeParams.preserveLastStop = false; * routeParams.returnStops = true; * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#findBestSequence) */ findBestSequence: boolean; @@ -34867,179 +37069,183 @@ declare namespace __esri { * In routes where a stop is not located on a network or a stop could not be reached, the results will differ depending on the value of this property: * * When `false`, the solve operation will fail if at least one of the stops specified cannot be located or reached. * * When `true`, as long as there are at least two valid stops that have been connected by a route, a valid result is returned. If multiple routes are processed in a single request, as long as least one route is built, a valid result is returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#ignoreInvalidLocations) */ ignoreInvalidLocations: boolean; /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#impedanceAttribute) */ impedanceAttribute: string; /** * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to `IPolycurve.Generalize`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecision) */ outputGeometryPrecision: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits: string; /** * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** none | straight | true-shape | true-shape-with-measure - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputLines) - * + * * @default true-shape */ outputLines: string; /** * The well-known ID of the spatial reference for the geometries returned with the analysis results. If not specified, the geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polygonBarriers) */ polygonBarriers: DataLayer | FeatureSet; /** * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polylineBarriers) */ polylineBarriers: DataLayer | FeatureSet; /** * If `true`, keeps the first stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveFirstStop) */ preserveFirstStop: boolean; /** * If `true`, keeps the last stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveLastStop) */ preserveLastStop: boolean; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). Possible values are listed in the Service Directory under `Network Dataset -> Network Attributes`. You can also specify a value of `none` to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes) */ restrictionAttributes: string[]; /** * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) */ restrictUTurns: string; /** * If `true`, barriers are returned with the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnBarriers) - * + * * @default false */ returnBarriers: boolean; /** * If `true`, barriers are returned in the [directions property of each RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnDirections) - * + * * @default false */ returnDirections: boolean; /** * If `true`, polygon barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers: boolean; /** * If `true`, polyline barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers: boolean; /** * If `true`, routes are generated and returned in the route property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnRoutes) - * + * * @default true */ returnRoutes: boolean; /** * If `true`, stops are returned in the stops property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnStops) - * + * * @default false */ returnStops: boolean; /** * If `true`, `z` values are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnZ) - * + * * @default true */ returnZ: boolean; /** * The time the route begins. If not specified, the default is the time specified in the route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTime) */ startTime: Date; /** * If `true`, the start time will be in UTC format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTimeIsUTC) */ startTimeIsUTC: boolean; /** * The set of stops loaded as network locations during analysis. When `stops` takes a FeatureSet, each feature in the FeatureSet must have a defined spatial reference. If the feature contains `x` and `y` attributes, those values are used for the stop, even if the feature includes geometry. At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The `url` property can be specified using DataFile Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops) */ stops: DataLayer | FeatureSet; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#travelMode) + */ + travelMode: any; /** * If `true`, the hierarchy attribute for the network should be used in analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useHierarchy) */ useHierarchy: boolean; /** * A useful feature of the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) is the ability to constrain stop visits to certain times of day, or "time windows". If you were required to deliver orders to four homes and each customer was available during a limited time period during the day, the route task could help you find the most efficient path for making all the deliveries. Time windows are treated as a "soft" constraint. This means that although the solver attempts to honor time windows, if necessary, it will violate the time windows of some stops in order to reach them. Remember, the stops will be visited in the order they were added unless you set `RouteParameters.findBestSequence = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useTimeWindows) */ useTimeWindows: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface RouteParametersConstructor { - - - new(properties?: RouteParametersProperties): RouteParameters; + new (properties?: RouteParametersProperties): RouteParameters; } export const RouteParameters: RouteParametersConstructor; @@ -35047,71 +37253,71 @@ declare namespace __esri { interface RouteParametersProperties { /** * The list of network attribute names to be accumulated with the analysis. For example, which attributes should be returned as part of the response. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. See also [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#accumulateAttributes) */ accumulateAttributes?: string[]; /** * Each element in the array is an object that describes the parameter values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) */ attributeParameterValues?: AttributeParamValue; /** * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1 an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#barriers) */ barriers?: DataLayerProperties | FeatureSetProperties; /** * The language used when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). By default, NAServer gets installed with `en_US` only - it is up to the server administrator to add additional languages. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLanguage) */ directionsLanguage?: string; /** * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) */ directionsLengthUnits?: string; /** * Defines the amount of direction information returned. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType) - * + * * @default standard */ directionsOutputType?: string; /** * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsStyleName) */ directionsStyleName?: string; /** * The name of network attribute to use for the drive time when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute) */ directionsTimeAttribute?: string; /** * If `true`, avoids network elements restricted by barriers or restrictions specified in [restrictionAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements?: boolean; /** - * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: + * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: * ```js * routeParams.findBestSequence = true; * routeParams.preserveFirstStop = false; * routeParams.preserveLastStop = false; * routeParams.returnStops = true; * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#findBestSequence) */ findBestSequence?: boolean; @@ -35119,161 +37325,167 @@ declare namespace __esri { * In routes where a stop is not located on a network or a stop could not be reached, the results will differ depending on the value of this property: * * When `false`, the solve operation will fail if at least one of the stops specified cannot be located or reached. * * When `true`, as long as there are at least two valid stops that have been connected by a route, a valid result is returned. If multiple routes are processed in a single request, as long as least one route is built, a valid result is returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#ignoreInvalidLocations) */ ignoreInvalidLocations?: boolean; /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#impedanceAttribute) */ impedanceAttribute?: string; /** * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to `IPolycurve.Generalize`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecision) */ outputGeometryPrecision?: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits?: string; /** * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** none | straight | true-shape | true-shape-with-measure - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputLines) - * + * * @default true-shape */ outputLines?: string; /** * The well-known ID of the spatial reference for the geometries returned with the analysis results. If not specified, the geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polygonBarriers) */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polylineBarriers) */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; /** * If `true`, keeps the first stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveFirstStop) */ preserveFirstStop?: boolean; /** * If `true`, keeps the last stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveLastStop) */ preserveLastStop?: boolean; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). Possible values are listed in the Service Directory under `Network Dataset -> Network Attributes`. You can also specify a value of `none` to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes) */ restrictionAttributes?: string[]; /** * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) */ restrictUTurns?: string; /** * If `true`, barriers are returned with the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnBarriers) - * + * * @default false */ returnBarriers?: boolean; /** * If `true`, barriers are returned in the [directions property of each RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnDirections) - * + * * @default false */ returnDirections?: boolean; /** * If `true`, polygon barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers?: boolean; /** * If `true`, polyline barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers?: boolean; /** * If `true`, routes are generated and returned in the route property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnRoutes) - * + * * @default true */ returnRoutes?: boolean; /** * If `true`, stops are returned in the stops property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnStops) - * + * * @default false */ returnStops?: boolean; /** * If `true`, `z` values are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnZ) - * + * * @default true */ returnZ?: boolean; /** * The time the route begins. If not specified, the default is the time specified in the route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTime) */ startTime?: DateProperties; /** * If `true`, the start time will be in UTC format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTimeIsUTC) */ startTimeIsUTC?: boolean; /** * The set of stops loaded as network locations during analysis. When `stops` takes a FeatureSet, each feature in the FeatureSet must have a defined spatial reference. If the feature contains `x` and `y` attributes, those values are used for the stop, even if the feature includes geometry. At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The `url` property can be specified using DataFile Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops) */ stops?: DataLayerProperties | FeatureSetProperties; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#travelMode) + */ + travelMode?: any; /** * If `true`, the hierarchy attribute for the network should be used in analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useHierarchy) */ useHierarchy?: boolean; /** * A useful feature of the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) is the ability to constrain stop visits to certain times of day, or "time windows". If you were required to deliver orders to four homes and each customer was available during a limited time period during the day, the route task could help you find the most efficient path for making all the deliveries. Time windows are treated as a "soft" constraint. This means that although the solver attempts to honor time windows, if necessary, it will violate the time windows of some stops in order to reach them. Remember, the stops will be visited in the order they were added unless you set `RouteParameters.findBestSequence = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useTimeWindows) */ useTimeWindows?: boolean; @@ -35281,25 +37493,25 @@ declare namespace __esri { /** * An object describing the parameter values for the [attributeParameterValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) property of [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) */ export interface AttributeParamValue extends Object { /** * The name of the attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) */ attributeName: string; /** * The name of the parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) */ parameterName: string; /** * The parameter's value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) */ value: string; @@ -35308,34 +37520,32 @@ declare namespace __esri { interface RouteResult extends Accessor, JSONSupport { /** * Route directions are returned if `RouteParameters.returnDirections = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions) */ directions: DirectionsFeatureSet; /** * The Route graphic that is returned if `RouteParameters.returnRoutes = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#route) */ route: Graphic; /** * The name of the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#routeName) */ routeName: string; /** * Array of stops. Returned only if `RouteParameters.returnStops = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#stops) */ stops: Graphic[]; } interface RouteResultConstructor { - - - new(properties?: RouteResultProperties): RouteResult; + new (properties?: RouteResultProperties): RouteResult; fromJSON(json: any): RouteResult; } @@ -35345,25 +37555,25 @@ declare namespace __esri { interface RouteResultProperties { /** * Route directions are returned if `RouteParameters.returnDirections = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions) */ directions?: DirectionsFeatureSetProperties; /** * The Route graphic that is returned if `RouteParameters.returnRoutes = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#route) */ route?: GraphicProperties; /** * The name of the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#routeName) */ routeName?: string; /** * Array of stops. Returned only if `RouteParameters.returnStops = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#stops) */ stops?: GraphicProperties[]; @@ -35372,247 +37582,253 @@ declare namespace __esri { interface ServiceAreaParameters extends Accessor { /** * The list of network attribute names to be accumulated with the analysis (i.e. which attributes should be returned as part of the response). The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#accumulateAttributes) */ accumulateAttributes: string[]; /** * A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle. The parameter holding a vehicle characteristic is compared to a value coming from a descriptor attribute to determine whether or not a network element is traversable. For example, a parameterized restriction attribute can compare the height of your vehicle with a descriptor attribute that holds the clearance under overpasses through tunnels. If the vehicle's height is greater than the clearance, the edge is restricted. Parameterized cost attributes that reference other cost attributes and scale them, can also be used. This is useful when inclement weather like ice, fog or heavy rain, descends on the study area and hinders normal flow of traffic. By having a parameter already outfitted on a cost attribute, travel-time expectations and traversable network paths can be adjusted with respect to changes in traffic speeds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#attributeParameterValues) */ attributeParameterValues: any[]; /** * An array of numbers defining the breaks. The default value is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#defaultBreaks) */ defaultBreaks: number[]; /** * When `true`, restricted network elements should be considered when finding network locations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements: boolean; /** * An array of network source names to NOT use when generating polygons. This property specifies if certain network sources should be excluded from the service area polygon generation. A service area on a multi-modal network where only one mode is being used to compute the service area would get a more appropriate shape if other modes are excluded from the polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#excludeSourcesFromPolygons) */ excludeSourcesFromPolygons: string[]; /** * The set of facilities loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using `DataFile`. Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#facilities) */ facilities: DataLayer | FeatureSet; /** * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#impedanceAttribute) */ impedanceAttribute: string; /** * If `true`, similar ranges will be merged in the resulting polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#mergeSimilarPolygonRanges) - * + * * @default false */ mergeSimilarPolygonRanges: boolean; /** * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to IPolycurve.Generalize. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecision) */ outputGeometryPrecision: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * * Possible Value | Description * ---------------|------------ * none | No lines are returned * straight | Only returns straight lines * true-shape | Return the true shape of the lines * true-shape-with-measure | Return the true shape of the lines with their measurements - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines) */ outputLines: string; /** * The type of output polygons to be generated in the result. The default is as defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). **Possible Values:** none | simplified | detailed - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputPolygons) */ outputPolygons: string; /** * The well-known ID of the spatial reference for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * Indicates if the lines should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapLines) - * + * * @default false */ overlapLines: boolean; /** * Indicates if the polygons should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapPolygons) - * + * * @default false */ overlapPolygons: boolean; /** * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#pointBarriers) */ pointBarriers: DataLayer | FeatureSet; /** * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polygonBarriers) */ polygonBarriers: DataLayer | FeatureSet; /** * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polylineBarriers) */ polylineBarriers: DataLayer | FeatureSet; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictionAttributes) */ restrictionAttributes: string[]; /** - * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. - * + * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. + * * Possible Value | Description * ---------------|------------ * allow-backtrack | Allows U-turns on everywhere * at-dead-ends-only | Only allows U-turns at dead ends * no-backtrack | Restricts U-turns everywhere * at-dead-ends-and-intersections | Only allows U-turns at dead ends and intersections - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictUTurns) */ restrictUTurns: string; /** * If `true`, facilities will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnFacilities) - * + * * @default false */ returnFacilities: boolean; /** * If `true`, point barriers will be returned in the [pointBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPointBarriers) - * + * * @default false */ returnPointBarriers: boolean; /** * If `true`, polygon barriers will be returned in the [polygonBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers: boolean; /** * If `true`, polyline barriers will be returned in the [polylineBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers: boolean; /** * If `true`, lines will be split at breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitLinesAtBreaks) - * + * * @default false */ splitLinesAtBreaks: boolean; /** * If `true`, polygons will be split at breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitPolygonsAtBreaks) - * + * * @default false */ splitPolygonsAtBreaks: boolean; /** * Local date and time at the facility. If `travelDirection = "to-facility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "from-facility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#timeOfDay) */ timeOfDay: Date; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. - * + * Options for traveling to or from the facility. Default values are defined by the network layer. + * * Possible Value | Description * ---------------|------------ * from-facility | Sets travel direction from the facility * to-facility | Sets travel direction to the facility - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelDirection) */ travelDirection: string; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelMode) + */ + travelMode: any; /** * If `true`, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimOuterPolygon) - * + * * @default false */ trimOuterPolygon: boolean; /** * If polygons are being trimmed, provides the distance to trim. The default value is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance) */ trimPolygonDistance: number; /** * If polygons are being trimmed, specifies the units of [trimPolygonDistance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance). The default is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistanceUnits) */ trimPolygonDistanceUnits: string; /** * When `true`, the hierarchy attributes for the network will be used in the analysis. The default value is defined in the network layer. `useHierarchy` cannot be used in conjunction with [outputLines](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines). Requires an ArcGIS Server service version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#useHierarchy) */ useHierarchy: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } @@ -35620,11 +37836,11 @@ declare namespace __esri { interface ServiceAreaParametersConstructor { /** * Input parameters for [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html) */ - new(properties?: ServiceAreaParametersProperties): ServiceAreaParameters; + new (properties?: ServiceAreaParametersProperties): ServiceAreaParameters; } export const ServiceAreaParameters: ServiceAreaParametersConstructor; @@ -35632,237 +37848,243 @@ declare namespace __esri { interface ServiceAreaParametersProperties { /** * The list of network attribute names to be accumulated with the analysis (i.e. which attributes should be returned as part of the response). The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#accumulateAttributes) */ accumulateAttributes?: string[]; /** * A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle. The parameter holding a vehicle characteristic is compared to a value coming from a descriptor attribute to determine whether or not a network element is traversable. For example, a parameterized restriction attribute can compare the height of your vehicle with a descriptor attribute that holds the clearance under overpasses through tunnels. If the vehicle's height is greater than the clearance, the edge is restricted. Parameterized cost attributes that reference other cost attributes and scale them, can also be used. This is useful when inclement weather like ice, fog or heavy rain, descends on the study area and hinders normal flow of traffic. By having a parameter already outfitted on a cost attribute, travel-time expectations and traversable network paths can be adjusted with respect to changes in traffic speeds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#attributeParameterValues) */ attributeParameterValues?: any[]; /** * An array of numbers defining the breaks. The default value is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#defaultBreaks) */ defaultBreaks?: number[]; /** * When `true`, restricted network elements should be considered when finding network locations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements?: boolean; /** * An array of network source names to NOT use when generating polygons. This property specifies if certain network sources should be excluded from the service area polygon generation. A service area on a multi-modal network where only one mode is being used to compute the service area would get a more appropriate shape if other modes are excluded from the polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#excludeSourcesFromPolygons) */ excludeSourcesFromPolygons?: string[]; /** * The set of facilities loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using `DataFile`. Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#facilities) */ facilities?: DataLayerProperties | FeatureSetProperties; /** * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#impedanceAttribute) */ impedanceAttribute?: string; /** * If `true`, similar ranges will be merged in the resulting polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#mergeSimilarPolygonRanges) - * + * * @default false */ mergeSimilarPolygonRanges?: boolean; /** * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to IPolycurve.Generalize. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecision) */ outputGeometryPrecision?: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits?: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * * Possible Value | Description * ---------------|------------ * none | No lines are returned * straight | Only returns straight lines * true-shape | Return the true shape of the lines * true-shape-with-measure | Return the true shape of the lines with their measurements - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines) */ outputLines?: string; /** * The type of output polygons to be generated in the result. The default is as defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). **Possible Values:** none | simplified | detailed - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputPolygons) */ outputPolygons?: string; /** * The well-known ID of the spatial reference for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * Indicates if the lines should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapLines) - * + * * @default false */ overlapLines?: boolean; /** * Indicates if the polygons should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapPolygons) - * + * * @default false */ overlapPolygons?: boolean; /** * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#pointBarriers) */ pointBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polygonBarriers) */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polylineBarriers) */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictionAttributes) */ restrictionAttributes?: string[]; /** - * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. - * + * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. + * * Possible Value | Description * ---------------|------------ * allow-backtrack | Allows U-turns on everywhere * at-dead-ends-only | Only allows U-turns at dead ends * no-backtrack | Restricts U-turns everywhere * at-dead-ends-and-intersections | Only allows U-turns at dead ends and intersections - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictUTurns) */ restrictUTurns?: string; /** * If `true`, facilities will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnFacilities) - * + * * @default false */ returnFacilities?: boolean; /** * If `true`, point barriers will be returned in the [pointBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPointBarriers) - * + * * @default false */ returnPointBarriers?: boolean; /** * If `true`, polygon barriers will be returned in the [polygonBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers?: boolean; /** * If `true`, polyline barriers will be returned in the [polylineBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers?: boolean; /** * If `true`, lines will be split at breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitLinesAtBreaks) - * + * * @default false */ splitLinesAtBreaks?: boolean; /** * If `true`, polygons will be split at breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitPolygonsAtBreaks) - * + * * @default false */ splitPolygonsAtBreaks?: boolean; /** * Local date and time at the facility. If `travelDirection = "to-facility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "from-facility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#timeOfDay) */ timeOfDay?: DateProperties; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. - * + * Options for traveling to or from the facility. Default values are defined by the network layer. + * * Possible Value | Description * ---------------|------------ * from-facility | Sets travel direction from the facility * to-facility | Sets travel direction to the facility - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelDirection) */ travelDirection?: string; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelMode) + */ + travelMode?: any; /** * If `true`, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimOuterPolygon) - * + * * @default false */ trimOuterPolygon?: boolean; /** * If polygons are being trimmed, provides the distance to trim. The default value is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance) */ trimPolygonDistance?: number; /** * If polygons are being trimmed, specifies the units of [trimPolygonDistance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance). The default is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistanceUnits) */ trimPolygonDistanceUnits?: string; /** * When `true`, the hierarchy attributes for the network will be used in the analysis. The default value is defined in the network layer. `useHierarchy` cannot be used in conjunction with [outputLines](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines). Requires an ArcGIS Server service version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#useHierarchy) */ useHierarchy?: boolean; @@ -35871,43 +38093,43 @@ declare namespace __esri { interface ServiceAreaSolveResult extends Accessor, JSONSupport { /** * Array of points only returned if `ServiceAreaParameters.returnFacilities = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#facilities) */ facilities: Point[]; /** * Message received when solve is completed. If a service area cannot be solved, the message returned by the server identifies the incident that could not be solved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#messages) */ messages: NAMessage[]; /** * The point barriers are returned only if `ServiceAreaParameters.returnPointBarriers = true` (which is not the default). If you send in the point barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) */ pointBarriers: Point[]; /** * The polygon barriers are returned only if `ServiceAreaParameters.returnPolygonBarriers = true` (which is not the default). If you send in the polygon barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) */ polygonBarriers: Polygon[]; /** * The polyline barriers are returned only if `ServiceAreaParameters.returnPolylineBarriers = true` (which is not the default). If you send in the polyline barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) */ polylineBarriers: Polyline[]; /** * An array of service area polygon graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolygons) */ serviceAreaPolygons: Graphic[]; /** * An array of service area polyline graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolylines) */ serviceAreaPolylines: Graphic[]; @@ -35916,11 +38138,11 @@ declare namespace __esri { interface ServiceAreaSolveResultConstructor { /** * The result from [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html) */ - new(properties?: ServiceAreaSolveResultProperties): ServiceAreaSolveResult; + new (properties?: ServiceAreaSolveResultProperties): ServiceAreaSolveResult; fromJSON(json: any): ServiceAreaSolveResult; } @@ -35930,43 +38152,43 @@ declare namespace __esri { interface ServiceAreaSolveResultProperties { /** * Array of points only returned if `ServiceAreaParameters.returnFacilities = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#facilities) */ facilities?: PointProperties[]; /** * Message received when solve is completed. If a service area cannot be solved, the message returned by the server identifies the incident that could not be solved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#messages) */ messages?: NAMessageProperties[]; /** * The point barriers are returned only if `ServiceAreaParameters.returnPointBarriers = true` (which is not the default). If you send in the point barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) */ pointBarriers?: PointProperties[]; /** * The polygon barriers are returned only if `ServiceAreaParameters.returnPolygonBarriers = true` (which is not the default). If you send in the polygon barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) */ polygonBarriers?: PolygonProperties[]; /** * The polyline barriers are returned only if `ServiceAreaParameters.returnPolylineBarriers = true` (which is not the default). If you send in the polyline barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) */ polylineBarriers?: PolylineProperties[]; /** * An array of service area polygon graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolygons) */ serviceAreaPolygons?: GraphicProperties[]; /** * An array of service area polyline graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolylines) */ serviceAreaPolylines?: GraphicProperties[]; @@ -35975,28 +38197,35 @@ declare namespace __esri { interface StatisticDefinition extends Accessor, JSONSupport { /** * Defines the field for which statistics will be calculated. This can be service field names or SQL expressions. See the snippets below for examples. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#onStatisticField) */ onStatisticField: string; /** * Specifies the output field name for the requested statistic. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the server assigns a field name to the returned statistic field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#outStatisticFieldName) */ outStatisticFieldName: string; /** * Defines the type of statistic. **Possible Values:** count | sum | min | max | avg | stddev | var - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) */ statisticType: "count" | "sum" | "min" | "max" | "avg" | "stddev" | "var"; + + /** + * Creates a deep clone of StatisticDefinition object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#clone) + * + * + */ + clone(): StatisticDefinition; } interface StatisticDefinitionConstructor { - - - new(properties?: StatisticDefinitionProperties): StatisticDefinition; + new (properties?: StatisticDefinitionProperties): StatisticDefinition; fromJSON(json: any): StatisticDefinition; } @@ -36006,19 +38235,19 @@ declare namespace __esri { interface StatisticDefinitionProperties { /** * Defines the field for which statistics will be calculated. This can be service field names or SQL expressions. See the snippets below for examples. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#onStatisticField) */ onStatisticField?: string; /** * Specifies the output field name for the requested statistic. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the server assigns a field name to the returned statistic field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#outStatisticFieldName) */ outStatisticFieldName?: string; /** * Defines the type of statistic. **Possible Values:** count | sum | min | max | avg | stddev | var - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) */ statisticType?: "count" | "sum" | "min" | "max" | "avg" | "stddev" | "var"; @@ -36026,8 +38255,8 @@ declare namespace __esri { interface TrimExtendParameters extends Accessor { /** - * A flag used with the `trimExtend` operation. - * + * A flag used with the `trimExtend` operation. + * * Possible Value | Description * ---------------|------------- * default-curve-extension | The extension considers both ends of the path. The old ends remain and new points are added to the extended ends. The new points have attributes that are extrapolated from existing adjacent segments. @@ -36036,48 +38265,46 @@ declare namespace __esri { * no-end-attributes | When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. Instead the attributes will be empty. * no-extend-at-from | Do not extend the 'from' end of any path. * no-extend-at-to | Do not extend the 'to' end of any path. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#extendHow) - * + * * @default default-curve-extension */ extendHow: string; /** * The array of polylines to trim or extend. The structure of each geometry in the array is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#polylines) */ polylines: Polyline[]; /** * A polyline used as a guide for trimming or extending input polylines. The structure of the polyline is the same as the structure of the JSON polyline object returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#trimExtendTo) */ trimExtendTo: Polyline; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface TrimExtendParametersConstructor { - - - new(properties?: TrimExtendParametersProperties): TrimExtendParameters; + new (properties?: TrimExtendParametersProperties): TrimExtendParameters; } export const TrimExtendParameters: TrimExtendParametersConstructor; interface TrimExtendParametersProperties { /** - * A flag used with the `trimExtend` operation. - * + * A flag used with the `trimExtend` operation. + * * Possible Value | Description * ---------------|------------- * default-curve-extension | The extension considers both ends of the path. The old ends remain and new points are added to the extended ends. The new points have attributes that are extrapolated from existing adjacent segments. @@ -36086,22 +38313,22 @@ declare namespace __esri { * no-end-attributes | When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. Instead the attributes will be empty. * no-extend-at-from | Do not extend the 'from' end of any path. * no-extend-at-to | Do not extend the 'to' end of any path. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#extendHow) - * + * * @default default-curve-extension */ extendHow?: string; /** * The array of polylines to trim or extend. The structure of each geometry in the array is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#polylines) */ polylines?: PolylineProperties[]; /** * A polyline used as a guide for trimming or extending input polylines. The structure of the polyline is the same as the structure of the JSON polyline object returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#trimExtendTo) */ trimExtendTo?: PolylineProperties; @@ -36110,22 +38337,20 @@ declare namespace __esri { interface Task extends Accessor { /** * The [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for data requests. These options can also be controlled through the `requestOptions` method parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#requestOptions) */ requestOptions: any; /** * The ArcGIS Server REST service URL (usually of a Feature Service Layer or Map Service Layer) for use in a task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#url) */ url: string; } interface TaskConstructor { - - - new(properties?: TaskProperties): Task; + new (properties?: TaskProperties): Task; } export const Task: TaskConstructor; @@ -36133,13 +38358,13 @@ declare namespace __esri { interface TaskProperties { /** * The [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for data requests. These options can also be controlled through the `requestOptions` method parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#requestOptions) */ requestOptions?: any; /** * The ArcGIS Server REST service URL (usually of a Feature Service Layer or Map Service Layer) for use in a task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#url) */ url?: string; @@ -36148,127 +38373,131 @@ declare namespace __esri { interface ConfigurationTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#url) */ url: string; /** * Gets an array of all the user groups that are configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getAllGroups) - * + * * @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). - * + * */ getAllGroups(requestOptions?: any): IPromise; /** * Gets an array of all the users that are configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getAllUsers) - * + * * @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). - * + * */ getAllUsers(requestOptions?: any): IPromise; /** * Gets the properties and an array of geodatabase versions for a data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.dataWorkspaceId The unique id of the data workspace, whose version will be returned. * @param params.user The user name of the user who is requesting the information. * @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). - * + * */ - getDataWorkspaceDetails(params: ConfigurationTaskGetDataWorkspaceDetailsParams, requestOptions?: any): IPromise; + getDataWorkspaceDetails( + params: ConfigurationTaskGetDataWorkspaceDetailsParams, + requestOptions?: any + ): IPromise; /** * Gets a single user group in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getGroup) - * + * * @param groupId The unique id of the group whose information will be retrieved. * @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). - * + * */ getGroup(groupId: number, requestOptions?: any): IPromise; /** * Gets the detailed configuration properties of a job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getJobTypeDetails) - * + * * @param jobTypeId The unique id of a job type. * @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). - * + * */ getJobTypeDetails(jobTypeId: number, requestOptions?: any): IPromise; /** * Gets the configuration of a publicly accessible job query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getPublicJobQueryDetails) - * + * * @param queryId The unique id of public 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). - * + * */ getPublicJobQueryDetails(queryId: number, requestOptions?: any): IPromise; /** * Gets the [configuration information](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) specific to a Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getServiceInfo) - * + * * @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). - * + * */ getServiceInfo(requestOptions?: any): IPromise; /** * Gets an array of registered [table relationships](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getTableRelationshipsDetails) - * + * * @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). - * + * */ getTableRelationshipsDetails(requestOptions?: any): IPromise; /** * Gets information for a single user in the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUser) - * + * * @param user The user name of the user whose information will be returned. * @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). - * + * */ getUser(user: string, requestOptions?: any): IPromise; /** * Gets the configuration of a user-owned job query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.queryId The unique id of user query. * @param params.user The user name of the user who is requesting the information. * @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). - * + * */ - getUserJobQueryDetails(params: ConfigurationTaskGetUserJobQueryDetailsParams, requestOptions?: any): IPromise; + getUserJobQueryDetails( + params: ConfigurationTaskGetUserJobQueryDetailsParams, + requestOptions?: any + ): IPromise; /** * Gets all the job types a user is allowed to see and create. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getVisibleJobTypes) - * + * * @param user The user name of the user for whom the information will be retrieved. * @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). - * + * */ getVisibleJobTypes(user: string, requestOptions?: any): IPromise; } interface ConfigurationTaskConstructor { - - - new(properties?: ConfigurationTaskProperties): ConfigurationTask; + new (properties?: ConfigurationTaskProperties): ConfigurationTask; } export const ConfigurationTask: ConfigurationTaskConstructor; @@ -36276,39 +38505,37 @@ declare namespace __esri { interface ConfigurationTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#url) */ url?: string; } - export interface ConfigurationTaskGetDataWorkspaceDetailsParams extends Object { /** * The unique id of the data workspace, whose version will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) */ dataWorkspaceId: string; /** * The user name of the user who is requesting the information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) */ user: string; } - export interface ConfigurationTaskGetUserJobQueryDetailsParams extends Object { /** * The unique id of user query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) */ queryId: number; /** * The user name of the user who is requesting the information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) */ user: string; @@ -36316,19 +38543,19 @@ declare namespace __esri { /** * A geospatial database that will be used for editing in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) */ export interface DataWorkspace extends Object { /** * The unique id of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) */ id: string; /** * The name of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) */ name: string; @@ -36336,19 +38563,19 @@ declare namespace __esri { /** * The membership attributes of a group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) */ export interface GroupMembership extends Object { /** * The unique id for the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) */ id: number; /** * The name of the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) */ name: string; @@ -36356,25 +38583,25 @@ declare namespace __esri { /** * The type of hold that can be applied to suspend the execution of a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) */ export interface HoldType extends Object { /** * The description of the type of hold. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) */ description: string; /** * The unique id for the hold type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) */ id: number; /** * The name of the hold type - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) */ name: string; @@ -36382,25 +38609,25 @@ declare namespace __esri { /** * The properties of a job priority. Job priority is a way to assign a level of importance to the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) */ export interface JobPriority extends Object { /** * The description of the priority. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) */ description: string; /** * The name of the priority. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) */ name: string; /** * The unique id of the priority. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) */ value: number; @@ -36408,19 +38635,19 @@ declare namespace __esri { /** * A query that is available to the user to execute. A query returns jobs based on a specific criteria. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) */ export interface JobQuery extends Object { /** * The unique id for the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) */ id: number; /** * The name of the priority. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) */ name: string; @@ -36428,31 +38655,31 @@ declare namespace __esri { /** * A container of job queries, it can also contain nested containers with child job query containers under it. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ export interface JobQueryContainer extends Object { /** * One or more [job query containers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) which are nested under the parent container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ containers: JobQueryContainer[]; /** * The unique id for the container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ id: number; /** * The name of the query container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ name: string; /** * An array of [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) inside the query container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ queries: JobQuery[]; @@ -36460,49 +38687,49 @@ declare namespace __esri { /** * Detailed properties of a job query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ export interface JobQueryDetails extends Object { /** * An array of field aliases included in the select statement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ aliases: string[]; /** * An array of fields included in the select statement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ fields: string[]; /** * The unique id for the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ id: number; /** * The name of the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ name: string; /** * The field used to order the results returned by the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ orderBy: string; /** * An array of tables selected from and used in the where clause. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ tables: string[]; /** * The where clause used as filter for selecting job information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ where: string; @@ -36510,31 +38737,31 @@ declare namespace __esri { /** * Properties of a job status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ export interface JobStatus extends Object { /** * An alias name for the status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ caption: string; /** * The description of the type of status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ description: string; /** * The unique id for the status type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ id: number; /** * The name of the status type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ name: string; @@ -36542,37 +38769,37 @@ declare namespace __esri { /** * A list of properties that describe a job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ export interface JobType extends Object { /** * A category to group other similar job types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ category: string; /** * The description of the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ description: string; /** * The unique id for the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ id: string; /** * The name of the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ name: string; /** * The state of the job type. **Possible Values:** draft | active | retired - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ state: string; @@ -36580,121 +38807,121 @@ declare namespace __esri { /** * Detailed information of a job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ export interface JobTypeDetails extends Object { - /** - * The name of the geodatabase version that will be assigned the parent version of the job's geodatabase by default. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) - */ - defaultParentVersionName: string; /** * Indicates whether jobs of this type will have their workflows automatically executed, when created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ autoExecuteCreatedJobs: boolean; + /** + * Indicates whether jobs of this type allows users to modify the current data workspace in the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ + canDataWorkspaceChange: boolean; /** * The category of the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ category: string; /** * The name of the user or group that the job will be assigned to by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultAssignedTo: string; /** * Indicates whether the job is assigned to a user, group or unassigned by default. **Possible Values:** unassigned | user | group - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultAssignedType: string; /** * The unique id of the default data workspace of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultDataWorkspaceId: string; /** * The description that gets associated with the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultDescription: string; /** * The default due date of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultDueDate: string; /** * The duration for completing the job assigned by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultJobDuration: number; /** - * Indicates whether jobs of this type allows users to modify the current data workspace in the job. - * + * The name of the geodatabase version that will be assigned the parent version of the job's geodatabase by default. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ - canDataWorkspaceChange: boolean; + defaultParentVersionName: string; /** * The numeric priority value assigned to the job by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultPriority: string; /** * The default start date of this job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultStartDate: Date; /** * The description of the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ description: string; /** * The unique id automatically generated for this job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ id: string; /** * The naming scheme for this job type, which would serve as template for the name of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ jobNamingScheme: string; /** * The naming scheme for this job type, which would serve as template for the name of job's version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ jobVersionNamingScheme: string; /** * The naming scheme for this job type, which would serve as template for the name of job's map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ mxdNamingScheme: string; /** * The job type name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ name: string; /** * The state of the job type. **Possible Values:** draft | active | retired - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ state: string; @@ -36702,25 +38929,25 @@ declare namespace __esri { /** * A privilege in the Workflow Manager system that controls application access. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) */ export interface Privilege extends Object { /** * The description of the privilege. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) */ description: string; /** * The unique id for the privilege. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) */ id: number; /** * The name of the privilege. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) */ name: string; @@ -36728,31 +38955,31 @@ declare namespace __esri { /** * TableRelationship represents a list of extended properties tables and the properties that identify them like name and cardinality. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ export interface TableRelationship extends Object { /** * The type of extra property table relationship, one-to-one represents one row for each property and one-to-many represents there will be multiple values for the property. **Possible Values:** one-to-one | one-to-many - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ cardinality: string; /** * The foreign key field used to join the jobs table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ linkField: string; /** * The alias name of the table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ tableAlias: string; /** * The name of the extended properties table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ tableName: string; @@ -36760,85 +38987,85 @@ declare namespace __esri { /** * A list of properties including groups and privileges associated with a Workflow Manager user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ export interface UserDetails extends Object { - /** - * The last name of the user. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) - */ - lastName: string; /** * The address of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ address: string; + /** + * The email address of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ + email: string; /** * The fax number of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ faxNumber: string; /** * The first name of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ firstName: string; /** * The full name of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ fullName: string; /** * An array of [group memberships](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ groups: GroupMembership[]; /** - * The email address of the user. - * + * The last name of the user. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ - email: string; + lastName: string; /** * The phone number of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ phoneNumber: string; /** * An array of [application privileges](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ privileges: Privilege[]; /** * The room number of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ roomNumber: string; /** * The login username for the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ userName: string; /** * An array of [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) owned by the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ userQueries: JobQueryContainer[]; /** * The zip code of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ zipCode: string; @@ -36846,25 +39073,25 @@ declare namespace __esri { /** * A list of properties that describe a geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) */ export interface VersionInfo extends Object { /** * The level of access to the geodatabase version. **Possible Values:** esriVersionAccessPrivate | esriVersionAccessPublic | esriVersionAccessProtected - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) */ access: string; /** * The name of the geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) */ name: string; /** * The name of the parent version of the geodatabase. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) */ parent: string; @@ -36872,161 +39099,160 @@ declare namespace __esri { /** * The base properties of a Workflow Manager service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ export interface WorkflowManagerServiceInfo extends Object { - /** - * An array of [job priorities](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) in the Workflow Manager system. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) - */ - jobPriorities: JobPriority[]; /** * An array of activity types in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ activityTypes: ActivityType[]; + /** + * The configuration properties of the Workflow Manager system stored in the database table as key/value pairs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ + configProperties: WorkflowManagerServiceInfoConfigProperties; /** * The current software version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ currentVersion: number; /** * An array of [data workspaces](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ dataWorkspaces: DataWorkspace[]; /** * An array of [hold types](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ holdTypes: HoldType[]; /** - * The configuration properties of the Workflow Manager system stored in the database table as key/value pairs. - * + * An array of [job priorities](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) in the Workflow Manager system. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ - configProperties: WorkflowManagerServiceInfoConfigProperties; + jobPriorities: JobPriority[]; /** * An array of [job statuses](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ jobStatuses: JobStatus[]; /** * An array of [job types](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ jobTypes: JobType[]; /** * An array of notification types in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ notificationTypes: NotificationType[]; /** * An array of [privileges](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ privileges: Privilege[]; /** * The array of [public queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ publicQueries: JobQueryContainer[]; } - export interface WorkflowManagerServiceInfoConfigProperties extends Object { /** * Indicates whether the location of interest (LOI) for jobs are allowed to overlap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AOIOVERLAP: string; /** * The color of the current job's LOI when selected in the LOI tab. The value is in range of 0 to 167772155. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AOISELECTIONCOLOR: number; /** * Indicates whether the job will be automatically assigned based on step assignment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AUTOASSIGNJOB: boolean; /** * Indicates whether the job will be automatically closed after the last step in the workflow is marked as complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AUTOCLOSEJOB: boolean; /** * Indicates whether the job workflow witll be automatically committed to the database when saved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AUTOCOMMITWORKFLOW: boolean; /** * Indicates whether the status of the jobs will be automatically assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AUTOSTATUSASSIGN: boolean; /** * Indicates whether the user will be required to confirm that they want to mark the current procedural step as complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ CONFIRMPROCEDURALCHECK: boolean; /** * The default email address to be used in the sender field when sending notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ DEFAULT_SENDER_EMAIL: string; /** * The default name displayed to be used in the sender field when sending notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ DEFAULT_SENDER_NAME: string; /** * Indicates whether notifications will be sent as HTML. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ HTML_SUPPORT: string; /** * The starting value of job ids in the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ JOB_ID_START_VALUE: string; /** * Indicates whether the the number of days for each hold is taken out of the pending days calculation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ PENDING_DAYS_USE_HOLDS: boolean; /** * Indicates whether the user attempting to delete a job version would be prompted to enter a password for the sde owner of the versions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ PROMPTSDEPWD: boolean; /** * Indicates whether it will be required to mark procedural steps as started. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ REQUIREPROCEDURALCHECKSTART: number; @@ -37035,103 +39261,103 @@ declare namespace __esri { * * `Warn` - Warn users when selecting features outside the job AOI. * * `NoSelect` - Prevent users from selecting features outside the job AOI. * * `Off` - Allow edits to features outside the job AOI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ RESTRICT_AOI_OPTION: string; /** * Indicates whether the spatial notifications will be sent on Workflow Manager Post. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SEND_SN_CUSTOM_POST: boolean; /** * Indicates whether to show step ids on workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SHOW_STEP_IDS: boolean; /** * Indicates whether the step completion percentage will be displayed on the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SHOW_STEP_PERCENT_COMPLETE: boolean; /** * The password of the authenticated SMTP user in the secure SMTP server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_PASSWORD: string; /** * Indicates whether the pending days will be displayed in the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SHOW_PENDING_DAYS: boolean; /** * The SMTP server port to be used for sending notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_PORT: string; /** * SMTP Authentication protocol. **Possible Values:** SSL | TLS - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_PROTOCOL: string; /** * The name of the SMTP Server to be used for sending notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_SERVER: string; /** * The user name that is authenticated in the secure SMTP server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_USERNAME: string; /** * Indicates whether to use step status assignment such that the job's status updates to match the step status when the step is reached. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ USE_STEP_STATUS: boolean; /** * Indicates the user store of the Workflow Manager system, whether the users will be stored in a Portal or the Workflow Manager system. **Possible Values:** traditional | portal - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ USER_STORE: string; /** * Indicates whether a user will be authenticated using domain along with the user name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ USEUSERDOMAIN: boolean; /** * The fill color of a selected step in a workflow. The value is in range of 0 to 167772155. When the option is disabled it's value is -1. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ WF_SEL_STEP_FILL_COLOR: number; /** * The outline color of a selected step in a workflow. The value is in range of 0 to 167772155. When the option is disabled it's value is -1. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ WF_SEL_STEP_OUTLINE_COLOR: number; /** * The outline width of a selected step in a workflow. **Possible Values:** 1 | 2 | 3 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ WF_SEL_STEP_OUTLINE_WIDTH: number; /** * Indicates whether the LOI of the job will be automatically zoomed to in the LOI tab. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ ZOOMTOAOI: boolean; @@ -37140,82 +39366,82 @@ declare namespace __esri { interface JobTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#url) */ url: string; /** * Uploads a file and attaches it to the job as an embedded attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.form The form element that contains the file input control. The form parameter can be an instance of FormData. Using FormData you can send a "multipart/form-data" request to the server without having to create an HTML form element in markup. Note that the FormData api is not available in all browsers. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ addEmbeddedAttachment(params: JobTaskAddEmbeddedAttachmentParams, requestOptions?: any): IPromise; /** * Adds a linked attachment to a job (url or file). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.attachmentType The type of attachment to be added. **Possible Values:** linked-file | url * @param params.path The file path to the attachment. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ addLinkedAttachment(params: JobTaskAddLinkedAttachmentParams, requestOptions?: any): IPromise; /** * Adds a linked property record to a job's linked properties table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.tableName The name of the table to which the record will be added. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ addLinkedRecord(params: JobTaskAddLinkedRecordParams, requestOptions?: any): IPromise; /** * Assigns one or more jobs to a user or group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.assignedType Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group * @param params.assignedTo The name of the user or group to whom the job will be assigned. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ assignJobs(params: JobTaskAssignJobsParams, requestOptions?: any): IPromise; /** * Closes one or more jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ closeJobs(params: JobTaskCloseJobsParams, requestOptions?: any): IPromise; /** * Creates a job dependency. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.heldOnType Indicates whether the current job (to which the dependency is being added) will be held at a step, stage or status. **Possible Values:** step | stage | status @@ -37225,347 +39451,353 @@ declare namespace __esri { * @param params.depOnValue The value of the step or status of the other job on which the current job will be dependent. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ createDependency(params: JobTaskCreateDependencyParams, requestOptions?: any): IPromise; /** * Creates a job hold. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.holdTypeId The unique id representing the hold type to be placed on the job. * @param params.comments Reason or more detailed information regarding why the hold is being added. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ createHold(params: JobTaskCreateHoldParams, requestOptions?: any): IPromise; /** * Creates new jobs based on the provided parameters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobs) - * + * * @param params The parameters to be used for job creation, parameters defined in the job type can be overwritten. The jobTypeId and user are required parameters when creating a job. * @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). - * + * */ createJobs(params: JobCreationParameters, requestOptions?: any): IPromise; /** * Creates a version specific to the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.name The name of the version to be created. * @param params.parent The name of the job's assigned geodatabase (data workspace) version, based on which the new version will be created. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ createJobVersion(params: JobTaskCreateJobVersionParams, requestOptions?: any): IPromise; /** * Deletes an attachment from a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.attachmentId The unique id of the attachment to be deleted. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ deleteAttachment(params: JobTaskDeleteAttachmentParams, requestOptions?: any): IPromise; /** * Deletes a job dependency. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.dependencyId The unique id of the dependency to be deleted. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ deleteDependency(params: JobTaskDeleteDependencyParams, requestOptions?: any): IPromise; /** * Delete one or more jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.deleteHistory Indicates whether or not to delete the associated job history, the default is to delete job history. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ deleteJobs(params: JobTaskDeleteJobsParams, requestOptions?: any): IPromise; /** * Deletes a record from a job's linked properties table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.tableName The name of the table from which linked record will be deleted. * @param params.recordId The unique id of the record in the table. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ deleteLinkedRecord(params: JobTaskDeleteLinkedRecordParams, requestOptions?: any): IPromise; /** * Gets the activity log for a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getActivityLog) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getActivityLog(jobId: number, requestOptions?: any): IPromise; /** * Gets the URL to access the file content of an embedded job attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.attachmentId The Id of the attachment to be retrieved. - * + * */ getAttachmentContentUrl(params: JobTaskGetAttachmentContentUrlParams): string; /** * Gets all the attachments associated with the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachments) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getAttachments(jobId: number, requestOptions?: any): IPromise; /** * Gets an array of dependencies configured for a job. A job with a dependency is held at a step, stage or status of the other job, and cannot progress until the other job reaches the step, stage or status defined in the dependency. Once the other job reaches step, stage or status as defined in the dependency criteria the dependency is released and the dependent job can progress. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getDependencies) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getDependencies(jobId: number, requestOptions?: any): IPromise; /** * Gets an array of [extended properties](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) for a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getExtendedProperties) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getExtendedProperties(jobId: number, requestOptions?: any): IPromise; /** * Gets an array of holds on a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getHolds) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getHolds(jobId: number, requestOptions?: any): IPromise; /** * Gets the [job](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) object based on the given id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getJob) - * + * * @param jobId The unique id of the job to be retrieved. * @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). - * + * */ getJob(jobId: number, requestOptions?: any): IPromise; /** * Gets all the job ids in the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getJobIds) - * + * * @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). - * + * */ getJobIds(requestOptions?: any): IPromise; /** * Gets the notes for a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getNotes) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getNotes(jobId: number, requestOptions?: any): IPromise; /** * Gets an array of [values and descriptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) for a geodatabase domain or table list extended property field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.tableName The name of the extended property table. * @param params.field The field name of the extended property for which to retrieve values. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ listFieldValues(params: JobTaskListFieldValuesParams, requestOptions?: any): IPromise; /** * Gets an array of [display values](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) for a given fields that comprise a multi-level table list extended property. As each display field is selected, for example using a dropdown UI control, this method can be called to obtain a list of values to display in the subsequent dropdown control. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.field The name of the field. * @param params.previousSelectedValues The array of previous values, on which the current value is dependent on. For example, when selecting a city based on the state and county. The value for the state and county would be the previous values. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ - listMultiLevelFieldValues(params: JobTaskListMultiLevelFieldValuesParams, requestOptions?: any): IPromise; + listMultiLevelFieldValues( + params: JobTaskListMultiLevelFieldValuesParams, + requestOptions?: any + ): IPromise; /** * Logs an action in a job's activity log. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.activityTypeId The unique id representing the [activity type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) of the action associated with this log record. * @param params.comments The comment that is added to the history. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ logAction(params: JobTaskLogActionParams, requestOptions?: any): IPromise; /** * Queries the jobs using the queryId of an existing query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.queryId The unique id of a query, used to query jobs in the database. * @param params.user The username of the user who is requesting 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). - * + * */ queryJobs(params: JobTaskQueryJobsParams, requestOptions?: any): IPromise; /** * Queries the jobs using an ad-hoc query definition and gets the [query result](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobsAdHoc) - * + * * @param params The [parameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) to query jobs. * @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). - * + * */ queryJobsAdHoc(params: JobQueryParameters, requestOptions?: any): IPromise; /** * Gets an array of string values representing the current display values for each display field in a multi-level table list extended property. The values from this method should be used to pre-select items in dropdown lists when initially displaying the extended properties of a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.field The name of the field. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ - queryMultiLevelSelectedValues(params: JobTaskQueryMultiLevelSelectedValuesParams, requestOptions?: any): IPromise; + queryMultiLevelSelectedValues( + params: JobTaskQueryMultiLevelSelectedValuesParams, + requestOptions?: any + ): IPromise; /** * Releases a job hold. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.holdId The unique id of the hold. * @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). - * + * */ releaseHold(params: JobTaskReleaseHoldParams, requestOptions?: any): IPromise; /** * Reopens one or more closed jobs. Supported from 10.3 onwards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ reopenClosedJobs(params: JobTaskReopenClosedJobsParams, requestOptions?: any): IPromise; /** * Performs a freeform text search and returns a set of matching job records. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.text The text which will be used to perform the search. * @param params.user The username of the user who is requesting search. * @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). - * + * */ searchJobs(params: JobTaskSearchJobsParams, requestOptions?: any): IPromise; /** * Unassigns one or more jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ unassignJobs(params: JobTaskUnassignJobsParams, requestOptions?: any): IPromise; /** * Update a job's properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateJob) - * + * * @param params The [parameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) to be used for job properties update, the jobId and the user are required when updating jobs. * @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). - * + * */ updateJob(params: JobUpdateParameters, requestOptions?: any): IPromise; /** * Updates the notes for a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.notes The new notes for the job. Set to an empty (zero-length) string to clear the job notes. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ updateNotes(params: JobTaskUpdateNotesParams, requestOptions?: any): IPromise; /** * Updates the values of an extended or linked properties record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.record The record to be updated. * @param params.user The user name of the user who is requesting the change. * @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). - * + * */ updateRecord(params: JobTaskUpdateRecordParams, requestOptions?: any): IPromise; } @@ -37573,11 +39805,11 @@ declare namespace __esri { interface JobTaskConstructor { /** * Helps you work with Workflow Manager jobs. A job is a single unit of work that is carried out within an organization. Various methods are available in the class to work with the following: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html) */ - new(properties?: JobTaskProperties): JobTask; + new (properties?: JobTaskProperties): JobTask; } export const JobTask: JobTaskConstructor; @@ -37585,7 +39817,7 @@ declare namespace __esri { interface JobTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#url) */ url?: string; @@ -37593,31 +39825,31 @@ declare namespace __esri { /** * ActivityType represents an activity type template that gets logged on a job when a certain event is fired in the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ export interface ActivityType extends Object { /** * The description of the activity being recorded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ desription: string; /** * The unique id of the activity that is logged. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ id: number; /** * The message that will be logged when this type of activity occurs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ message: string; /** * The name of the activity that occurred. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ name: string; @@ -37625,25 +39857,25 @@ declare namespace __esri { /** * AuxRecord represents the extended/linked properties record information associated with a job so that you can fetch or update the information for a specified record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) */ export interface AuxRecord extends Object { /** * The display value of the record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) */ displayProperty: any; /** * The unique id of the record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) */ id: number; /** * The array of the values in the [records](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) */ recordvalues: AuxRecordValue; @@ -37651,31 +39883,31 @@ declare namespace __esri { /** * AuxRecordContainer represents the extended/linked properties table characteristics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ export interface AuxRecordContainer extends Object { /** * The array of extended property [records](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ records: AuxRecord; /** * The type of extended property relationship. **Possible Values:** one-to-one | one-to-many - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ relationshipType: string; /** * The table alias. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ tableAlias: string; /** * The table name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ tableName: string; @@ -37683,25 +39915,25 @@ declare namespace __esri { /** * AuxRecordDescription represents the type of value that is captured in a specific AuxRecord field. There are multiple data types supported in Workflow Manager like - file, folder, text, date, etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) */ export interface AuxRecordDescription extends Object { /** * The array of property/value pairs of the record. - * + * * [Read more...](properties.html) */ properties: any; /** * The unique id of the record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) */ recordId: number; /** * The table name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) */ tableName: string; @@ -37709,97 +39941,97 @@ declare namespace __esri { /** * AuxRecordValue represents the values of extended/linked properties associated with a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ export interface AuxRecordValue extends Object { - /** - * The filter to restrict the types of records supported. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) - */ - filter: string; /** * The alias for the field in the table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ alias: string; + /** + * Indicates whether the extended property value can be updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ + canUpdate: boolean; /** * The data contained in the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ data: any; /** * The type of data expected in the field. **Possible Values:** small-integer | integer | single | double | string | date | oid | geometry | blob | raster | guid | global-id | xml - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ dataType: string; /** * The order each field is displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ displayOrder: number; /** * The type of extended property item. **Possible Values:** default | text | date | domain | file | geo-file | folder | list | table-list | multi-level-table-list - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ displayType: string; /** * The domain value configured for the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ domain: string; /** - * Indicates whether the extended property value can be updated. - * + * The filter to restrict the types of records supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ - canUpdate: boolean; + filter: string; /** * The length of the property string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ length: number; /** * The name property associated with the record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ name: string; /** * Indicates whether the property is a required or optional field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ required: boolean; /** * The lookup table that contains the list of values which will be selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ tableListClass: string; /** * The field that will be displayed for the extended property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ tableListDisplayField: string; /** * The field that contains the value that gets stored as the extended property value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ tableListStoreField: string; /** * Indicates whether the value will be visible to the user or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ userVisible: boolean; @@ -37807,19 +40039,19 @@ declare namespace __esri { /** * FieldValue represents a single entry of a geodatabase domain or table list, applicable to constraining the values of an extended or linked property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) */ export interface FieldValue extends Object { /** * The description of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) */ description: string; /** * The value that is stored for the extended properties record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) */ value: any; @@ -37827,31 +40059,31 @@ declare namespace __esri { /** * JobAttachment represents an attachments associated with a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ export interface JobAttachment extends Object { /** * The name of the file attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ filename: string; /** * The file folder path or a URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ folder: string; /** * The unique id of the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ id: number; /** * The storage type of the attachment. **Possible Values:** linked-file | embedded | url - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ storageType: string; @@ -37859,109 +40091,109 @@ declare namespace __esri { /** * JobCreationParameters provides information about the properties used for creating a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ export interface JobCreationParameters extends Object { - /** - * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) - */ - loi: Geometry; /** * The name of the user or group to whom the job will be assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ assignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ + assignedType: string; /** * Indicates whether the workflow will be automatically committed upon creation of the job. The workflow cannot be edited after being committed to the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ autoCommitWorkflow: boolean; /** * Indicates whether the job workflow will start execution automatically upon creation of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ autoExecute: boolean; /** * The unique id of the data workspace of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ dataWorkspaceId: string; /** * The description of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ description: string; /** * The date on which the job is expected to be complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ dueDate: Date; /** * The unique id of the job type from which to create the new job from. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ jobTypeId: number; /** - * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group - * + * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ - assignedType: string; + loi: Geometry; /** * The name of the new job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ name: string; /** * The number of jobs to be created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ numJobs: string; /** * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ ownedBy: string; /** * The unique id of the job that will be designated as the parent job of the new job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ parentJobId: number; /** * The name of the geodatabase version that will be the parent version of the new job's version. By default it will be the parent version of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ parentVersion: string; /** * The numeric value to denote priority of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ priority: number; /** * The date on which the job is scheduled to begin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ startDate: Date; /** * The username of the user creating the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ user: string; @@ -37969,49 +40201,49 @@ declare namespace __esri { /** * JobDependency represents a dependency associated with a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ export interface JobDependency extends Object { /** * The unique id of the job on which the current job depends. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ depJobId: number; /** * Indicates whether the job is dependent on a step, stage or status of the other job. **Possible Values:** step | stage | status - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ depOnType: string; /** * The value of the step, stage or status of the other job on which the current job is dependent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ depOnValue: string; /** * The value of the step, stage or status at which the current job will be held. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ heldOnValue: number; /** * Indicates whether the job is held at a step, stage or status. **Possible Values:** step | stage | status - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ holdOnType: string; /** * The unique id of the dependency. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ id: number; /** * The unique id of the job on which the dependency exists. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ jobID: string; @@ -38019,157 +40251,157 @@ declare namespace __esri { /** * JobInfo represents a collection of job properties - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ export interface JobTaskJobInfo extends Object { - /** - * The name of the job. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) - */ - name: string; /** * The name of the user or group to whom the job is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ assignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ + assignedType: string; /** * An array of unique job ids designated as child jobs for the current job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ childJobIds: number[]; /** * The user name of the person that created the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ createdBy: string; /** * The date the job was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ createdDate: Date; /** * The unique id of the data workspace of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ dataWorkspaceId: string; /** * The description of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ description: string; /** * The date on which the job is expected to be complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ dueDate: Date; /** * The actual date the job's workflow was completed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ endDate: Date; /** * The unique id to identify the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ id: number; /** * The unique id of the job type whose instance is the current job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ jobTypeId: number; /** * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ loi: Geometry; /** - * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group - * + * The name of the job. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ - assignedType: string; + name: string; /** * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ ownedBy: string; /** * The unique id of the job that will be designated as the parent job of the new job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ parentJobId: number; /** * The name of the geodatabase version that is the parent version of the job's version. By default it will be the parent version of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ parentVersion: string; /** * The number of days that the job has been active. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ pendingDays: number; /** * The percentage of work completed on the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ percentageComplete: number; /** * The numeric value to denote priority of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ priority: number; /** * The internal stage of the job which corresponds to the status of the job. **Possible Values:** created | ready | working | done | closed - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ stage: string; /** * The date on which the job is scheduled to begin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ startDate: Date; /** * The numeric value to represent the current status of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ status: number; /** * Indicates whether a version exists for the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ versionExists: boolean; /** * The information about job's geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ versionInfo: JobVersionInfo; /** * The name of the job's geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ versionName: string; @@ -38177,589 +40409,565 @@ declare namespace __esri { /** * JobQueryParameters is a full query definition of the selected query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ export interface JobQueryParameters extends Object { /** * An alias of fields included in the select statement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ aliases: string; /** * An array of fields included in the select statement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ fields: string; /** * The field that will be used to order the results returned by the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ orderBy: string; /** * The tables that will be used in the where clause for selection. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ tables: string; /** * The where clause used as a filter for selecting job information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ where: string; /** * The username of the user who is requesting query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ user: string; } - export interface JobTaskAddEmbeddedAttachmentParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) */ jobId: number; /** * The form element that contains the file input control. The form parameter can be an instance of FormData. Using FormData you can send a "multipart/form-data" request to the server without having to create an HTML form element in markup. Note that the FormData api is not available in all browsers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) */ form: any; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) */ user: string; } - export interface JobTaskAddLinkedAttachmentParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) */ jobId: number; /** * The type of attachment to be added. **Possible Values:** linked-file | url - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) */ attachmentType: number; /** * The file path to the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) */ path: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) */ user: string; } - export interface JobTaskAddLinkedRecordParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) */ jobId: number; /** * The name of the table to which the record will be added. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) */ tableName: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) */ user: string; } - export interface JobTaskAssignJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) */ jobIds: number[]; /** * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) */ assignedType: string; /** * The name of the user or group to whom the job will be assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) */ assignedTo: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) */ user: string; } - export interface JobTaskCloseJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) */ jobIds: number[]; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) */ user: string; } - export interface JobTaskCreateDependencyParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ jobId: number; /** * Indicates whether the current job (to which the dependency is being added) will be held at a step, stage or status. **Possible Values:** step | stage | status - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ heldOnType: string; /** * The value of the step, stage or status at which the current job will be held. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ heldOnValue: number; /** * The unique id of the job on which the current job will depend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ depJobId: number; /** * Indicates whether the current job (to which the dependency is being added) will be dependent on a step, stage or status of the other job. **Possible Values:** step | stage | status - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ depOnType: string; /** * The value of the step or status of the other job on which the current job will be dependent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ depOnValue: number; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ user: string; } - export interface JobTaskCreateHoldParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) */ jobId: number; /** * The unique id representing the hold type to be placed on the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) */ holdTypeId: number; /** * Reason or more detailed information regarding why the hold is being added. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) */ comments: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) */ user: string; } - export interface JobTaskCreateJobVersionParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) */ jobId: number; /** * The name of the version to be created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) */ name: string; /** * The name of the job's assigned geodatabase (data workspace) version, based on which the new version will be created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) */ parent: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) */ user: string; } - export interface JobTaskDeleteAttachmentParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) */ jobId: number; /** * The unique id of the attachment to be deleted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) */ attachmentId: number; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) */ user: string; } - export interface JobTaskDeleteDependencyParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) */ jobId: number; /** * The unique id of the dependency to be deleted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) */ dependencyId: number; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) */ user: string; } - export interface JobTaskDeleteJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) */ jobIds: number[]; /** * Indicates whether or not to delete the associated job history, the default is to delete job history. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) */ deleteHistory?: boolean; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) */ user: string; } - export interface JobTaskDeleteLinkedRecordParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) */ jobId: number; /** * The name of the table from which linked record will be deleted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) */ tableName: string; /** * The unique id of the record in the table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) */ recordId: number; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) */ user: string; } - export interface JobTaskGetAttachmentContentUrlParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) */ jobId: number; /** * The Id of the attachment to be retrieved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) */ attachmentId: number; } - export interface JobTaskListFieldValuesParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) */ jobId: number; /** * The name of the extended property table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) */ tableName: string; /** * The field name of the extended property for which to retrieve values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) */ field: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) */ user: string; } - export interface JobTaskListMultiLevelFieldValuesParams extends Object { /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) */ field: string; /** * The array of previous values, on which the current value is dependent on. For example, when selecting a city based on the state and county. The value for the state and county would be the previous values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) */ previousSelectedValues: string[]; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) */ user: string; } - export interface JobTaskLogActionParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) */ jobId: number; /** * The unique id representing the [activity type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) of the action associated with this log record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) */ activityTypeId: number; /** * The comment that is added to the history. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) */ comments: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) */ user: string; } - export interface JobTaskQueryJobsParams extends Object { /** * The unique id of a query, used to query jobs in the database. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) */ queryId: number; /** * The username of the user who is requesting query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) */ user: string; } - export interface JobTaskQueryMultiLevelSelectedValuesParams extends Object { /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) */ field: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) */ user: string; } - export interface JobTaskReleaseHoldParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) */ jobId: number; /** * The unique id of the hold. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) */ holdId: number; } - export interface JobTaskReopenClosedJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) */ jobIds: number[]; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) */ user: string; } - export interface JobTaskSearchJobsParams extends Object { /** * The text which will be used to perform the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) */ text: string; /** * The username of the user who is requesting search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) */ user: string; } - export interface JobTaskUnassignJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) */ jobIds: number[]; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) */ user: string; } - export interface JobTaskUpdateNotesParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) */ jobId: number; /** * The new notes for the job. Set to an empty (zero-length) string to clear the job notes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) */ notes: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) */ user: string; } - export interface JobTaskUpdateRecordParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) */ jobId: number; /** * The record to be updated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) */ record: AuxRecordDescription; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) */ user: string; @@ -38767,109 +40975,109 @@ declare namespace __esri { /** * JobUpdateParameters is a collection of properties that can be updated for jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ export interface JobUpdateParameters extends Object { - /** - * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) - */ - ownedBy: string; /** * The name of the user or group to whom the job will be assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ assignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ + assignedType: string; /** * The unique id of the data workspace of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ dataWorkspaceId: string; /** * The description of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ description: string; /** * The date on which the job is expected to be complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ dueDate: Date; /** * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ loi: Geometry; /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ jobId: number; /** * The name of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ name: string; /** - * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group - * + * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ - assignedType: string; + ownedBy: string; /** * The unique id of the job that will be designated as the parent job of the new job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ parentJobId: number; /** * The name of the geodatabase version that will be the parent version of the new job's version. By default it will be the parent version of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ parentVersion: string; /** * The percentage of work completed on the job's current step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ percent: number; /** * The numeric value to denote priority of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ priority: number; /** * The date on which the job is scheduled to begin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ startDate: Date; /** * The unique id of the job's new status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ status: number; /** * The name of the geodatabase version to be used for the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ versionName: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ user: string; @@ -38877,37 +41085,37 @@ declare namespace __esri { /** * JobVersionInfo represents a collection of properties for a job's version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ export interface JobVersionInfo extends Object { /** * The unique id of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ dataWorkspaceId: string; /** * The name of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ name: string; /** * The parent version of the geodatabase. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ parent: string; /** * Indicates whether the version has been created or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ created: boolean; /** * The name of the version owner. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ owner: string; @@ -38915,31 +41123,31 @@ declare namespace __esri { /** * QueryFieldInfo represents a collection of field properties that are returned as part of a query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ export interface QueryFieldInfo extends Object { /** * The alias name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ alias: string; /** * The field length. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ length: string; /** * The name of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ name: string; /** * The type of data expected in the field. **Possible Values:** small-integer | integer | single | double | string | date | oid | geometry | blob | raster | guid | global-id | xml - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ type: string; @@ -38947,19 +41155,19 @@ declare namespace __esri { /** * QueryResult contains the result of a query after it has been executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) */ export interface QueryResult extends Object { /** * An array of fields and field properties in the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) */ fields: QueryFieldInfo[]; /** * The rows of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) */ rows: string[]; @@ -38968,116 +41176,116 @@ declare namespace __esri { interface NotificationTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#url) */ url: string; /** * Creates a new spatial notification change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.rule The [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) to be added. * @param params.user The username requesting the addition of the rule. * @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). - * + * */ addChangeRule(params: NotificationTaskAddChangeRuleParams, requestOptions?: any): IPromise; /** * Deletes a spatial notification change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.ruleId The unique id of the rule to be deleted. * @param params.user The username requesting the deletion of the rule. * @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). - * + * */ deleteChangeRule(params: NotificationTaskDeleteChangeRuleParams, requestOptions?: any): IPromise; /** * Get an array of all the spatial notification [change rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getAllChangeRules) - * + * * @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). - * + * */ getAllChangeRules(requestOptions?: any): IPromise; /** * Get a single spatial notification [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) by ruleId. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getChangeRule) - * + * * @param ruleId The unique id of the [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule). * @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). - * + * */ getChangeRule(ruleId: string, requestOptions?: any): IPromise; /** * Get information about a [match](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) for a change and change rule related to a spatial notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getChangeRuleMatch) - * + * * @param matchId The unique id of the spatial notification match. * @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). - * + * */ getChangeRuleMatch(matchId: string, requestOptions?: any): IPromise; /** * Get the current time of the database. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getDatabaseTime) - * + * * @param dataWorkspaceId The unique id of the dataWorkspace. * @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). - * + * */ getDatabaseTime(dataWorkspaceId: string, requestOptions?: any): IPromise; /** * Get an array of [matches](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) that match the change rule criteria in a specific editing session. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getSessionMatches) - * + * * @param sessionId The unique id of the spatial notification session. * @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). - * + * */ getSessionMatches(sessionId: string, requestOptions?: any): IPromise; /** * Sends the notifications configured for the matches found during a rule evaluation session. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.sessionid The unique id of the spatial notification session. * @param params.deleteAfter Indicates whether to delete the session matches after sending any notifications. The default is false. * @param params.user The username requesting the sending of notification. * @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). - * + * */ notifySession(params: NotificationTaskNotifySessionParams, requestOptions?: any): IPromise; /** * Queries the array of spatial notification [change rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) based on specified criteria. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.name A search string to find within change rule names. * @param params.description A search string to find within change rule descriptions. * @param params.searchType The type of search to perform, default is contains. **Possible Values:** contains | exact | starts-with | ends-with * @param params.user The username requesting the search. * @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). - * + * */ queryChangeRules(params: NotificationTaskQueryChangeRulesParams, requestOptions?: any): IPromise; /** * Executes the configured spatial notification change rules on a data workspace by evaluating the geodatabase archive. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.dataWorkspaceId The unique id of the dataWorkspace. * @param params.from The starting time to query for new changes. @@ -39086,58 +41294,67 @@ declare namespace __esri { * @param params.send Indicates whether to the send notifications at the time matches are found. The default is false. * @param params.user The username requesting the execution of the rule. * @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). - * + * */ - runSpatialNotificationOnHistory(params: NotificationTaskRunSpatialNotificationOnHistoryParams, requestOptions?: any): IPromise; + runSpatialNotificationOnHistory( + params: NotificationTaskRunSpatialNotificationOnHistoryParams, + requestOptions?: any + ): IPromise; /** * Sends an email of the specified [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.notificationType The name of the [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) to be sent. * @param params.user The username requesting to send the notification. * @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). - * + * */ sendNotification(params: NotificationTaskSendNotificationParams, requestOptions?: any): IPromise; /** * Adds an email address to the subscriber list for a specific notification type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.notificationTypeId The unique id of the notification type to which the email address will be added. * @param params.email The email address to add to the notification type's subscriber list. May contain tokens. * @param params.user The username requesting the addition of email address to the notification subscriber's list. * @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). - * + * */ - subscribeToNotification(params: NotificationTaskSubscribeToNotificationParams, requestOptions?: any): IPromise; + subscribeToNotification( + params: NotificationTaskSubscribeToNotificationParams, + requestOptions?: any + ): IPromise; /** * Removes an email address from the subscriber list for a specific notification type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.notificationTypeId The unique id of the notification type from which the email address will be removed. * @param params.email The email address to remove from the notification type's subscriber list. May contain tokens. * @param params.user The username requesting the removal of email address to the notification subscriber's list. * @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). - * + * */ - unsubscribeFromNotification(params: NotificationTaskUnsubscribeFromNotificationParams, requestOptions?: any): IPromise; + unsubscribeFromNotification( + params: NotificationTaskUnsubscribeFromNotificationParams, + requestOptions?: any + ): IPromise; } interface NotificationTaskConstructor { /** * Exposes functions to perform operations with Workflow Manager notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html) */ - new(properties?: NotificationTaskProperties): NotificationTask; + new (properties?: NotificationTaskProperties): NotificationTask; } export const NotificationTask: NotificationTaskConstructor; @@ -39145,7 +41362,7 @@ declare namespace __esri { interface NotificationTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#url) */ url?: string; @@ -39153,43 +41370,43 @@ declare namespace __esri { /** * AOIEvaluator represents the rules that triggers a spatial notification based on area of interest(AOI). This contains the geometric operation and the criteria to be used based on the AOI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ export interface AOIEvaluator extends Object { /** * The area of interest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ aoi: Polygon; /** * Indicates whether to inverse the spatial relationship or not. For example, if the spatial relationship is inversed for operator Within, then features that are not within will be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ inverse: boolean; /** * The name of the AOI evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ name: string; /** * The spatial relationship to be applied for evaluation of the rule. **Possible Values:** intersects | contains | crosses | envelope-intersects | index-intersects | overlaps | touches | within | relation - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ relation: string; /** * The type of the AOI evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ type: string; /** * Indicates whether job AOI should be used as the extent or not for the evaluation of the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ useJobAOI: boolean; @@ -39197,43 +41414,43 @@ declare namespace __esri { /** * ChangeRule represents a single change rule that triggers a spatial notification. When the criteria defined in the rule is met an email notification is sent to recipients. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ export interface ChangeRule extends Object { /** * The description of the change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ description: string; /** * An array of [AOI](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) and [Dataset](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) evaluators. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ evaluators: any[]; /** * The unique id of the change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ id: number; /** * The name of the change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ name: string; /** * The type of notifier, the default is [email notifier](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier). This can be extended to use your own notifiers like SMS, instant messaging. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ notifier: any; /** * Indicates whether to summarize email contents or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ summarize: boolean; @@ -39241,49 +41458,49 @@ declare namespace __esri { /** * ChangeRuleMatch represents information about the change and change rule related to a spatial notification match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ export interface ChangeRuleMatch extends Object { /** * The time the change occurred to the data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ changeTime: Date; /** * The type of change that happened to the data. **Possible Values:** add | modify | delete | all - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ changeType: string; /** * The dataset that changed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ dataset: string; /** * The unique id of the data workspace containing the changed data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ dataWorkspaceId: string; /** * The unique id of the associated to the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ id: string; /** * The unique id of the job where the change was made. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ jobID: string; /** * The unique id of the change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ ruleID: string; @@ -39291,43 +41508,43 @@ declare namespace __esri { /** * DatasetConfiguration represents the criteria and dataset that the change rule applies to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ export interface DatasetConfiguration extends Object { /** * This indicates whether the notification will be sent always or if values change to defined in whereConditions or if values change from defined in whereConditions. **Possible Values:** always | changed-to | changed-from - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ changeCondition: number; /** * The name of the fields, changes to which trigger the notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ changeFields: string; /** * The name of the dataset that will trigger the notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ dataset: string; /** * The unique id of the data workspace containing the changed data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ dataWorkspaceId: string; /** * The name of the dataset configuration rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ name: string; /** * The [where conditions](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) defining the criteria to trigger the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ whereConditions: WhereCondition[]; @@ -39335,25 +41552,25 @@ declare namespace __esri { /** * DataSetEvaluator represents the rules that triggers a spatial notification based on the changes in a dataset. This contains the specific features and feature class that are participating in a spatial notification rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) */ export interface DataSetEvaluator extends Object { /** * The array of [DatasetConfigurations](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) representing the dataset to which the rule applies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) */ dataSetConfigurations: DatasetConfiguration[]; /** * The name of the dataset evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) */ name: string; /** * The type of the dataset evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) */ type: string; @@ -39361,243 +41578,235 @@ declare namespace __esri { /** * EmailNotifier represents the properties of a notification type that is configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ export interface EmailNotifier extends Object { /** * Indicates whether the job's file attachment will be attached to the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ attachJobAttachments: boolean; /** * The message content sent as part of the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ message: string; /** * The name of the notifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ name: string; /** * The sender's (from) email address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ senderEmail: string; /** * The sender's (from) name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ senderName: string; /** * The subject of the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ subject: string; /** * The array of subscribers who will get the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ subscribers: string[]; /** * The type of notifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ type: string; } - export interface NotificationTaskAddChangeRuleParams extends Object { /** * The [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) to be added. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) */ rule: ChangeRule; /** * The username requesting the addition of the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) */ user: string; } - export interface NotificationTaskDeleteChangeRuleParams extends Object { /** * The unique id of the rule to be deleted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) */ ruleId: string; /** * The username requesting the deletion of the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) */ user: string; } - export interface NotificationTaskNotifySessionParams extends Object { /** * The unique id of the spatial notification session. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) */ sessionid: string; /** * Indicates whether to delete the session matches after sending any notifications. The default is false. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) */ deleteAfter: boolean; /** * The username requesting the sending of notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) */ user: string; } - export interface NotificationTaskQueryChangeRulesParams extends Object { /** * A search string to find within change rule names. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) */ name: string; /** * A search string to find within change rule descriptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) */ description: string; /** * The type of search to perform, default is contains. **Possible Values:** contains | exact | starts-with | ends-with - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) */ searchType: string; /** * The username requesting the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) */ user: string; } - export interface NotificationTaskRunSpatialNotificationOnHistoryParams extends Object { /** * The unique id of the dataWorkspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ dataWorkspaceId: string; /** * The starting time to query for new changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ from: Date; /** * The ending time to query for new changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ to: Date; /** * Indicates whether to keep the matches found, stored in the ArcGIS Workflow Manager repository. The default is false. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ logMatches: boolean; /** * Indicates whether to the send notifications at the time matches are found. The default is false. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ send: boolean; /** * The username requesting the execution of the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ user: string; } - export interface NotificationTaskSendNotificationParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) */ jobId: number; /** * The name of the [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) to be sent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) */ notificationType: string; /** * The username requesting to send the notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) */ user: string; } - export interface NotificationTaskSubscribeToNotificationParams extends Object { /** * The unique id of the notification type to which the email address will be added. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) */ notificationTypeId: number; /** * The email address to add to the notification type's subscriber list. May contain tokens. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) */ email: string; /** * The username requesting the addition of email address to the notification subscriber's list. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) */ user: string; } - export interface NotificationTaskUnsubscribeFromNotificationParams extends Object { /** * The unique id of the notification type from which the email address will be removed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) */ notificationTypeId: number; /** * The email address to remove from the notification type's subscriber list. May contain tokens. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) */ email: string; /** * The username requesting the removal of email address to the notification subscriber's list. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) */ user: string; @@ -39605,55 +41814,55 @@ declare namespace __esri { /** * NotificationType represents the properties of a notification type that are sent when certain events happen in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ export interface NotificationType extends Object { /** * Indicates whether the job's file attachment will be attached to the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ attachJobAttachments: boolean; /** * The unique id of the notification type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ id: number; /** * The message content sent as part of the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ message: string; /** * The sender's (from) email address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ senderEmail: string; /** * The sender's (from) name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ senderName: string; /** * The subject of the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ subject: string; /** * The array of subscribers who will get the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ subscribers: string[]; /** * The type of notifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ type: string; @@ -39661,25 +41870,25 @@ declare namespace __esri { /** * WhereCondition returns the condition set in [DatasetConfiguration](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) for a [Dataset](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) */ export interface WhereCondition extends Object { /** * The value to be compared/evaluated with. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) */ compareValue: any; /** * The field name that contains the value to be compared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) */ field: string; /** * The operator to be used for comparison. **Possible Values:** equal | not-equal | greater-than | greater-or-equal | less-than | less-or-equal | contains - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) */ operator: string; @@ -39688,63 +41897,63 @@ declare namespace __esri { interface ReportTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#url) */ url: string; /** * Generates a report and returns the output as formatted HTML. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.reportId The id of the report. * @param params.user The user name requesting the report. * @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). - * + * */ generateReport(params: ReportTaskGenerateReportParams, requestOptions?: any): IPromise; /** * Gets all the [reports](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) that are configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getAllReports) - * + * * @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). - * + * */ getAllReports(requestOptions?: any): IPromise; /** * Returns the URL string for the report content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.reportId The id of the report. * @param params.user The username of the user requesting the report content. - * + * */ getReportContentUrl(params: ReportTaskGetReportContentUrlParams): string; /** * Executes a report and returns the raw [report data](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.reportId The id of the report. * @param params.user The username of the user requesting the report data. * @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). - * + * */ getReportData(params: ReportTaskGetReportDataParams, requestOptions?: any): IPromise; /** * Gets the XSLT stylesheet for the specified report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportStylesheet) - * + * * @param reportId The id of the report. * @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). - * + * */ getReportStylesheet(reportId: number, requestOptions?: any): IPromise; } @@ -39752,11 +41961,11 @@ declare namespace __esri { interface ReportTaskConstructor { /** * Helps you generate reports about the work being managed in your Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html) */ - new(properties?: ReportTaskProperties): ReportTask; + new (properties?: ReportTaskProperties): ReportTask; } export const ReportTask: ReportTaskConstructor; @@ -39764,7 +41973,7 @@ declare namespace __esri { interface ReportTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#url) */ url?: string; @@ -39772,37 +41981,37 @@ declare namespace __esri { /** * Report represents a configured report in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ export interface Report extends Object { /** * A description of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ description: string; /** * The category to which the report belongs in the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ hierarchy: string; /** * A unique id for the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ id: number; /** * The name of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ name: string; /** * The title of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ title: string; @@ -39810,31 +42019,31 @@ declare namespace __esri { /** * ReportData is the generated result of a report after it has been executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ export interface ReportData extends Object { /** * The name of columns returned as part of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ columns: string[]; /** * A description of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ description: string; /** * The [aggregation of the report data](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) into subcategories. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ groups: ReportDataGroup[]; /** * The title of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ title: string; @@ -39842,79 +42051,76 @@ declare namespace __esri { /** * ReportDataGroup aggregates the report results into user defined categories. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ export interface ReportDataGroup extends Object { /** * The label of the aggregate category as defined in the report, eg. Total Jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ aggregateLabel: string; /** * The value of the aggregate category based on the calculation defined in the report section options. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ aggregateValue: string; /** * The rows containing the data returned in the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ row: string[]; /** * The data value based on which the section is created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ value: string; } - export interface ReportTaskGenerateReportParams extends Object { /** * The id of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) */ reportId: number; /** * The user name requesting the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) */ user: string; } - export interface ReportTaskGetReportContentUrlParams extends Object { /** * The id of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) */ reportId: number; /** * The username of the user requesting the report content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) */ user: number; } - export interface ReportTaskGetReportDataParams extends Object { /** * The id of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) */ reportId: number; /** * The username of the user requesting the report data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) */ user: string; @@ -39923,15 +42129,15 @@ declare namespace __esri { interface TokenTask extends Task { /** * Parses a string with embedded tokens using user and job information. The string is returned with embedded tokens replaced by their actual values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId A unique id for the job. * @param params.stringToParse The string representing the tokens to be parsed. * @param params.user The username of the user requesting token parsing. * @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). - * + * */ parseTokens(params: TokenTaskParseTokensParams, requestOptions?: any): IPromise; } @@ -39939,36 +42145,33 @@ declare namespace __esri { interface TokenTaskConstructor { /** * Helps you parse Workflow Manager tokens to the actual value of tokens in the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html) */ - new(properties?: TokenTaskProperties): TokenTask; + new (properties?: TokenTaskProperties): TokenTask; } export const TokenTask: TokenTaskConstructor; - interface TokenTaskProperties extends TaskProperties { - - } - + interface TokenTaskProperties extends TaskProperties {} export interface TokenTaskParseTokensParams extends Object { /** * A unique id for the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) */ jobId: any; /** * The string representing the tokens to be parsed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) */ stringToParse: string; /** * The username of the user requesting token parsing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) */ user: string; @@ -39977,156 +42180,156 @@ declare namespace __esri { interface WorkflowTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#url) */ url: string; /** * Get the information which indicates whether this workflow step can be run. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. * @param params.user The user name of the user wanting to run the step. * @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). - * + * */ canRunStep(params: WorkflowTaskCanRunStepParams, requestOptions?: any): IPromise; /** * Executes the specified steps in order and gets back [execution information](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) of the steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepIds The array of unique step Ids. * @param params.auto Indicates whether to automatically execute as many steps as possible, based on the workflow configuration. The default is false, to execute only the current step. * @param params.user The user name of the user executing the step. * @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). - * + * */ executeSteps(params: WorkflowTaskExecuteStepsParams, requestOptions?: any): IPromise; /** * Gets all workflow [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getAllSteps) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getAllSteps(jobId: number, requestOptions?: any): IPromise; /** * Gets all current [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. A workflow will have more than one current step if it is configured to support parallel steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getCurrentSteps) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getCurrentSteps(jobId: number, requestOptions?: any): IPromise; /** * Gets a specific workflow [step](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. * @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). - * + * */ getStep(params: WorkflowTaskGetStepParams, requestOptions?: any): IPromise; /** * Get the help associated with a workflow step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. * @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). - * + * */ getStepDescription(params: WorkflowTaskGetStepDescriptionParams, requestOptions?: any): IPromise; /** * Gets a URL to access the file content of a file step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. - * + * */ getStepFileUrl(params: WorkflowTaskGetStepFileUrlParams): string; /** * Get a job's [workflow display details](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getWorkflowDisplayDetails) - * + * * @param jobId The unique id of the job. * @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). - * + * */ getWorkflowDisplayDetails(jobId: number, requestOptions?: any): IPromise; /** * Gets a URL of an image depicting the current state of a job's workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getWorkflowImageUrl) - * + * * @param jobId The unique id of the job. - * + * */ getWorkflowImageUrl(jobId: number): string; /** * Marks the specified steps of a job workflow as completed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepIds The array of unique step Ids. * @param params.user The user name of the user marking the step complete. * @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). - * + * */ markStepsAsDone(params: WorkflowTaskMarkStepsAsDoneParams, requestOptions?: any): IPromise; /** * Advances the workflow to the next step based on a return code value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job Id. * @param params.stepId The unique id of the step. * @param params.returnCode A numeric value representing the return code. * @param params.user The user name of the user advancing the workflow to the next step. * @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). - * + * */ moveToNextStep(params: WorkflowTaskMoveToNextStepParams, requestOptions?: any): IPromise; /** * The job workflow is updated with the latest workflow of job type, after the job has been created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.user The user name of the user recreating the workflow. * @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). - * + * */ recreateWorkflow(params: WorkflowTaskRecreateWorkflowParams, requestOptions?: any): IPromise; /** * Resolves workflow path conflicts resulting from executing or marking as complete a step, which can have two or more next steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. @@ -40134,20 +42337,20 @@ declare namespace __esri { * @param params.optionStepIds An array of unique step IDs of all the possible next steps. * @param params.user The user name of the user resolving the conflict. * @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). - * + * */ resolveConflict(params: WorkflowTaskResolveConflictParams, requestOptions?: any): IPromise; /** * Sets a step as the current active step of a job workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. * @param params.user The user name of the user setting the current step. * @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). - * + * */ setCurrentStep(params: WorkflowTaskSetCurrentStepParams, requestOptions?: any): IPromise; } @@ -40155,11 +42358,11 @@ declare namespace __esri { interface WorkflowTaskConstructor { /** * Class to perform operations on Workflow Manager workflows and steps. The workflows are collections of steps that are executed while working on a job. Workflows are designed to organize and simplify tasks to ensure that no step is missed. The steps are the building blocks of your workflows and are connected using paths. Step and path properties determine the flow of the work. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html) */ - new(properties?: WorkflowTaskProperties): WorkflowTask; + new (properties?: WorkflowTaskProperties): WorkflowTask; } export const WorkflowTask: WorkflowTaskConstructor; @@ -40167,7 +42370,7 @@ declare namespace __esri { interface WorkflowTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#url) */ url?: string; @@ -40175,67 +42378,67 @@ declare namespace __esri { /** * ExecuteInfo provides information on whether a step can be executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ export interface ExecuteInfo extends Object { /** * Information about [conflicts](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) in workflow step progression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ conflicts: WorkflowConflicts; /** * The error code returned by the steps in the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ errorCode: number; /** * The description for the errors returned by the steps in the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ errorDescription: string; /** * The result of a step execution. **Possible Values:** executed | dependent-on-step | dependent-on-stage | dependent-on-status | job-on-hold | step-depends-on-step | check | step-assigned-to-other-user | step-assigned-to-other-group | job-assigned-to-others | job-closed | invalid-platform | invalid-step | dependent-on-job | not-current-step - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ executionResult: string; /** * Indicates whether a step has conflicts. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ hasConflicts: boolean; /** * Indicates whether a step has return code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ hasReturnCode: boolean; /** * The unique id of current job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ jobID: number; /** * The return code for the current workflow step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ returnCode: number; /** * The unique id of the current step in the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ stepID: number; /** * Indicates whether the step threw an error during execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ threwError: boolean; @@ -40243,109 +42446,109 @@ declare namespace __esri { /** * Step represents the properties of a step that is used in a job's workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ export interface Step extends Object { - /** - * Indicates whether the step has already been executed. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) - */ - hasBeenExecuted: boolean; /** * The user or group to whom the step is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ assignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** none | unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ + assignedType: string; /** * Indicates whether the step can be run asynchronously. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ async: boolean; /** * Indicates whether the step can be automatically executed when reached. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ autoRun: boolean; /** * Indicates whether the step can be skipped without executing it. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ canSkip: boolean; /** * Indicates whether the step can start parallel execution of other steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ canSpawnConcurrency: boolean; /** * The unique id of step type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ commonId: number; /** * The default percentage completion of the job once step is reached. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ defaultPercentComplete: number; /** - * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** none | unassigned | user | group - * + * Indicates whether the step has already been executed. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ - assignedType: string; + hasBeenExecuted: boolean; /** * Indicates whether the step has been started. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ hasBeenStarted: boolean; /** * The unique id generated as the step Id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ id: number; /** * The name of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ name: string; /** * Indicates whether the step will be automatically marked as complete when complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ selfCheck: boolean; /** * The unique numeric status value configured as the status of the job once step is reached. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ statusId: number; /** * The percentage completion of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ stepPercentComplete: number; /** * The type of notification that will be sent when the step finishes execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ notificationType: string; /** * The [step template](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) for current step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ stepType: StepType; @@ -40353,73 +42556,73 @@ declare namespace __esri { /** * StepType represents properties of step templates that are available in the Workflow Manager system for authoring workflows. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ export interface StepType extends Object { - /** - * The program/application/code that will be executed on this step. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) - */ - program: string; /** * The step arguments required at runtime. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ arguments: string; + /** + * The description of the step type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ + description: string; /** * The type of execution for the step. **Possible Values:** executable | function | procedural | launch-url | question | open-file - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ executionType: string; /** * The unique id for the step type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ id: number; /** * The name of the step type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ name: string; /** - * The description of the step type. - * + * The program/application/code that will be executed on this step. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ - description: string; + program: string; /** * The path/URL of the step description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ stepDescriptionLink: string; /** * The type of step description. **Possible Values:** none | embedded-html | link - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ stepDescriptionType: string; /** * The shape of the step as it will appear in a workflow graphic. **Possible Values:** rounded-rectangle | rectangle | oval | diamond | parallelogram - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ stepIndicatorType: string; /** * The platform on which the step can be executed. **Possible Values:** desktop | server | both - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ supportedPlatform: string; /** * Indicates whether Workflow Manager will be minimized and hidden during step execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ visible: boolean; @@ -40427,55 +42630,55 @@ declare namespace __esri { /** * WorkflowAnnotationDisplayDetails represents properties of a workflow annotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ export interface WorkflowAnnotationDisplayDetails extends Object { /** * The X coordinate of the annotation object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ centerX: number; /** * The Y coordinate of the annotation object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ centerY: number; /** * The fill color of the annotation object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ fillColor: Color; /** * The height of the annotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ height: number; /** * The annotation text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ label: string; /** * The color of annotation label text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ labelColor: Color; /** * The outline color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ OutlineColor: Color; /** * The width of the annotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ width: number; @@ -40483,31 +42686,31 @@ declare namespace __esri { /** * WorkflowConflicts represents properties for workflows that have a conflicting path or multiple possible paths for progression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ export interface WorkflowConflicts extends Object { /** * The unique id of currently active job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ jobID: number; /** * The information about the step in the workflow returned as [WorkflowOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ options: WorkflowOption[]; /** * Indicates whether the step will begin a concurrent path in the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ spawnsConcurrency: boolean; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ stepId: number; @@ -40515,25 +42718,25 @@ declare namespace __esri { /** * WorkflowDisplayDetails represents a collection of properties that constitute a workflow - annotations, steps, and paths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) */ export interface WorkflowDisplayDetails extends Object { /** * The properties of how the [annotations are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) */ annotations: WorkflowAnnotationDisplayDetails[]; /** * The properties of how the [path are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) */ paths: WorkflowPathDisplayDetails[]; /** * The properties of how the [step are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) */ steps: WorkflowStepDisplayDetails[]; @@ -40541,19 +42744,19 @@ declare namespace __esri { /** * WorkflowOption represents properties of a workflow that have return codes and step branches. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) */ export interface WorkflowOption extends Object { /** * The return code generated from a step execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) */ returnCode: number; /** * The collection of [descriptions for workflow steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) */ steps: WorkflowStepInfo[]; @@ -40561,62 +42764,62 @@ declare namespace __esri { /** * WorkflowPathDisplayDetails represents properties of a workflow's path properties like location, destination steps, position on the workflow canvas. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ export interface WorkflowPathDisplayDetails extends Object { /** * The unique id of the step to which the path will lead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ destStepId: number; /** * The unique id of the step just executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ sourceStepID: number; /** * The label associated with the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ label: string; /** * The color of the label on the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ labelColor: Color; /** * The X coordinate of the label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ labelX: number; /** * The Y coordinate of the label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ labelY: number; /** * The color of the line representing the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ lineColor: Color; /** - * An object with following properties. - * + * An object with following properties. + * * Name | Type | Description * ---------|--------|------------- * isDefault | Boolean | Indicates whether this is the default path(only path) from the source step. * numReturnValues | Number[] | The number of possible return values for the path. * returnValueX | Number[] | The return values associated with the path. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ pathObject: any; @@ -40624,73 +42827,73 @@ declare namespace __esri { /** * WorkflowStepDisplayDetails represents properties of a workflow step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ export interface WorkflowStepDisplayDetails extends Object { - /** - * The color of step label text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) - */ - labelColor: Color; /** * The X coordinate of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ centerX: number; + /** + * The Y coordinate of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ + centerY: number; /** * The fill color of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ fillColor: Color; /** * The height of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ height: number; /** * The step text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ label: string; /** - * The Y coordinate of the step. - * + * The color of step label text. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ - centerY: number; + labelColor: Color; /** * The outline color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ OutlineColor: Color; /** * The shape of the step. **Possible Values:** rounded-rectangle | rectangle | oval | diamond | parallelogram - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ shape: string; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ stepId: number; /** * The step execution type. **Possible Values:** executable | function | procedural | launch-url | question | open-file - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ stepType: string; /** * The width of the annotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ width: number; @@ -40698,239 +42901,229 @@ declare namespace __esri { /** * WorkflowStepInfo represents collection of descriptions for workflow's steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) */ export interface WorkflowStepInfo extends Object { /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) */ id: number; /** * The name of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) */ name: string; } - export interface WorkflowTaskCanRunStepParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) */ stepId: number; /** * The user name of the user wanting to run the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) */ user: string; } - export interface WorkflowTaskExecuteStepsParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) */ jobId: number; /** * The array of unique step Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) */ stepIds: number[]; /** * Indicates whether to automatically execute as many steps as possible, based on the workflow configuration. The default is false, to execute only the current step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) */ auto: boolean; /** * The user name of the user executing the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) */ user: string; } - export interface WorkflowTaskGetStepDescriptionParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) */ stepId: number; } - export interface WorkflowTaskGetStepFileUrlParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) */ stepId: number; } - export interface WorkflowTaskGetStepParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) */ stepId: number; } - export interface WorkflowTaskMarkStepsAsDoneParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) */ jobId: number; /** * The array of unique step Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) */ stepIds: number[]; /** * The user name of the user marking the step complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) */ user: string; } - export interface WorkflowTaskMoveToNextStepParams extends Object { /** * The unique id of the job Id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) */ stepId: number; /** * A numeric value representing the return code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) */ returnCode: number; /** * The user name of the user advancing the workflow to the next step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) */ user: string; } - export interface WorkflowTaskRecreateWorkflowParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) */ jobId: number; /** * The user name of the user recreating the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) */ user: string; } - export interface WorkflowTaskResolveConflictParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ stepId: number; /** * A numeric value representing the return code from the step where the conflict was encountered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ optionReturnCode: number; /** * An array of unique step IDs of all the possible next steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ optionStepIds: number[]; /** * The user name of the user resolving the conflict. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ user: string; } - export interface WorkflowTaskSetCurrentStepParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) */ stepId: number; /** * The user name of the user setting the current step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) */ user: string; @@ -40938,48 +43131,46 @@ declare namespace __esri { interface Viewpoint extends Accessor, JSONSupport { /** - * The viewpoint camera (3D only). + * The viewpoint camera (3D only). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#camera) */ camera: Camera; /** * The rotation of due north in relation to the top of the view in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#rotation) - * + * * @default 0 */ rotation: number; /** * The scale of the viewpoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#scale) */ scale: number; /** - * The target geometry framed by the viewpoint. + * The target geometry framed by the viewpoint. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#targetGeometry) */ targetGeometry: Geometry; /** * Create a deep clone of the viewpoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone) - * - * + * + * */ clone(): Viewpoint; } interface ViewpointConstructor { - - - new(properties?: ViewpointProperties): Viewpoint; + new (properties?: ViewpointProperties): Viewpoint; fromJSON(json: any): Viewpoint; } @@ -40988,30 +43179,30 @@ declare namespace __esri { interface ViewpointProperties { /** - * The viewpoint camera (3D only). + * The viewpoint camera (3D only). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#camera) */ camera?: CameraProperties; /** * The rotation of due north in relation to the top of the view in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#rotation) - * + * * @default 0 */ rotation?: number; /** * The scale of the viewpoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#scale) */ scale?: number; /** - * The target geometry framed by the viewpoint. + * The target geometry framed by the viewpoint. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#targetGeometry) */ targetGeometry?: GeometryProperties; @@ -41020,33 +43211,33 @@ declare namespace __esri { interface Draw extends Accessor { /** * A reference to the active [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html). An instance of the draw action is created when [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) method is called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#activeAction) */ activeAction: DrawAction; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the draw to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#view) */ view: MapView; /** * Complete the current active drawing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#complete) - * - * + * + * */ complete(): void; /** * Creates an instance of the requested draw action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) - * - * @param drawAction - * Name of the [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) to create. See the table below for a list of possible values and type of draw action it creates. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle | ellipse - * + * + * @param drawAction + * Name of the [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) to create. See the table below for a list of possible values and type of draw action it creates. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle | ellipse + * * Geometry type | Draw action instance * ------------- | -------------------- * point | [PointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html) @@ -41055,23 +43246,23 @@ declare namespace __esri { * polygon | [PolygonDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html) * rectangle, circle, ellipse | [SegmentDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html) * @param drawOptions Object of the drawing options for the geometry to be created. - * @param drawOptions.mode - * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** - * + * @param drawOptions.mode + * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline` draw actions. * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` and `segment` draw actions. Default for `segment` draw actions. * click | Vertices are added when the pointer is clicked. - * + * */ create(drawAction: string, drawOptions?: DrawCreateDrawOptions): DrawAction; /** * Resets the drawing by clearing the active action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#reset) - * - * + * + * */ reset(): void; } @@ -41079,11 +43270,11 @@ declare namespace __esri { interface DrawConstructor { /** * The Draw class provides advanced drawing capabilities for developers who need complete control over creating temporary graphics with different geometries. For example, if you want to prevent users from drawing graphics with self-intersecting lines or overlapping polygons, then you can use this class to implement these rules. The draw experience is built upon draw actions, which use the view events to generate a set of coordinates for creating new geometries. Each geometry type has a corresponding draw action class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html) */ - new(properties?: DrawProperties): Draw; + new (properties?: DrawProperties): Draw; } export const Draw: DrawConstructor; @@ -41091,30 +43282,29 @@ declare namespace __esri { interface DrawProperties { /** * A reference to the active [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html). An instance of the draw action is created when [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) method is called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#activeAction) */ activeAction?: DrawActionProperties; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the draw to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#view) */ view?: MapViewProperties; } - export interface DrawCreateDrawOptions extends Object { /** - * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** - * + * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline` draw actions. * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` and `segment` draw actions. Default for `segment` draw actions. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) */ mode?: string; @@ -41123,41 +43313,41 @@ declare namespace __esri { interface DrawAction extends Accessor, Evented { /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#view) */ view: MapView; /** * Indicates if the [redo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#redo) method can be called on the action instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#canRedo) - * - * + * + * */ canRedo(): boolean; /** * Indicates if the [undo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#undo) method can be called on the action instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#canUndo) - * - * + * + * */ canUndo(): boolean; /** * Incrementally redo actions recorded in the stack. Call [canRedo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#canRedo) prior to calling this method to check if this method can be called on the action instance. Calling this method will fire the [vertex-add](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#event:vertex-remove) events depending on the last action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#redo) - * - * + * + * */ redo(): void; /** * Incrementally undo actions recorded in the stack. Call [canUndo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#canUndo) prior to calling this method to check if this method can be called on the action instance. Calling this method will fire the [vertex-add](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#event:vertex-remove) events depending on the last action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#undo) - * - * + * + * */ undo(): void; } @@ -41165,11 +43355,11 @@ declare namespace __esri { interface DrawActionConstructor { /** * DrawAction is the base class for all draw actions. DrawActions use the view events to generate a set of coordinates to create new geometries. Each serves a different purpose, allowing you to create a different type geometry such as [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html), [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), and [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) */ - new(properties?: DrawActionProperties): DrawAction; + new (properties?: DrawActionProperties): DrawAction; } export const DrawAction: DrawActionConstructor; @@ -41177,7 +43367,7 @@ declare namespace __esri { interface DrawActionProperties { /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#view) */ view?: MapViewProperties; @@ -41186,117 +43376,107 @@ declare namespace __esri { interface MultipointDrawAction extends DrawAction { /** * Two-dimensional array of numbers representing the coordinates of each vertex that comprises the drawn geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#vertices) */ readonly vertices: number[][]; /** * Completes drawing the [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface MultipointDrawActionConstructor { - - - new(properties?: MultipointDrawActionProperties): MultipointDrawAction; + new (properties?: MultipointDrawActionProperties): MultipointDrawAction; } export const MultipointDrawAction: MultipointDrawActionConstructor; - interface MultipointDrawActionProperties extends DrawActionProperties { - - } + interface MultipointDrawActionProperties extends DrawActionProperties {} interface PointDrawAction extends DrawAction { /** * An array of x,y coordinates for the [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html#coordinates) */ readonly coordinates: number[]; /** * Completes drawing the [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface PointDrawActionConstructor { - - - new(properties?: PointDrawActionProperties): PointDrawAction; + new (properties?: PointDrawActionProperties): PointDrawAction; } export const PointDrawAction: PointDrawActionConstructor; - interface PointDrawActionProperties extends DrawActionProperties { - - } + interface PointDrawActionProperties extends DrawActionProperties {} interface PolygonDrawAction extends DrawAction { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#mode) - * + * * @default hybrid */ mode: string; /** * Two-dimensional array of numbers representing the coordinates of each vertex comprising the geometry being drawn. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#vertices) */ readonly vertices: number[][]; /** * Completes drawing the polygon geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface PolygonDrawActionConstructor { - - - new(properties?: PolygonDrawActionProperties): PolygonDrawAction; + new (properties?: PolygonDrawActionProperties): PolygonDrawAction; } export const PolygonDrawAction: PolygonDrawActionConstructor; interface PolygonDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#mode) - * + * * @default hybrid */ mode?: string; @@ -41304,58 +43484,56 @@ declare namespace __esri { interface PolylineDrawAction extends DrawAction { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#mode) - * + * * @default hybrid */ mode: string; /** * Two-dimensional array of numbers representing the coordinates of each vertex that comprising the drawn geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#vertices) */ readonly vertices: number[][]; /** * Completes drawing the polyline geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface PolylineDrawActionConstructor { - - - new(properties?: PolylineDrawActionProperties): PolylineDrawAction; + new (properties?: PolylineDrawActionProperties): PolylineDrawAction; } export const PolylineDrawAction: PolylineDrawActionConstructor; interface PolylineDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#mode) - * + * * @default hybrid */ mode?: string; @@ -41363,146 +43541,160 @@ declare namespace __esri { interface SegmentDrawAction extends DrawAction { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. SegmentDrawActions are created from 2 vertices. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#mode) - * + * * @default freehand */ mode: string; /** * Two-dimensional array of numbers representing the coordinates of each vertex comprising the geometry being drawn. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#vertices) */ readonly vertices: number[][]; /** * Completes drawing the polygon geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#event:draw-complete) event. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface SegmentDrawActionConstructor { - - - new(properties?: SegmentDrawActionProperties): SegmentDrawAction; + new (properties?: SegmentDrawActionProperties): SegmentDrawAction; } export const SegmentDrawAction: SegmentDrawActionConstructor; interface SegmentDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. SegmentDrawActions are created from 2 vertices. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#mode) - * + * * @default freehand */ mode?: string; } - export class BaseLayerView2D { + /** + * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) with a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html) + */ + interface BaseLayerView2D { /** * References the layer this [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) represents. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#layer) */ layer: Layer; /** * The array of [Tile](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) objects computed to cover the MapView's visible area. This array is updated when the view is animating or the user is interacting with it. Then if tiles have been added or removed, [tilesChanged()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tilesChanged) is called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tiles) */ tiles: Tile[]; /** * References the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) this [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) belongs to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#view) */ view: MapView; /** * Method called when after the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) is created and right before it's asked to draw the layer's content. Typically this method is implemented to start watching property changes on the layer for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#attach) - * - * + * + * */ attach(): void; /** * Method called after the layer is removed and the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) is about to be removed. Typically, this method is implemented to free resources like watchers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#detach) - * - * + * + * */ detach(): void; + /** + * Method to implement that is responsible for providing objects hit at the specified screen coordinates. This method is called internally by the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) each time its [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) method is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#hitTest) + * + * @param x The x-coordinate in screen space of the desired hit. + * @param y The y-coordinate in screen space of the desired hit. + * + */ + hitTest(x: number, y: number): IPromise; /** * The method to implement that is responsible of drawing the content of the layer. This method is called every time the MapView's state changes, or if [requestRender()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#requestRender) has been called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) - * + * * @param renderParameters * @param renderParameters.context The [canvas 2D context](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) in which to draw content. * @param renderParameters.stationary The stationary state of the `MapView`. * @param renderParameters.state The object that describes view state. - * + * */ render(renderParameters: BaseLayerView2DRenderRenderParameters): void; /** * The [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) can call this method to ask the MapView to schedule a new rendering frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#requestRender) - * - * + * + * */ - protected requestRender(): void; + requestRender(): void; /** * Method to implement, which notifies of tiles being added or removed for the current view state. This function can be implemented to start and stop fetching new data, or allocate and dispose resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tilesChanged) - * + * * @param added The tile objects added for the current view viewport. * @param removed The tile objects removed from the view viewport. - * + * */ tilesChanged(added: Tile[], removed: Tile[]): void; } + export const BaseLayerView2D: BaseLayerView2D; export interface BaseLayerView2DRenderRenderParameters extends Object { /** * The [canvas 2D context](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) in which to draw content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) */ context: CanvasRenderingContext2D; /** * The stationary state of the `MapView`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) */ stationary: boolean; /** * The object that describes view state. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) */ state: ViewState; @@ -41510,61 +43702,61 @@ declare namespace __esri { /** * Represents a tile reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ export interface Tile extends Object { /** * The tile string identifier in the format `level/row/col/world` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ id: string; /** * The level identifier of the [LOD](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html) to which the tile belongs - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ level: number; /** * The row identifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ row: number; /** * The column identifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ col: number; /** * When the projection allows world wrapping (e.g. Web Mercator), identifies the instance of the world this tile's `level`/`row`/`col`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ world: number; /** * The number of map units per pixel in the tile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ resolution: number; /** * The map scale at the tile's level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ scale: number; /** * The coordinates of the top-left corner of the tile as an array of two numbers. The coordinates are in un-normalized map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ coords: number[]; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ bounds: number[]; @@ -41573,128 +43765,125 @@ declare namespace __esri { interface ViewState { /** * Represents the view's center point as an array of two numbers `[x, y]`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#center) */ readonly center: number[]; /** * The extent represents the visible portion of a map within the view as an instance of Extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#extent) */ readonly extent: Extent; /** * Represents the size of one pixel in map units. The value of `resolution` is the result of the division of the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#extent) width by the [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#size). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#resolution) */ readonly resolution: number; /** * The clockwise rotation of due north in relation to the top of the view in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#rotation) */ readonly rotation: number; /** * Represents the map scale at the center of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#scale) */ readonly scale: number; /** * Represents the width and height of the view in pixels, e.g. `[width, height]`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#size) */ readonly size: number[]; /** * Creates a deep clone of ViewState object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#clone) - * - * + * + * */ clone(): ViewState; /** * Copies the properties from a given view state. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#copy) - * + * * @param state The view state to copy the properties from. - * + * */ copy(state: ViewState): ViewState; /** * Converts the x and y screen coordinates to map coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toMap) - * + * * @param out The receiving array of the conversion. * @param x The horizontal screen coordinate to convert. * @param y The vertical screen coordinate to convert. - * + * */ toMap(out: number[], x: number, y: number): number[]; /** * Converts the x and y map coordinates to screen coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreen) - * + * * @param out The receiving array of the conversion. * @param x The horizontal screen coordinate to convert. * @param y The vertical screen coordinate to convert. - * + * */ toScreen(out: number[], x: number, y: number): number[]; /** * Converts the x and y map coordinates to screen coordinates. This method is similar to [toScreen](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreen), without applying the view state rotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreenNoRotation) - * + * * @param out The receiving array of the conversion. * @param x The horizontal screen coordinate to convert. * @param y The vertical screen coordinate to convert. - * + * */ toScreenNoRotation(out: number[], x: number, y: number): number[]; } interface ViewStateConstructor { - - - - new(properties?: any): ViewState; + new (): ViewState; } export const ViewState: ViewStateConstructor; /** * map/scene on screen. The ArcGIS API for JavaScript offers a low-level interface to access the SceneView's WebGL context, and thus enables creating custom visualizations that interact with the scene the same way as built-in layers. Developers can either write WebGL code directly, or integrate with third-party WebGL libraries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html) */ interface externalRenderers { /** * Adds an external renderer to the view. The external renderer is defined by an object that contains certain methods and properties, as defined by [ExternalRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#add) - * + * * @param view The view to which to attach the external renderer. * @param renderer The external renderer. - * + * */ add(view: SceneView, renderer: ExternalRenderer): void; /** * Transforms positions from the internal rendering coordinate system to the output spatial reference. The allowable output spatial reference is limited and 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), and the call to this function simply copies the coordinates from `srcCoordinates` to `destCoordinates`. - * - * + * + * * If these conditions are not met, nothing is written to `destCoordinates` and the function returns `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#fromRenderCoordinates) - * + * * @param view The view related to the input coordinates. * @param srcCoordinates A linear array of one or more vectors that are interpreted as XYZ coordinates. For example, two position vectors would be represented as `[x1, y1, z1, x2, y2, z2]`. This must contain at least `srcStart + 3 * count` elements. * @param srcStart An index in `srcCoordinates` from which the coordinates will start being read. @@ -41702,17 +43891,25 @@ declare namespace __esri { * @param destStart An index in `destCoordinates` in which the coordinates will start to be written. * @param destSpatialReference The spatial reference of the output coordinates. When `null`, `view.spatialReference` is used instead. * @param count The number of vertices to be transformed. - * + * */ - fromRenderCoordinates(view: SceneView, srcCoordinates: number[] | Float32Array, srcStart: number, destCoordinates: number[] | Float32Array, destStart: number, destSpatialReference: SpatialReference, count: number): number[] | Float32Array; + fromRenderCoordinates( + view: SceneView, + srcCoordinates: number[] | Float32Array, + srcStart: number, + destCoordinates: number[] | Float32Array, + destStart: number, + destSpatialReference: SpatialReference, + count: number + ): number[] | Float32Array; /** * Removes an external renderer from the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#remove) - * + * * @param view The view from which to remove the external renderer. * @param renderer The external renderer. - * + * */ remove(view: SceneView, renderer: ExternalRenderer): void; /** @@ -41720,43 +43917,48 @@ declare namespace __esri { * * X: Easting * * Y: Northing * * Z: Elevation - * - * + * + * * ![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). - * - * + * + * * If these conditions are not met, nothing will be written to `dest` and the function will return `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#renderCoordinateTransformAt) - * + * * @param view The view for which the transformation will be used. * @param origin The global coordinates of the origin in the local Cartesian coordinate system. * @param srcSpatialReference The spatial reference of the origin coordinates. If undefined, `view.spatialReference` is used instead. * @param dest A reference to an array where the 16 matrix elements will be stored. The resulting matrix follows OpenGL conventions where the translation components occupy the 13th, 14th and 15th elements. If undefined, a newly created matrix returned. - * + * */ - renderCoordinateTransformAt(view: SceneView, origin: number[] | Float32Array, srcSpatialReference?: SpatialReference, dest?: number[] | Float32Array): number[] | Float32Array; + renderCoordinateTransformAt( + view: SceneView, + origin: number[] | Float32Array, + srcSpatialReference?: SpatialReference, + dest?: number[] | Float32Array + ): number[] | Float32Array; /** * Requests the view to be redrawn. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#requestRender) - * + * * @param view The view to which the external renderer is attached. - * + * */ requestRender(view: SceneView): void; /** * Transforms positions from the given spatial reference to the internal rendering coordinate system. The allowable input spatial reference is limited and 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); the call to this function simply copies the coordinates from `srcCoordinates` to `destCoordinates`. - * - * + * + * * If these conditions are not met, nothing is written to `destCoordinates` and the function returns `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#toRenderCoordinates) - * + * * @param view The view in which the coordinates will be used. * @param srcCoordinates A linear array of one or more vectors which are interpreted as XYZ coordinates. For example, two position vectors would be represented as `[x1, y1, z1, x2, y2, z2]`. This must contain at least `srcStart + 3 * count` elements. * @param srcStart An index in `srcCoordinates` from which the coordinates start to be read. @@ -41764,28 +43966,36 @@ declare namespace __esri { * @param destCoordinates A reference to an array where the results will be written. * @param destStart An index in `destCoordinates` to which the coordinates will start to be written. * @param count The number of vertices to be transformed. - * + * */ - toRenderCoordinates(view: SceneView, srcCoordinates: number[] | Float32Array, srcStart: number, srcSpatialReference: SpatialReference, destCoordinates: number[] | Float32Array, destStart: number, count: number): number[] | Float32Array; + toRenderCoordinates( + view: SceneView, + srcCoordinates: number[] | Float32Array, + srcStart: number, + srcSpatialReference: SpatialReference, + destCoordinates: number[] | Float32Array, + destStart: number, + count: number + ): number[] | Float32Array; } export const externalRenderers: externalRenderers; /** * Tuple of an RGB color value and an intensity value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) */ export interface ColorAndIntensity extends Object { /** * RGB color with values between 0 and 1. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) */ color: ArrayLike; /** * Scalar intensity value by which the color should be scaled for compositing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) */ intensity: number; @@ -41793,25 +44003,25 @@ declare namespace __esri { /** * Defines an external renderer using callbacks and properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) */ export interface ExternalRenderer extends Object { /** * Typically called once after adding the external renderer to a view, or whenever the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) becomes [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ready). It may be called again if the ready state cycles, for example when a different [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) is assigned to the view. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) */ setup?: RenderContextCallback; /** * Called in every frame to execute the state update and draw calls. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) */ render?: RenderContextCallback; /** * Called when the external renderer is removed from a view, or when the [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ready) state of the view turns false. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) */ dispose?: RenderContextCallback; @@ -41819,67 +44029,67 @@ declare namespace __esri { /** * The camera object passed to renderer callbacks in [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). This is not the same as [Camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html). All properties are read-only and defined in terms of the internal rendering coordinate system (see the [section on coordinate systems](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#coordinate-systems) at the top of this page). Vectors (`Vec3`) are presented as arrays with 3 elements (x, y, z). Matrices (`Mat4`) are presented as linear arrays with 16 elements following the OpenGL conventions where the translation components occupy the 13th, 14th, and 15th elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ export interface RenderCamera extends Object { /** * A 4x4 matrix that transforms coordinates from world space to camera space. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ viewMatrix: ArrayLike; /** * The inverse transpose of `viewMatrix`, used to transform normals from world space to camera space. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ viewInverseTransposeMatrix: ArrayLike; /** * A 4x4 matrix that defines the perspective projection transformation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ projectionMatrix: ArrayLike; /** * The position of the camera in the internal Cartesian rendering coordinate system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ eye: ArrayLike; /** * The camera target ("look at") position in the internal Cartesian rendering coordinate system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ center: ArrayLike; /** * The camera up vector. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ up: ArrayLike; /** * The distance to the near plane. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ near: number; /** * The distance to the far plane. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ far: number; /** * The horizontal field of view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ fovX: number; /** * The vertical field of view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ fovY: number; @@ -41887,43 +44097,43 @@ declare namespace __esri { /** * The object passed as a parameter to every call to `setup` and `render` the external renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) */ export interface RenderContext extends Object { /** * The WebGL rendering context. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) */ gl: WebGLRenderingContext; /** * The camera used to render the current frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) */ camera: RenderCamera; /** * The lighting used by [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) to render the current frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) */ sunLight: SunLight; /** * A convenience function provided to completely reset the WebGL state after using it. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) - * - * + * + * */ resetWebGLState(): void; /** * Binds the color and depth buffers an external renderer is supposed to render into. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) - * - * + * + * */ bindRenderTarget(): void; } @@ -41932,25 +44142,25 @@ declare namespace __esri { /** * Describes the lighting used by [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), derived from its sun lighting model. It consists of a directional Lambertian (`diffuse`) and a constant (`ambient`) term, which should be treated in the sense of the [Phong Reflection Model](https://en.wikipedia.org/wiki/Phong_reflection_model). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) */ export interface SunLight extends Object { /** * The incident light direction in render coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) */ direction: ArrayLike; /** * The diffuse light color and intensity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) */ diffuse: ColorAndIntensity; /** * The ambient light color and intensity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) */ ambient: ColorAndIntensity; @@ -41958,16 +44168,16 @@ declare namespace __esri { interface BreakpointsOwner { /** - * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. + * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) */ breakpoints: BreakpointsOwnerBreakpoints; /** - * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. + * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description | Default thresholds (pixels) * ---------------|-------------|---------------------------- * xsmall | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | < 545 @@ -41975,28 +44185,28 @@ declare namespace __esri { * medium | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 769 - 992 * large | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 993 - 1200 * xlarge | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | > 1200 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) */ heightBreakpoint: string; /** - * A convenience property indicating the view's orientation. See the table below for a list of possible values. + * A convenience property indicating the view's orientation. See the table below for a list of possible values. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description * ---------------|------------ * landscape | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is greater than its [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height). * portrait | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is equal to or smaller than its [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#orientation) */ readonly orientation: string; /** - * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. + * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description | Default thresholds (pixels) * ---------------|-------------|------------------- * xsmall | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | < 545 @@ -42004,33 +44214,31 @@ declare namespace __esri { * medium | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 769 - 992 * large | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 993 - 1200 * xlarge | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | > 1200 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) */ widthBreakpoint: string; } interface BreakpointsOwnerConstructor { - - - new(): BreakpointsOwner; + new (): BreakpointsOwner; } export const BreakpointsOwner: BreakpointsOwnerConstructor; interface BreakpointsOwnerProperties { /** - * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. + * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) */ breakpoints?: BreakpointsOwnerBreakpoints; /** - * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. + * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description | Default thresholds (pixels) * ---------------|-------------|---------------------------- * xsmall | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | < 545 @@ -42038,15 +44246,15 @@ declare namespace __esri { * medium | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 769 - 992 * large | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 993 - 1200 * xlarge | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | > 1200 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) */ heightBreakpoint?: string; /** - * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. + * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description | Default thresholds (pixels) * ---------------|-------------|------------------- * xsmall | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | < 545 @@ -42054,50 +44262,49 @@ declare namespace __esri { * medium | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 769 - 992 * large | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 993 - 1200 * xlarge | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | > 1200 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) */ widthBreakpoint?: string; } - export interface BreakpointsOwnerBreakpoints extends Object { /** * Sets the `xsmall` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is smaller than this value, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `xsmall`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) - * + * * @default 544 */ xsmall?: number; /** * Sets the `small` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `xsmall` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `small`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) - * + * * @default 768 */ small?: number; /** * Sets the `medium` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `small` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `medium`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) - * + * * @default 992 */ medium?: number; /** * Sets the `large` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `medium` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `large`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) - * + * * @default 1200 */ large?: number; /** * Sets the `xlarge` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is greater than the value of the `large` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `xlarge`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) */ xlarge?: number; @@ -42106,72 +44313,70 @@ declare namespace __esri { interface DOMContainer { /** * The `id` or node representing the DOM element containing the view. This is typically set in the view's constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container) */ container: HTMLDivElement; /** * Indicates if the browser focus is on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#focused) */ readonly focused: boolean; /** * The height of the view in pixels read from the view container element. The view container needs to have a height greater than 0 to be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#height) - * + * * @default 0 */ 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. 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) */ popup: Popup; /** * Indicates if the view is being resized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#resizing) - * + * * @default false */ readonly resizing: boolean; /** * An array containing the width and height of the view in pixels, e.g. `[width, height]`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#size) */ readonly size: number[]; /** * Indicates if the view is visible on the page. Is `true` if the view has no [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container), a [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#width) equal to 0, or the CSS `visibility` is `hidden`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#suspended) - * + * * @default true */ readonly suspended: boolean; /** * Exposes the default widgets available in the view and allows you to toggle them on and off. See [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#ui) */ ui: DefaultUI; /** * The width of the view in pixels read from the view container element. The view container needs to have a width greater than 0 to be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#width) - * + * * @default 0 */ readonly width: number; } interface DOMContainerConstructor { - - - new(): DOMContainer; + new (): DOMContainer; } export const DOMContainer: DOMContainerConstructor; @@ -42179,19 +44384,19 @@ declare namespace __esri { interface DOMContainerProperties { /** * The `id` or node representing the DOM element containing the view. This is typically set in the view's constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container) */ 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. 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) */ popup?: PopupProperties; /** * Exposes the default widgets available in the view and allows you to toggle them on and off. See [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#ui) */ ui?: DefaultUIProperties; @@ -42200,42 +44405,38 @@ declare namespace __esri { interface GroundView extends Accessor { /** * An elevation sampler that may be used to sample and query elevation values from the ground surface that is currently being displayed. The elevation sampler is not supported for [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and may be `null` while the ground surface display is being initialized. The resolution of the sampled values depends on the ground elevation display resolution (high resolution close to the camera, low resolution far away from the camera). Because of the dynamic nature of the display resolution, the [demResolution](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html#demResolution) property of the returned sampler will always return `{ min: -1, max: -1 }. If higher or more consistent sample resolution is required, then consider creating a sampler at the desired resolution using ElevationLayer.createSampler or Ground.createSampler. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-GroundView.html#elevationSampler) */ readonly elevationSampler: ElevationSampler; /** * A collection containing a hierarchical list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of the [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) in the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-GroundView.html#layerViews) */ readonly layerViews: Collection; /** * Value is `true` when any of the ground layer views are updating. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-GroundView.html#updating) - * + * * @default false */ readonly updating: boolean; } interface GroundViewConstructor { - - - new(properties?: GroundViewProperties): GroundView; + new (properties?: GroundViewProperties): GroundView; } export const GroundView: GroundViewConstructor; - interface GroundViewProperties { - - } + interface GroundViewProperties {} 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; @@ -42244,64 +44445,60 @@ declare namespace __esri { 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; + new (properties?: GamepadInputDeviceProperties): GamepadInputDevice; } export const GamepadInputDevice: GamepadInputDeviceConstructor; - interface GamepadInputDeviceProperties { - - } + 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 - * + * 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; + 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 - * + * 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"; @@ -42310,37 +44507,46 @@ declare namespace __esri { 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; + new (properties?: InputProperties): Input; } export const Input: InputConstructor; - interface InputProperties { - - } + interface InputProperties {} interface CSVLayerView extends LayerView { + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to SceneView. By default, the maximum number of features is estimated automatically depending on the symbology, geometry complexity, memory consumption and display quality profile. Changing this setting to a higher value may lead to a significant decrease in performance and increase in memory usage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#maximumNumberOfFeatures) + */ + maximumNumberOfFeatures: number; + /** + * Signifies whether the maximum number of features has been exceeded. Not all features could be displayed when this value is `true`. This setting currently only applies to SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded: boolean; + /** * Highlights the given feature(s). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#highlight) - * + * * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. - * + * */ 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** + * 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** * * 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): @@ -42348,16 +44554,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryExtent) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ 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** + * 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** * * 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): @@ -42365,16 +44571,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatureCount) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ 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** + * 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** * * 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): @@ -42382,16 +44588,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatures) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ 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** + * 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** * * 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): @@ -42399,47 +44605,68 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryObjectIds) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryObjectIds(params?: Query | QueryProperties): IPromise; } interface CSVLayerViewConstructor { - - - new(properties?: CSVLayerViewProperties): CSVLayerView; + new (properties?: CSVLayerViewProperties): CSVLayerView; } export const CSVLayerView: CSVLayerViewConstructor; interface CSVLayerViewProperties extends LayerViewProperties { - + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to SceneView. By default, the maximum number of features is estimated automatically depending on the symbology, geometry complexity, memory consumption and display quality profile. Changing this setting to a higher value may lead to a significant decrease in performance and increase in memory usage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#maximumNumberOfFeatures) + */ + maximumNumberOfFeatures?: number; + /** + * Signifies whether the maximum number of features has been exceeded. Not all features could be displayed when this value is `true`. This setting currently only applies to SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded?: boolean; } interface FeatureLayerView extends LayerView { /** * The layer being viewed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#layer) */ readonly layer: FeatureLayer; + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to SceneView. By default, the maximum number of features is estimated automatically depending on the symbology, geometry complexity, memory consumption and display quality profile. Changing this setting to a higher value may lead to a significant decrease in performance and increase in memory usage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#maximumNumberOfFeatures) + */ + maximumNumberOfFeatures: number; + /** + * Signifies whether the maximum number of features has been exceeded. Not all features could be displayed when this value is `true`. This setting currently only applies to SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded: boolean; /** * Highlights the given feature(s). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) - * + * * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. - * + * */ 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** + * 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** * * 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. @@ -42448,16 +44675,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ 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** + * 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** * * 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. @@ -42466,16 +44693,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatureCount) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ 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** + * 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** * * 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. @@ -42484,16 +44711,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ 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** + * 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** * * 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. @@ -42502,11 +44729,11 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryObjectIds) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryObjectIds(params?: Query | QueryProperties): IPromise; } @@ -42514,60 +44741,69 @@ declare namespace __esri { interface FeatureLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.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-FeatureLayerView.html) */ - new(properties?: FeatureLayerViewProperties): FeatureLayerView; + new (properties?: FeatureLayerViewProperties): FeatureLayerView; } export const FeatureLayerView: FeatureLayerViewConstructor; interface FeatureLayerViewProperties extends LayerViewProperties { - + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to SceneView. By default, the maximum number of features is estimated automatically depending on the symbology, geometry complexity, memory consumption and display quality profile. Changing this setting to a higher value may lead to a significant decrease in performance and increase in memory usage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#maximumNumberOfFeatures) + */ + maximumNumberOfFeatures?: number; + /** + * Signifies whether the maximum number of features has been exceeded. Not all features could be displayed when this value is `true`. This setting currently only applies to SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded?: boolean; } interface GraphicsLayerView extends LayerView { /** - * Highlights the given feature(s). + * Highlights the given feature(s). * > **Known Limitations** Currently the highlight method is only supported in a [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-GraphicsLayerView.html#highlight) - * + * * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. - * + * */ highlight(target?: Graphic | Graphic[] | number | number[]): any; /** - * Returns all graphics available for drawing in the layer view as an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). - * + * Returns all graphics available for drawing in the layer view as a [collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GraphicsLayerView.html#queryGraphics) - * - * + * + * */ - queryGraphics(): IPromise; + queryGraphics(): Collection; } interface GraphicsLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.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-GraphicsLayerView.html) */ - new(properties?: GraphicsLayerViewProperties): GraphicsLayerView; + new (properties?: GraphicsLayerViewProperties): GraphicsLayerView; } export const GraphicsLayerView: GraphicsLayerViewConstructor; - interface GraphicsLayerViewProperties extends LayerViewProperties { - - } + interface GraphicsLayerViewProperties extends LayerViewProperties {} interface ImageryLayerView extends LayerView { /** * An object that provides the user access to [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) and their values in the layer. See the object specifications table below for details about each property. This object is used as input in the [pixelFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function for filtering and processing each pixel in the block. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) */ pixelData: ImageryLayerViewPixelData; @@ -42576,11 +44812,11 @@ declare namespace __esri { interface ImageryLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.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-ImageryLayerView.html) */ - new(properties?: ImageryLayerViewProperties): ImageryLayerView; + new (properties?: ImageryLayerViewProperties): ImageryLayerView; } export const ImageryLayerView: ImageryLayerViewConstructor; @@ -42588,23 +44824,22 @@ declare namespace __esri { interface ImageryLayerViewProperties extends LayerViewProperties { /** * An object that provides the user access to [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) and their values in the layer. See the object specifications table below for details about each property. This object is used as input in the [pixelFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function for filtering and processing each pixel in the block. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) */ pixelData?: ImageryLayerViewPixelData; } - export interface ImageryLayerViewPixelData extends Object { /** * The extent of the `pixelBlock`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) */ extent?: Extent; /** * An object representing the pixels in the view. This provides the user access to each pixel on the client via the `pixels` property of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) */ pixelBlock: PixelBlock; @@ -42613,69 +44848,65 @@ declare namespace __esri { interface KMLLayerView extends LayerView { /** * A collection of all the [MapImages](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) from visible sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisibleMapImages) */ readonly allVisibleMapImages: Collection; /** * A collection of all the points from visible sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePoints) */ readonly allVisiblePoints: Collection; /** * A collection of all the polygons from visible sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePolygons) */ readonly allVisiblePolygons: Collection; /** * A collection of all the polylines from visible sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePolylines) */ readonly allVisiblePolylines: Collection; } interface KMLLayerViewConstructor { - - - new(properties?: KMLLayerViewProperties): KMLLayerView; + new (properties?: KMLLayerViewProperties): KMLLayerView; } export const KMLLayerView: KMLLayerViewConstructor; - interface KMLLayerViewProperties extends LayerViewProperties { - - } + interface KMLLayerViewProperties extends LayerViewProperties {} /** * **MapImage** represents an image overlay draped onto the terrain. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ export interface KMLLayerViewMapImage extends Object { /** * Map image id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ id: number; /** * URL to the map image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ href: string; /** * The [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of the map image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ Extent: Extent; /** * Rotation of the map image about its center, in degrees. Values can be ±180. The default is 0 (north). Rotations are specified in a counterclockwise direction. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ rotation: number; @@ -42684,38 +44915,36 @@ declare namespace __esri { interface LayerView extends Accessor, corePromise { /** * The layer being viewed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#layer) */ readonly layer: Layer; /** * Value is `true` if the layer is suspended (i.e., layer will not redraw or update itself when the extent changes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#suspended) */ readonly suspended: boolean; /** * Value is `true` when the layer is updating; for example, if it is in the process of fetching data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#updating) - * + * * @default false */ readonly updating: boolean; /** * When `true`, the layer is visible in the view. Set this property to `false` to hide the layer from the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#visible) - * + * * @default true */ visible: boolean; } interface LayerViewConstructor { - - - new(properties?: LayerViewProperties): LayerView; + new (properties?: LayerViewProperties): LayerView; } export const LayerView: LayerViewConstructor; @@ -42723,9 +44952,9 @@ declare namespace __esri { interface LayerViewProperties { /** * When `true`, the layer is visible in the view. Set this property to `false` to hide the layer from the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#visible) - * + * * @default true */ visible?: boolean; @@ -42734,51 +44963,51 @@ declare namespace __esri { interface SceneLayerView extends LayerView { /** * Highlights the given feature(s). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#highlight) - * + * * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. - * + * */ 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 in the layer view and returns the 3D [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If query parameters are not provided, the extent and count of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the 3D [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If query parameters are not provided, the extent and count of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. * > To query for the extent of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryExtent) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryExtent) - * + * * @param params Specifies the attributes of the query. Only the[objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) and [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. - * + * */ queryExtent(params?: Query): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all loaded features is returned. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all loaded features is returned. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. * > To query for the count of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatureCount) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryFeatureCount) - * + * * @param params Specifies the attributes of the query. Only the[objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) and [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. - * + * */ queryFeatureCount(params?: Query): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features 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 loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. Querying more than 10.000 features returns an error, unless num is specified in the Query. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features 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 loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. Querying more than 10.000 features returns an error, unless num is specified in the Query. * > To execute a query against all the features in a Scene Service rather than only those loaded for the current view, you must use the [SceneLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryFeatures) - * + * * @param params Specifies the attributes of the query. Only the [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) and [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. - * + * */ queryFeatures(params?: Query): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns an array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns an array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. * > To query for ObjectIDs of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryObjectIds) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryObjectIds) - * + * * @param params Specifies the attributes of the query. Only the[objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) and [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. - * + * */ queryObjectIds(params?: Query): IPromise; } @@ -42786,85 +45015,82 @@ declare namespace __esri { interface SceneLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a [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-SceneLayerView.html) */ - new(properties?: SceneLayerViewProperties): SceneLayerView; + new (properties?: SceneLayerViewProperties): SceneLayerView; } export const SceneLayerView: SceneLayerViewConstructor; - interface SceneLayerViewProperties extends LayerViewProperties { - - } + interface SceneLayerViewProperties extends LayerViewProperties {} interface StreamLayerView extends LayerView, Evented { /** * The error that explains an unsuccessful attempt to connect to the stream service or an unexpected disconnection from the stream service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionError) */ readonly connectionError: Error; /** * The status of the Web Socket connection with the stream service. This property can be watched to see if the connection is lost unexpectedly. **Possible Values:** connected | disconnected - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionStatus) */ readonly connectionStatus: string; /** * Contains the attribute and spatial filters used to filter messages sent to the given layer view by a stream service. To change the filter for only a single layer view, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) method. The layer view's filter is always updated when the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method of the associated stream layer instance is called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) */ readonly filter: StreamLayerViewFilter; /** * Contains the collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) visible in the layer view for the live stream. Graphics may be removed from the layer view by calling the [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) method from [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics) */ graphics: Collection; /** * Opens a web socket connection with the stream service to start receiving messages. This is called internally when the StreamLayer is added to a view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connect) - * - * + * + * */ 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#connectionStatus) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#disconnect) - * - * + * + * */ 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 will be removed automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) - * + * * @param filter Updates the spatial and attribute [filters](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter). If `null`, all filters are cleared. * @param filter.geometry A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. If `null`, the spatial filter is cleared. * @param filter.where A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. - * + * */ updateFilter(filter: StreamLayerViewUpdateFilterFilter): IPromise; - on(name: "data-received", eventHandler: StreamLayerViewDataReceivedEventHandler): IHandle; } interface StreamLayerViewConstructor { /** * 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) */ - new(properties?: StreamLayerViewProperties): StreamLayerView; + new (properties?: StreamLayerViewProperties): StreamLayerView; } export const StreamLayerView: StreamLayerViewConstructor; @@ -42872,42 +45098,39 @@ declare namespace __esri { interface StreamLayerViewProperties extends LayerViewProperties { /** * Contains the collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) visible in the layer view for the live stream. Graphics may be removed from the layer view by calling the [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) method from [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics) */ graphics?: CollectionProperties; } - export interface StreamLayerViewDataReceivedEvent { - } - + export interface StreamLayerViewDataReceivedEvent {} export interface StreamLayerViewFilter extends Object { /** * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) */ geometry?: Extent; /** * A SQL where clause used to filter features by attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) */ where?: string; } - export interface StreamLayerViewUpdateFilterFilter extends Object { /** * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. If `null`, the spatial filter is cleared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) */ geometry?: Extent; /** * A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) */ where?: string; @@ -42916,71 +45139,71 @@ declare namespace __esri { interface MapView extends View, BreakpointsOwner { /** * Represents the view's center point; when setting the center, you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing a longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) properties are also set in the constructor. The returned [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object is always in the spatial reference of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) and may be modified internally. To persist the returned object, create a clone using [Point.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) */ center: Point; /** * Specifies constraints to [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale), [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom), and [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) that may be applied to the MapView. See object specification below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ constraints: MapViewConstraints; /** * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Extent.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-MapView.html#extent) - * + * * @default null */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) */ highlightOptions: MapViewHighlightOptions; /** * Defines which anchor stays still while resizing the browser window. The default, `center`, ensures the view's center point remains constantly visible as the window size changes. The other options allow the respective portion of the view to remain visible when the window's size is changed. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resizeAlign) - * + * * @default center */ resizeAlign: string; /** * The clockwise rotation of due north in relation to the top of the view in degrees. The view may be rotated by directly setting the rotation or by using the following mouse event: `Right-click + Drag`. Map rotation may be disabled by setting the `rotationEnabled` property in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) to `false`. See the code snippet below for an example of this. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) - * + * * @default 0 */ rotation: number; /** * Represents the map scale at the center of the view. Setting the scale immediately changes the view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) */ scale: number; /** * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) */ viewpoint: Viewpoint; /** * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) is a convenient way to set the initial extent of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) */ zoom: number; /** * Sets the focus on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#focus) - * - * + * + * */ focus(): void; /** @@ -42990,12 +45213,12 @@ declare namespace __esri { * * [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) (or array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html)) * * [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) * * Object with a combination of `target`, `center` and `scale` properties (with `target` being any of the types listed above). The `center` property is provided as a convenience to animate the [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) and is equivalent to specifying the `target` with the center [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * - * - * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [MapView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#animation). If a tiled map service is used as the basemap and `snapToZoom` property is set to `true` in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints), the `goTo` method will zoom to the level of detail (LOD) of the basemap that is nearest to the defined `target`. If `snapToZoom` property is set to `false`, the `goTo` method will zoom to the exact `target`. - * + * + * + * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [MapView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#animation). If a tiled map service is used as the basemap and `snapToZoom` property is set to `true` in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints), the `goTo` method will zoom in to fit the defined `target`. If `snapToZoom` property is set to `false`, the `goTo` method will zoom to the exact `target`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) - * + * * @param target The target location/viewpoint to animate to. When using an object for `target`, use the properties in the table below. * @param target.target The target of the animation. * @param target.center The [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) to go to. @@ -43005,62 +45228,79 @@ declare namespace __esri { * @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. 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; + goTo( + target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | MapViewGoToTarget, + options?: MapViewGoToOptions + ): IPromise; /** * Indicates whether there is an event listener on the instance that matches the provided event name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hasEventListener) - * - * + * + * */ hasEventListener(): void; /** * Returns the topmost feature from each layer that intersects the specified screen coordinates. The following layer types will return a result if a hit is made on an intersecting feature: [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html), [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html), [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html). At 4.6 and later, a hit test will always return a result from [VectorTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html). However, the result will only indicate the ID and the name of the layer within the [vector tile style](https://doc.arcgis.com/en/arcgis-online/reference/tile-layers.htm#ESRI_SECTION1_8F68399EB47B48FF9EF46719FCC96978) that intersects the screen point. Detailed attribute and spatial information about the actual feature represented in the layer is not returned. HitTest results returned from VectorTileLayers are primarily used for [Vector tile style editor applications](https://maps.esri.com/jg/VectorBasemapStyleEditor/index.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) - * + * * @param screenPoint The screen coordinates of the click on the view. * @param screenPoint.x The horizontal screen coordinate of the click on the view. * @param screenPoint.y The vertical screen coordinate of the click on the view. - * + * */ hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; /** * Registers an event handler on the instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#events-summary) for a list of listened events. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#on) - * + * * @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; /** - * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * 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-MapView.html#padding)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + * + * @param options Screenshot options. + * @param options.format The format of the resulting encoded data url. **Possible values**: jpg | png. + * @param options.layers When used, only the visible layers in this list will be included in the output. + * @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-MapView.html#padding)) and will be clipped to the view size. Defaults to the whole view (padding excluded). + * + */ + takeScreenshot(options?: MapViewTakeScreenshotOptions): IPromise; + /** + * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html) represents a point in terms of pixels relative to the top-left corner of the view. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) - * + * * @param screenPoint The screen coordinates to convert. * @param screenPoint.x The horizontal screen coordinate to convert. * @param screenPoint.y The vertical screen coordinate to convert. - * + * */ toMap(screenPoint: MapViewToMapScreenPoint): Point; /** - * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html). - * + * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html). The [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html) represents a point in terms of pixels relative to the top-left corner of the view. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toScreen) - * + * * @param point A point geometry. * @param screenPoint ScreenPoint object that will reference the result. - * + * */ toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; - on(name: "resize", eventHandler: MapViewResizeEventHandler): IHandle; on(name: "resize", modifiers: string[], eventHandler: MapViewResizeEventHandler): IHandle; @@ -43137,11 +45377,11 @@ declare namespace __esri { interface MapViewConstructor { /** * A MapView displays a 2D view of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance. An instance of MapView must be created to render a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) (along with its operational and base layers) in 2D. To render a map and its layers in 3D, see the documentation for [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). For a general overview of views, see [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) */ - new(properties?: MapViewProperties): MapView; + new (properties?: MapViewProperties): MapView; } export const MapView: MapViewConstructor; @@ -43149,75 +45389,73 @@ declare namespace __esri { interface MapViewProperties extends ViewProperties, BreakpointsOwnerProperties { /** * Represents the view's center point; when setting the center, you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing a longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) properties are also set in the constructor. The returned [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object is always in the spatial reference of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) and may be modified internally. To persist the returned object, create a clone using [Point.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) */ center?: PointProperties | number[]; /** * Specifies constraints to [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale), [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom), and [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) that may be applied to the MapView. See object specification below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ constraints?: MapViewConstraints; /** * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Extent.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-MapView.html#extent) - * + * * @default null */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) */ highlightOptions?: MapViewHighlightOptionsProperties; /** * Defines which anchor stays still while resizing the browser window. The default, `center`, ensures the view's center point remains constantly visible as the window size changes. The other options allow the respective portion of the view to remain visible when the window's size is changed. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resizeAlign) - * + * * @default center */ resizeAlign?: string; /** * The clockwise rotation of due north in relation to the top of the view in degrees. The view may be rotated by directly setting the rotation or by using the following mouse event: `Right-click + Drag`. Map rotation may be disabled by setting the `rotationEnabled` property in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) to `false`. See the code snippet below for an example of this. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) - * + * * @default 0 */ rotation?: number; /** * Represents the map scale at the center of the view. Setting the scale immediately changes the view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) */ scale?: number; /** * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) */ viewpoint?: ViewpointProperties; /** * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) is a convenient way to set the initial extent of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) */ zoom?: number; } export interface MapViewBlurEvent { - native: any; target: View; } export interface MapViewClickEvent { - button: number; buttons: number; @@ -43238,7 +45476,6 @@ declare namespace __esri { } export interface MapViewDoubleClickEvent { - button: number; buttons: number; @@ -43259,7 +45496,6 @@ declare namespace __esri { } export interface MapViewDragEvent { - action: string; angle: number; @@ -43286,7 +45522,6 @@ declare namespace __esri { } export interface MapViewFocusEvent { - native: any; target: View; @@ -43294,20 +45529,19 @@ declare namespace __esri { /** * Object specification for the result of the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) */ export interface HitTestResult extends Object { /** * An array of result objects returned from the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest). Results are returned when the location of the input screen coordinates intersect a [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the view. See the table below for the specification of each object in this array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) */ results: HitTestResultResults[]; } export interface MapViewHoldEvent { - button: number; buttons: number; @@ -43328,7 +45562,6 @@ declare namespace __esri { } export interface MapViewImmediateClickEvent { - button: number; buttons: number; @@ -43349,7 +45582,6 @@ declare namespace __esri { } export interface MapViewKeyDownEvent { - key: string; native: any; @@ -43364,7 +45596,6 @@ declare namespace __esri { } export interface MapViewKeyUpEvent { - native: any; stopPropagation: Function; @@ -43375,178 +45606,172 @@ declare namespace __esri { } export interface MapViewLayerviewCreateEvent { - layer: Layer; layerView: LayerView; } export interface MapViewLayerviewDestroyEvent { - layer: Layer; layerView: LayerView; } - export interface MapViewConstraints extends Object { /** * An array of [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html). If not specified, this value is read from the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). This property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ lods?: LOD[]; /** * The minimum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ minScale?: number; /** * The maximum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. Setting this value to `0` allows the user to overzoom layer tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ maxScale?: number; /** * The minimum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ minZoom?: number; /** * The maximum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. Setting this value to `0` allows the user to overzoom layer tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ maxZoom?: number; /** * When `true`, the view snaps to the next LOD when zooming in or out. When `false`, the zoom is continuous. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) - * + * * @default true */ snapToZoom?: boolean; /** * Indicates whether the user can rotate the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) - * + * * @default true */ rotationEnabled?: boolean; /** * A read-only property that specifies the levels of detail (LODs) read from the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveLODs?: LOD[]; /** * A read-only property that specifies the minimum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveMinZoom?: number; /** * A read-only property that specifies the maximum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveMaxZoom?: number; /** * A read-only property that specifies the minimum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveMinScale?: number; /** * A read-only property that specifies the maximum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveMaxScale?: number; } - export interface MapViewGoToOptions extends Object { /** * 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) - * + * * @default true */ animate?: boolean; /** * 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. 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) - * + * * @default ease */ easing?: string | Function; } - export interface MapViewGoToTarget extends Object { /** * The target of the animation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) */ target?: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint; /** * The [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) */ center?: number[]; /** * The [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) */ scale?: number; /** * The [MapView.zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) */ zoom?: number; } - export interface MapViewHighlightOptionsProperties extends Object { /** * The color of the highlight. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default #00ffff */ color?: Color | number[] | string; /** * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default 1 */ haloOpacity?: number; /** * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default 0.25 */ fillOpacity?: number; @@ -43555,64 +45780,131 @@ declare namespace __esri { export interface MapViewHighlightOptions extends AnonymousAccessor { /** * The color of the highlight. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default #00ffff */ color?: Color; /** * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default 1 */ haloOpacity?: number; /** * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default 0.25 */ fillOpacity?: number; } - export interface MapViewHitTestScreenPoint extends Object { /** * The horizontal screen coordinate of the click on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) */ x: number; /** * The vertical screen coordinate of the click on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) */ y: number; } + export interface MapViewTakeScreenshotOptions 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-MapView.html#takeScreenshot) + * + * @default jpg + */ + format?: string; + /** + * When used, only the visible layers in this list will be included in the output. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + layers?: Layer[]; + /** + * 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-MapView.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-MapView.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-MapView.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-MapView.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-MapView.html#takeScreenshot) + */ + area?: MapViewTakeScreenshotOptionsArea; + } + + export interface MapViewTakeScreenshotOptionsArea extends Object { + /** + * The x coordinate of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + x?: number; + /** + * The y coordinate of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + y?: number; + /** + * The width of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + width?: number; + /** + * The height of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + height?: number; + } export interface MapViewToMapScreenPoint extends Object { /** * The horizontal screen coordinate to convert. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) */ x: number; /** * The vertical screen coordinate to convert. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) */ y: number; } export interface MapViewMouseWheelEvent { - deltaY: number; native: any; @@ -43629,7 +45921,6 @@ declare namespace __esri { } export interface MapViewPointerDownEvent { - button: number; buttons: number; @@ -43652,7 +45943,6 @@ declare namespace __esri { } export interface MapViewPointerEnterEvent { - button: number; buttons: number; @@ -43675,7 +45965,6 @@ declare namespace __esri { } export interface MapViewPointerLeaveEvent { - button: number; buttons: number; @@ -43698,7 +45987,6 @@ declare namespace __esri { } export interface MapViewPointerMoveEvent { - button: number; buttons: number; @@ -43721,7 +46009,6 @@ declare namespace __esri { } export interface MapViewPointerUpEvent { - button: number; buttons: number; @@ -43744,7 +46031,6 @@ declare namespace __esri { } export interface MapViewResizeEvent { - height: number; oldHeight: number; @@ -43754,25 +46040,42 @@ declare namespace __esri { width: 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-MapView.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-MapView.html#Screenshot) + */ + dataUrl: string; + /** + * The raw RGBA image data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#Screenshot) + */ + data: ImageData; + } export interface MapViewDragEventOrigin extends Object { - x: number; y: number; } - export interface HitTestResultResults extends Object { /** * A graphic representing a feature in the view that intersects the input screen coordinates. If the graphic comes from a layer with an applied [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html), then the [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) property will be empty. Other properties may be empty based on the context in which the graphic is fetched. If the result comes from a [VectorTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html) then a static graphic is returned with two `attributes`: `layerId` and `layerName`. These correspond to the name and id of the style-layer in the [vector tile style](https://developers.arcgis.com/rest/services-reference/vector-tile-style.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) */ graphic: Graphic; /** * The point geometry in the spatial reference of the view corresponding with the input screen coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) */ mapPoint: Point; @@ -43781,42 +46084,40 @@ declare namespace __esri { 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; + new (properties?: gamepadGamepadSettingsProperties): gamepadGamepadSettings; } export const gamepadGamepadSettings: gamepadGamepadSettingsConstructor; @@ -43824,33 +46125,33 @@ declare namespace __esri { 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"; @@ -43859,75 +46160,71 @@ declare namespace __esri { 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; + new (properties?: NavigationProperties): Navigation; } export const Navigation: NavigationConstructor; - interface NavigationProperties { - - } + 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#alphaCompositingEnabled) - * + * * @default false */ alphaCompositingEnabled: boolean; /** - * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). + * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) */ camera: Camera; /** - * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). + * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) */ 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/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) */ clippingArea: Extent; /** * Specifies constraints for [Camera tilt](esri-Camera.html#tilt) and altitude that may be applied to the SceneView. See the object specification table below for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ constraints: SceneViewConstraints; /** - * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. + * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. * ```js - * const view = new SceneView({ + * var view = new SceneView({ * map: map, * container: "viewDiv" * }); - * + * * // Set the sun position to reflect the current time * view.environment.lighting.date = Date.now(); - * + * * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; - * + * * // Set a background color - * const view = new SceneView({ + * var view = new SceneView({ * container: "view", * map: map, * environment: { @@ -43940,82 +46237,82 @@ declare namespace __esri { * } * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ environment: SceneViewEnvironment; /** - * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) - * + * * @default null */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) */ highlightOptions: SceneViewHighlightOptions; /** - * SceneView can draw scenes in three different quality modes: `high`, `medium` and `low`. The `low` quality profile significantly increases performance on slower browsers and devices by reducing the memory limit and the visual quality in the following aspects: + * SceneView can draw scenes in three different quality modes: `high`, `medium` and `low`. The `low` quality profile significantly increases performance on slower browsers and devices by reducing the memory limit and the visual quality in the following aspects: * * Map resolution * * Scene layer detail level * * Anti-aliasing (edge smoothing) - * - * - * The high and medium quality profiles only differ in the maximum amount of memory which the view is allowed to use. A higher memory limit improves quality in complex web scenes with many layers, but can have a negative impact on drawing performance and stability. The default value is based on the detected browser: + * + * + * The high and medium quality profiles only differ in the maximum amount of memory which the view is allowed to use. A higher memory limit improves quality in complex web scenes with many layers, but can have a negative impact on drawing performance and stability. The default value is based on the detected browser: * * `low` for Internet Explorer 11 and certain mobile devices * * `medium` for any other browser - * - * + * + * * Overriding the default value is best done in the constructor (see example below). If the value is modified after construction, only a subset of the quality aspects are affected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#qualityProfile) */ qualityProfile: string; /** * Represents an approximation of the map scale at the center of the view. Setting the scale immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) property. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) */ scale: number; /** - * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. - * + * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. + * * Value | Example | Description * ------|-------|------------ * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) - * + * * @default global */ viewingMode: string; /** * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. In SceneViews, [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) should be used in favor of viewpoint for watching or changing the point of view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) is also set in the constructor. The viewpoint property contains an internal reference which may be modified in the future. To persist or modify the viewpoint, create a clone using [viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) */ viewpoint: Viewpoint; /** * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) is a convenient way to set the initial extent of the view. If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), or [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) properties are also set in the constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) */ zoom: number; /** * Sets the focus on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#focus) - * - * + * + * */ focus(): void; /** @@ -44026,12 +46323,12 @@ declare namespace __esri { * * [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) * * [Camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html) * * Object with a combination of `target`, `center`, `scale`, `position`, `heading` and `tilt` properties (with `target` being any of the types listed above). The `center` property is provided as a convenience to animate the [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) and is the equivalent of specifying the `target` with the center [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The target must be provided in the spatial reference of the view. - * - * + * + * * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [SceneView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#animation). If the given target is far away from the current camera position, then heading and tilt will be automatically set to their neutral values (facing north, looking top down). Tilt and heading can always be explicitly set to override this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) - * + * * @param target The target location/viewpoint to go to. When using an object for `target`, use the properties in the table below. * @param target.target The target of the animation. * @param target.center The [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) to go to. @@ -44046,77 +46343,79 @@ declare namespace __esri { * @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`, `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; + goTo( + target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | SceneViewGoToTarget, + options?: SceneViewGoToOptions + ): IPromise; /** * Indicates whether there is an event listener on the instance that matches the provided event name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hasEventListener) - * - * + * + * */ hasEventListener(): void; /** * Returns the topmost feature from each layer that intersects the specified screen coordinates. The following layer types will return a result if a hit is made on an intersecting feature: [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html), [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html), [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html). Draped graphics (i.e. graphics in layers where the [elevation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) is `on-the-ground`) are currently **not** returned from this method, even when they intersect the input screen point. When the ground surface is hit, but no graphic is found, then the result of hitTest will be a single object with its mapPoint set to the point on the surface that was hit, but its graphic will be set to `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) - * + * * @param screenPoint The screen coordinates of the click on the view. * @param screenPoint.x The horizontal screen coordinate of the click on the view. * @param screenPoint.y The vertical screen coordinate of the click on the view. - * + * */ hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; /** * Registers an event handler on the instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#events-summary) for a list of listened events. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#on) - * + * * @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; + 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) - * + * * @param screenPoint The screen coordinates to convert. * @param screenPoint.x The horizontal screen coordinate to convert. * @param screenPoint.y The vertical screen coordinate to convert. * @param mapPoint The point object that will reference the result. - * + * */ toMap(screenPoint: SceneViewToMapScreenPoint, mapPoint?: Point): Point; /** * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toScreen) - * + * * @param point A point geometry. * @param screenPoint ScreenPoint object that will reference the result. - * + * */ toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; - on(name: "resize", eventHandler: SceneViewResizeEventHandler): IHandle; on(name: "resize", modifiers: string[], eventHandler: SceneViewResizeEventHandler): IHandle; @@ -44193,11 +46492,11 @@ declare namespace __esri { interface SceneViewConstructor { /** * A SceneView displays a 3D view of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) instance using WebGL. To render a map and its layers in 2D, see the documentation for [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). For a general overview of views, see [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) */ - new(properties?: SceneViewProperties): SceneView; + new (properties?: SceneViewProperties): SceneView; } export const SceneView: SceneViewConstructor; @@ -44205,54 +46504,54 @@ declare namespace __esri { interface SceneViewProperties extends ViewProperties, BreakpointsOwnerProperties { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#alphaCompositingEnabled) - * + * * @default false */ alphaCompositingEnabled?: boolean; /** - * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). + * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) */ camera?: CameraProperties; /** - * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). + * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) */ 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/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) */ clippingArea?: ExtentProperties; /** * Specifies constraints for [Camera tilt](esri-Camera.html#tilt) and altitude that may be applied to the SceneView. See the object specification table below for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ constraints?: SceneViewConstraintsProperties; /** - * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. + * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. * ```js - * const view = new SceneView({ + * var view = new SceneView({ * map: map, * container: "viewDiv" * }); - * + * * // Set the sun position to reflect the current time * view.environment.lighting.date = Date.now(); - * + * * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; - * + * * // Set a background color - * const view = new SceneView({ + * var view = new SceneView({ * container: "view", * map: map, * environment: { @@ -44265,86 +46564,84 @@ declare namespace __esri { * } * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ environment?: SceneViewEnvironmentProperties; /** - * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) - * + * * @default null */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) */ highlightOptions?: SceneViewHighlightOptionsProperties; /** - * SceneView can draw scenes in three different quality modes: `high`, `medium` and `low`. The `low` quality profile significantly increases performance on slower browsers and devices by reducing the memory limit and the visual quality in the following aspects: + * SceneView can draw scenes in three different quality modes: `high`, `medium` and `low`. The `low` quality profile significantly increases performance on slower browsers and devices by reducing the memory limit and the visual quality in the following aspects: * * Map resolution * * Scene layer detail level * * Anti-aliasing (edge smoothing) - * - * - * The high and medium quality profiles only differ in the maximum amount of memory which the view is allowed to use. A higher memory limit improves quality in complex web scenes with many layers, but can have a negative impact on drawing performance and stability. The default value is based on the detected browser: + * + * + * The high and medium quality profiles only differ in the maximum amount of memory which the view is allowed to use. A higher memory limit improves quality in complex web scenes with many layers, but can have a negative impact on drawing performance and stability. The default value is based on the detected browser: * * `low` for Internet Explorer 11 and certain mobile devices * * `medium` for any other browser - * - * + * + * * Overriding the default value is best done in the constructor (see example below). If the value is modified after construction, only a subset of the quality aspects are affected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#qualityProfile) */ qualityProfile?: string; /** * Represents an approximation of the map scale at the center of the view. Setting the scale immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) property. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) */ scale?: number; /** - * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. - * + * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. + * * Value | Example | Description * ------|-------|------------ * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) - * + * * @default global */ viewingMode?: string; /** * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. In SceneViews, [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) should be used in favor of viewpoint for watching or changing the point of view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) is also set in the constructor. The viewpoint property contains an internal reference which may be modified in the future. To persist or modify the viewpoint, create a clone using [viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) */ viewpoint?: ViewpointProperties; /** * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) is a convenient way to set the initial extent of the view. If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), or [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) properties are also set in the constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) */ zoom?: number; } export interface SceneViewBlurEvent { - native: any; target: View; } export interface SceneViewClickEvent { - button: number; buttons: number; @@ -44365,7 +46662,6 @@ declare namespace __esri { } export interface SceneViewDoubleClickEvent { - button: number; buttons: number; @@ -44386,7 +46682,6 @@ declare namespace __esri { } export interface SceneViewDragEvent { - action: string; angle: number; @@ -44415,7 +46710,6 @@ declare namespace __esri { export type EasingFunction = (t: number, duration: number) => number; export interface SceneViewFocusEvent { - native: any; target: View; @@ -44423,20 +46717,19 @@ declare namespace __esri { /** * Object specification for the result of the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ export interface SceneViewHitTestResult extends Object { /** * An array of result objects returned from the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest). Results are returned when the location of the input screen coordinates intersect a [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the view. See the table below for the specification of each object in this array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ results: SceneViewHitTestResultResults[]; } export interface SceneViewHoldEvent { - button: number; buttons: number; @@ -44457,7 +46750,6 @@ declare namespace __esri { } export interface SceneViewImmediateClickEvent { - button: number; buttons: number; @@ -44478,7 +46770,6 @@ declare namespace __esri { } export interface SceneViewKeyDownEvent { - key: string; native: any; @@ -44493,7 +46784,6 @@ declare namespace __esri { } export interface SceneViewKeyUpEvent { - native: any; stopPropagation: Function; @@ -44504,21 +46794,18 @@ declare namespace __esri { } export interface SceneViewLayerviewCreateEvent { - layer: Layer; layerView: LayerView; } export interface SceneViewLayerviewDestroyEvent { - layer: Layer; layerView: LayerView; } export interface SceneViewMouseWheelEvent { - deltaY: number; native: any; @@ -44535,7 +46822,6 @@ declare namespace __esri { } export interface SceneViewPointerDownEvent { - button: number; buttons: number; @@ -44558,7 +46844,6 @@ declare namespace __esri { } export interface SceneViewPointerEnterEvent { - button: number; buttons: number; @@ -44581,7 +46866,6 @@ declare namespace __esri { } export interface SceneViewPointerLeaveEvent { - button: number; buttons: number; @@ -44604,7 +46888,6 @@ declare namespace __esri { } export interface SceneViewPointerMoveEvent { - button: number; buttons: number; @@ -44627,7 +46910,6 @@ declare namespace __esri { } export interface SceneViewPointerUpEvent { - button: number; buttons: number; @@ -44650,7 +46932,6 @@ declare namespace __esri { } export interface SceneViewResizeEvent { - height: number; oldHeight: number; @@ -44660,29 +46941,28 @@ declare namespace __esri { width: number; } - export interface SceneViewConstraintsProperties extends Object { /** - * Specifies a constraint on the minimum and maximum allowed camera altitude. - * + * Specifies a constraint on the minimum and maximum allowed camera altitude. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ altitude?: SceneViewConstraintsAltitudeProperties; /** * Specifies the near and far webgl clip distances. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ clipDistance?: SceneViewConstraintsClipDistanceProperties; /** * When enabled, prevents the user from navigating below the surface in a local SceneView. This property is deprecated, please use [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) instead. **Deprecated since version 4.8** - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ collision?: SceneViewConstraintsCollision; /** * Specifies a constraint on the amount of allowed tilting of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ tilt?: SceneViewConstraintsTiltProperties; @@ -44690,46 +46970,45 @@ declare namespace __esri { export interface SceneViewConstraints extends AnonymousAccessor { /** - * Specifies a constraint on the minimum and maximum allowed camera altitude. - * + * Specifies a constraint on the minimum and maximum allowed camera altitude. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ altitude?: SceneViewConstraintsAltitude; /** * Specifies the near and far webgl clip distances. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ clipDistance?: SceneViewConstraintsClipDistance; /** * When enabled, prevents the user from navigating below the surface in a local SceneView. This property is deprecated, please use [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) instead. **Deprecated since version 4.8** - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ collision?: SceneViewConstraintsCollision; /** * Specifies a constraint on the amount of allowed tilting of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ tilt?: SceneViewConstraintsTilt; } - export interface SceneViewConstraintsAltitudeProperties extends Object { /** * The minimum allowed camera altitude (in meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default -∞ */ min?: number; /** * The maximum allowed camera altitude (in meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default EARTH_RADIUS * 4 */ max?: number; @@ -44738,41 +47017,40 @@ declare namespace __esri { export interface SceneViewConstraintsAltitude extends AnonymousAccessor { /** * The minimum allowed camera altitude (in meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default -∞ */ min?: number; /** * The maximum allowed camera altitude (in meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default EARTH_RADIUS * 4 */ max?: number; } - export interface SceneViewConstraintsClipDistanceProperties extends Object { /** * The near clip distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ near?: number; /** * The far clip distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ far?: number; /** * Specifies the mode of the constraint which is either `auto` or `manual`. In `auto` mode, the near and far clip distance values are automatically determined. In `manual` mode, the near and far clip distance values are user defined, constant values. Note that the mode automatically changes to `manual` whenever the `near` or `far` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default auto */ mode?: string; @@ -44781,51 +47059,49 @@ declare namespace __esri { export interface SceneViewConstraintsClipDistance extends AnonymousAccessor { /** * The near clip distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ near?: number; /** * The far clip distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ far?: number; /** * Specifies the mode of the constraint which is either `auto` or `manual`. In `auto` mode, the near and far clip distance values are automatically determined. In `manual` mode, the near and far clip distance values are user defined, constant values. Note that the mode automatically changes to `manual` whenever the `near` or `far` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default auto */ mode?: string; } - export interface SceneViewConstraintsCollision extends Object { /** * Set to `false` to permit the user to navigate below the surface in a local SceneView. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default true */ enabled?: boolean; } - export interface SceneViewConstraintsTiltProperties extends Object { /** * Specifies the maximum amount of tilt (in degrees) allowed in the view and may range from 0.5 to 179.5 degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ max?: number; /** * Specifies the mode of the constraint. There are two possible values: `auto` or `manual`. In `auto` mode, the maximum tilt value is automatically determined based on the altitude of the view camera. In `manual` mode, the maximum tilt value is a user defined, constant value. **Note:** The mode automatically changes to `manual` whenever the `max` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default auto */ mode?: string; @@ -44834,51 +47110,50 @@ declare namespace __esri { export interface SceneViewConstraintsTilt extends AnonymousAccessor { /** * Specifies the maximum amount of tilt (in degrees) allowed in the view and may range from 0.5 to 179.5 degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ max?: number; /** * Specifies the mode of the constraint. There are two possible values: `auto` or `manual`. In `auto` mode, the maximum tilt value is automatically determined based on the altitude of the view camera. In `manual` mode, the maximum tilt value is a user defined, constant value. **Note:** The mode automatically changes to `manual` whenever the `max` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default auto */ mode?: string; } - export interface SceneViewEnvironmentProperties extends Object { /** * 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. Currently [ColorBackground](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) is the only type of background supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ background?: BackgroundProperties; /** * Lighting conditions of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ lighting?: SceneViewEnvironmentLightingProperties; /** * Indicates whether atmosphere visualization is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ atmosphereEnabled?: boolean; /** * Atmosphere conditions of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ atmosphere?: SceneViewEnvironmentAtmosphereProperties; /** * Indicates whether stars visualization is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default true */ starsEnabled?: boolean; @@ -44887,51 +47162,50 @@ declare namespace __esri { export interface SceneViewEnvironment extends AnonymousAccessor { /** * 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. Currently [ColorBackground](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) is the only type of background supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ background?: Background; /** * Lighting conditions of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ lighting?: SceneViewEnvironmentLighting; /** * Indicates whether atmosphere visualization is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ atmosphereEnabled?: boolean; /** * Atmosphere conditions of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ atmosphere?: SceneViewEnvironmentAtmosphere; /** * Indicates whether stars visualization is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default true */ starsEnabled?: boolean; } - export interface SceneViewEnvironmentAtmosphereProperties extends Object { /** - * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). - * + * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). + * * Known Value | Example * ------------|--------- * 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) - * + * * @default low */ quality?: string; @@ -44939,52 +47213,51 @@ declare namespace __esri { export interface SceneViewEnvironmentAtmosphere extends AnonymousAccessor { /** - * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). - * + * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). + * * Known Value | Example * ------------|--------- * 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) - * + * * @default low */ quality?: string; } - export interface SceneViewEnvironmentLightingProperties extends Object { /** * The current date and time of the simulated sun. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default new Date("March 15, 2015 12:00:00") */ date?: DateProperties; /** * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default false */ directShadowsEnabled?: boolean; /** * Indicates whether to show ambient occlusion shading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default false */ ambientOcclusionEnabled?: boolean; /** * Indicates whether the date and time of the simulated sun is automatically updated to maintain the current time of day while the camera changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default true */ cameraTrackingEnabled?: boolean; @@ -44993,147 +47266,144 @@ declare namespace __esri { export interface SceneViewEnvironmentLighting extends AnonymousAccessor { /** * The current date and time of the simulated sun. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default new Date("March 15, 2015 12:00:00") */ date?: Date; /** * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default false */ directShadowsEnabled?: boolean; /** * Indicates whether to show ambient occlusion shading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default false */ ambientOcclusionEnabled?: boolean; /** * Indicates whether the date and time of the simulated sun is automatically updated to maintain the current time of day while the camera changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default true */ cameraTrackingEnabled?: boolean; } - export interface SceneViewGoToOptions extends Object { /** * 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) - * + * * @default true */ animate?: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) - * + * * @default 1 */ speedFactor?: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ duration?: number; /** * The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) - * + * * @default 8000 */ 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`, `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) */ easing?: string | EasingFunction; } - export interface SceneViewGoToTarget extends Object { /** * The target of the animation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ target?: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera; /** * The [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ center?: number[] | Point; /** * The [SceneView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ scale?: number; /** * The final [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) value to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ zoom?: number; /** * The [Camera.heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ heading?: number; /** * The [Camera.tilt](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ tilt?: number; /** * The [Camera.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ position?: Point; } - export interface SceneViewHighlightOptionsProperties extends Object { /** * The color of the highlight. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default #00ffff */ color?: Color | number[] | string; /** * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default 1 */ haloOpacity?: number; /** * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default 0.25 */ fillOpacity?: number; @@ -45142,123 +47412,119 @@ declare namespace __esri { export interface SceneViewHighlightOptions extends AnonymousAccessor { /** * The color of the highlight. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default #00ffff */ color?: Color; /** * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default 1 */ haloOpacity?: number; /** * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default 0.25 */ fillOpacity?: number; } - export interface SceneViewHitTestScreenPoint extends Object { /** * The horizontal screen coordinate of the click on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) */ x: number; /** * The vertical screen coordinate of the click on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) */ y: number; } - 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) */ x: number; /** * The vertical screen coordinate to convert. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) */ y: number; @@ -45266,43 +47532,40 @@ declare namespace __esri { /** * 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 { + export interface SceneViewScreenshot 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 { - x: number; y: number; } - export interface SceneViewHitTestResultResults extends Object { /** * A graphic present in the view that intersects the input screen coordinates. If the graphic comes from a layer with an applied [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html), then the [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) property will be empty. Other properties will be empty based on the context in which the graphic is fetched. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ graphic: Graphic; /** * The point geometry in the spatial reference of the view corresponding with the input screen coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ mapPoint: Point; @@ -45310,9 +47573,9 @@ declare namespace __esri { interface DefaultUI extends UI { /** - * An array of strings representing the default widgets visible when 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) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` + * An array of strings representing the default widgets visible when 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) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content. For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation. For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) */ components: string[]; @@ -45321,20 +47584,20 @@ declare namespace __esri { interface DefaultUIConstructor { /** * The DefaultUI class exposes the default [widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) [components](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) available in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This class also provides a simple API for [adding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#add), [moving](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#move) and [removing](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#remove) [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) and other HTML components from the view's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) */ - new(properties?: DefaultUIProperties): DefaultUI; + new (properties?: DefaultUIProperties): DefaultUI; } export const DefaultUI: DefaultUIConstructor; interface DefaultUIProperties extends UIProperties { /** - * An array of strings representing the default widgets visible when 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) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` + * An array of strings representing the default widgets visible when 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) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content. For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation. For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) */ components?: string[]; @@ -45343,42 +47606,42 @@ declare namespace __esri { interface UI extends Accessor { /** * The HTML Element that contains the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) */ container: HTMLElement; /** * The height of the UI container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#height) */ readonly height: number; /** * Defines the padding for the UI from the top, left, right, and bottom sides of the container or [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). If the value is a number, it will be used to pad all sides of the container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#padding) - * + * * @default { left: 15, top: 15, right: 15, bottom: 15 } */ padding: any | number; /** * The view associated with the UI components. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#view) */ view: MapView | SceneView; /** * The width of the UI container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#width) */ readonly width: number; /** * Adds one or more HTML component(s) or [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) to the UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) - * + * * @param component The component(s) to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. * @param component.component The component to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID. * @param component.position The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual @@ -45386,37 +47649,37 @@ declare namespace __esri { * @param position The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param position.position The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param position.index The placement index of the component(s). This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. - * + * */ add(component: Widget | HTMLElement | string | any[] | UIAddComponent, position?: string | UIAddPosition): void; /** * Removes all components from a given position. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#empty) - * + * * @param position The position from which to remove all components. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * */ empty(position?: string): void; /** * Moves one or more UI component(s) to the specified position. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) - * + * * @param component The component(s) to move. This value can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. * @param component.component The component to move. This can be a widget instance, HTML element, a string value representing a DOM node ID. * @param component.position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * */ move(component: Widget | HTMLElement | string | any[] | UIMoveComponent, position?: string): void; /** * Removes one or more HTML component(s) or [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) from the UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#remove) - * + * * @param component The component(s) to remove from the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. - * + * */ remove(component: Widget | HTMLElement | string | any[]): void; } @@ -45424,11 +47687,11 @@ declare namespace __esri { interface UIConstructor { /** * This class provides a simple interface for [adding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add), [moving](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) and [removing](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#remove) components from a view's user interface (UI). In most cases, you will work with the view's [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) which places default [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html), such as [Zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html) and [Attribution](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html) */ - new(properties?: UIProperties): UI; + new (properties?: UIProperties): UI; } export const UI: UIConstructor; @@ -45436,75 +47699,72 @@ declare namespace __esri { interface UIProperties { /** * The HTML Element that contains the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) */ container?: HTMLElement; /** * Defines the padding for the UI from the top, left, right, and bottom sides of the container or [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). If the value is a number, it will be used to pad all sides of the container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#padding) - * + * * @default { left: 15, top: 15, right: 15, bottom: 15 } */ padding?: any | number; /** * The view associated with the UI components. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#view) */ view?: MapViewProperties | SceneViewProperties; } - export interface UIAddComponent extends Object { /** * The component to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ component: Widget | HTMLElement | string; /** * The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ position?: string; /** * The placement index of the component. This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ index?: number; } - export interface UIAddPosition extends Object { /** * The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ position?: string; /** * The placement index of the component(s). This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ index: number; } - export interface UIMoveComponent extends Object { /** * The component to move. This can be a widget instance, HTML element, a string value representing a DOM node ID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) */ component: Widget | HTMLElement | string; /** * The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) */ position?: string; @@ -45513,134 +47773,134 @@ declare namespace __esri { interface View extends Accessor, corePromise, DOMContainer { /** * Collection containing a flat list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) related to the basemap, operational layers, and group layers in this view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#allLayerViews) */ allLayerViews: Collection; /** * Represents an ongoing view animation initialized by [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). You may [watch](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch) this property to be notified when the view's extent changes . - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#animation) */ animation: ViewAnimation; /** * Allows for adding [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) directly to the default graphics in the View. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) */ graphics: Collection; /** * The view for the ground of the map. - * + * * [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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#interacting) - * + * * @default false */ readonly interacting: boolean; /** * A collection containing a hierarchical list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of the [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#layerViews) */ layerViews: Collection; /** * An instance of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) object to display in the view. A view may only display one map at a time. On the other hand, one [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) may be viewed by multiple [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and/or [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) simultaneously. This property is typically set in the constructor of 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). See the [class description](#) for examples demonstrating the relationship between the map and the view. - * + * * [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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) - * + * * @default {left: 0, top: 0, right: 0, bottom: 0} */ padding: ViewPadding; /** - * When `true`, this property indicates whether the view successfully satisfied all dependencies, signaling that the following conditions are met. + * When `true`, this property indicates whether the view successfully satisfied all dependencies, signaling that the following conditions are met. * * The view has a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map). If [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) is a [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html) or a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html), then the map or scene must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded). * * The view has a [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) with a size greater than `0`. * * The view has a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference). - * - * + * + * * When a view becomes ready it will resolve itself and invoke the callback defined in [when()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#when) where code can execute on a working view. Subsequent changes to a view's readiness would typically be handled by watching `view.ready` and providing logic for cases where the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) or [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ready) - * + * * @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: + * 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. * * In all other cases, the spatial reference is derived from the first layer that loads in this order: * * [map.basemap.baseLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) * * [map.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) * * [map.ground.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) - * - * + * + * * When using an [Esri basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), the default spatial reference is Web Mercator Auxiliary Sphere. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) - * + * * @default null */ spatialReference: SpatialReference; /** * Indication whether the view is animating, being interacted with or resizing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#stationary) - * + * * @default true */ readonly stationary: boolean; /** * The type of the view is either `2d` (indicating a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)) or `3d` (indicating a [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-View.html#type) */ readonly type: string; /** * Indicates whether the view is being updated by additional data requests to the network, or by processing received data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#updating) - * + * * @default false */ readonly updating: boolean; /** * Gets the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) created on the view for the given layer. The returned promise resolves when the layer view for the given layer has been created, or rejects with an error (for example if the layer is not part of the view, or if the layer type is not supported in this view). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView) - * + * * @param layer The layer for which to obtain its LayerView. - * + * */ whenLayerView(layer: Layer): IPromise; } @@ -45648,11 +47908,11 @@ declare namespace __esri { interface ViewConstructor { /** * A view provides the means of viewing and interacting with the components of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). The [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) is merely a container, storing the geographic information contained in base layers and operational layers. The View renders the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) and its various [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers), making them visible to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) */ - new(properties?: ViewProperties): View; + new (properties?: ViewProperties): View; } export const View: ViewConstructor; @@ -45660,83 +47920,82 @@ declare namespace __esri { interface ViewProperties extends DOMContainerProperties { /** * Collection containing a flat list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) related to the basemap, operational layers, and group layers in this view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#allLayerViews) */ allLayerViews?: CollectionProperties; /** * Represents an ongoing view animation initialized by [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). You may [watch](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch) this property to be notified when the view's extent changes . - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#animation) */ animation?: ViewAnimationProperties; /** * Allows for adding [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) directly to the default graphics in the View. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) */ graphics?: CollectionProperties; /** * A collection containing a hierarchical list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of the [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#layerViews) */ layerViews?: CollectionProperties; /** * An instance of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) object to display in the view. A view may only display one map at a time. On the other hand, one [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) may be viewed by multiple [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and/or [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) simultaneously. This property is typically set in the constructor of 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). See the [class description](#) for examples demonstrating the relationship between the map and the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) */ map?: MapProperties; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) - * + * * @default {left: 0, top: 0, right: 0, bottom: 0} */ padding?: ViewPadding; /** - * 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: + * 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. * * In all other cases, the spatial reference is derived from the first layer that loads in this order: * * [map.basemap.baseLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) * * [map.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) * * [map.ground.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) - * - * + * + * * When using an [Esri basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), the default spatial reference is Web Mercator Auxiliary Sphere. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) - * + * * @default null */ spatialReference?: SpatialReferenceProperties; } - export interface ViewPadding extends Object { /** * The left padding (in pixels). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) */ left?: number; /** * The top padding (in pixels). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) */ top?: number; /** * The right padding (in pixels). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) */ right?: number; /** * The bottom padding (in pixels). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) */ bottom?: number; @@ -45744,34 +48003,34 @@ declare namespace __esri { interface ViewAnimation extends Accessor, corePromise { /** - * The state of the animation. The animation terminates when the state is either `finished` or `stopped` and cannot transition again to `running`. The `finished` state indicates the animation has successfully ended, while the `stopped` state indicates that the animation was interrupted before it reached its final target. **Possible Values:** running | finished | stopped - * + * The state of the animation. The animation terminates when the state is either `finished` or `stopped` and cannot transition again to `running`. The `finished` state indicates the animation has successfully ended, while the `stopped` state indicates that the animation was interrupted before it reached its final target. **Possible Values:** running | finished | stopped | waiting-for-target + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#state) - * + * * @default running */ readonly state: string; /** * The target of the animation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#target) */ target: Viewpoint; /** * Finishes the view animation by immediately going to the target and sets the state of the animation to `finished`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#finish) - * - * + * + * */ finish(): void; /** * Stops the view animation at its current state and sets the state of the animation to `stopped`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#stop) - * - * + * + * */ stop(): void; } @@ -45779,11 +48038,11 @@ declare namespace __esri { interface ViewAnimationConstructor { /** * Contains a [state](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#state) property used for checking the state of the animation. The view animation is resolved when the animation has `finished` and is rejected if it is `stopped`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html) */ - new(properties?: ViewAnimationProperties): ViewAnimation; + new (properties?: ViewAnimationProperties): ViewAnimation; } export const ViewAnimation: ViewAnimationConstructor; @@ -45791,7 +48050,7 @@ declare namespace __esri { interface ViewAnimationProperties { /** * The target of the animation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#target) */ target?: ViewpointProperties; @@ -45800,99 +48059,99 @@ declare namespace __esri { interface WebMap extends Map, corePromise { /** * Object responsible for containing the viewing and editing properties of the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#applicationProperties) */ applicationProperties: any; /** * An array of saved geographic extents that allow end users to quickly navigate to a particular area of interest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#initialViewProperties) */ initialViewProperties: InitialViewProperties; /** * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A WebMap is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap) are created, but not yet loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The Error object returned if an error occurred while loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadError) - * + * * @default null */ readonly loadError: Error; /** - * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#load) operation. - * + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#load) operation. + * * Value | Description * ------|------------ * not-loaded | The object's resources have not loaded. * loading | The object's resources are currently loading. * loaded | The object's resources have loaded without errors. * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadError) for more details. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadStatus) - * + * * @default not-loaded */ readonly loadStatus: string; /** * The portal item from which the WebMap is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem) */ portalItem: PortalItem; /** * Provides multiple slides. Each slide has a different "title", "extent", "basemap", "layers" etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#presentation) */ presentation: any; /** * The version of the source document from which the WebMap was read. The WebMap must be version 2.x to load into an app. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) */ readonly sourceVersion: WebMapSourceVersion; /** * An array of table objects in the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#tables) */ tables: any[]; /** * The widgets object contains widgets that should be exposed to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#widgets) */ widgets: any; /** * Triggers the loading of the WebMap instance. A WebMap is considered [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loaded) when its [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap) are fully created. When created with a [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem), `load()` will first fetch its data to create the content, otherwise it resolves immediately. The [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) automatically calls the `load()` method when a WebMap instance is added to its [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) property so it can display in the view and load each individual layer. If the WebMap is used outside of a view, for example to preload it, you must call `load()` explicitly to interact with its resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#load) - * - * + * + * */ 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; } @@ -45900,11 +48159,11 @@ declare namespace __esri { interface WebMapConstructor { /** * Loads a [WebMap](https://doc.arcgis.com/en/arcgis-online/create-maps/make-your-first-map.htm) from [ArcGIS Online](https://www.arcgis.com/home/) or [ArcGIS Enterprise portal](https://enterprise.arcgis.com/en/portal/latest/administer/windows/what-is-portal-for-arcgis-.htm) into a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html) */ - new(properties?: WebMapProperties): WebMap; + new (properties?: WebMapProperties): WebMap; } export const WebMap: WebMapConstructor; @@ -45912,43 +48171,43 @@ declare namespace __esri { interface WebMapProperties extends MapProperties { /** * Object responsible for containing the viewing and editing properties of the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#applicationProperties) */ applicationProperties?: any; /** * An array of saved geographic extents that allow end users to quickly navigate to a particular area of interest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#initialViewProperties) */ initialViewProperties?: InitialViewPropertiesProperties; /** * The portal item from which the WebMap is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem) */ portalItem?: PortalItemProperties; /** * Provides multiple slides. Each slide has a different "title", "extent", "basemap", "layers" etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#presentation) */ presentation?: any; /** * An array of table objects in the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#tables) */ tables?: any[]; /** * The widgets object contains widgets that should be exposed to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#widgets) */ widgets?: any; @@ -45957,28 +48216,26 @@ declare namespace __esri { 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; + new (properties?: BookmarkProperties): Bookmark; } export const Bookmark: BookmarkConstructor; @@ -45986,29 +48243,28 @@ declare namespace __esri { 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; @@ -46017,31 +48273,29 @@ declare namespace __esri { 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference) */ spatialReference: SpatialReference; /** * The initial viewpoint of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint) */ viewpoint: Viewpoint; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#clone) - * - * + * + * */ clone(): InitialViewProperties; } interface InitialViewPropertiesConstructor { - - - new(properties?: InitialViewPropertiesProperties): InitialViewProperties; + new (properties?: InitialViewPropertiesProperties): InitialViewProperties; } export const InitialViewProperties: InitialViewPropertiesConstructor; @@ -46049,29 +48303,28 @@ declare namespace __esri { interface InitialViewPropertiesProperties { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * The initial viewpoint of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint) */ viewpoint?: ViewpointProperties; } - export interface WebMapSourceVersion extends Object { /** * The major version of the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) */ major: number; /** * The minor version of the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) */ minor: number; @@ -46080,151 +48333,151 @@ declare namespace __esri { interface WebScene extends Map, corePromise { /** * Configuration of application and UI elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#applicationProperties) */ applicationProperties: ApplicationProperties; /** * *This property only applies to local scenes.* Represents an optional clipping area used to define the bounds or [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. Set the [clippingEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) property to `true` to apply the specified clippingArea to the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) */ clippingArea: Extent; /** * *This property only applies to local scenes.* Determines whether clipping using the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) - * + * * @default false */ clippingEnabled: boolean; /** * The height model info of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This object defines the characteristics of the vertical coordinate system used by the scene. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), the height model info is used to avoid combining layers that have incompatible vertical coordinate systems. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#heightModelInfo) */ heightModelInfo: HeightModelInfo; /** * The initial view of the WebScene. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference), [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode), and [environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) that should be applied to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the scene loads. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) */ initialViewProperties: websceneInitialViewProperties; /** * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A WebScene is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#basemap) are fully created, but not yet loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The Error object returned if an error occurred while loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadError) - * + * * @default null */ readonly loadError: Error; /** - * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) operation. - * + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) operation. + * * Value | Description * ------|------------ * not-loaded | The object's resources have not loaded. * loading | The object's resources are currently loading. * loaded | The object's resources have loaded without errors. * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadError) for more details. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadStatus) - * + * * @default not-loaded */ readonly loadStatus: string; /** * The portal item from which the WebScene is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem) */ portalItem: PortalItem; /** * Provides a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of slides that act as bookmarks for saving predefined [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) and visible layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation) */ presentation: Presentation; /** * The version of the source document from which the WebScene was read. The WebScene must be version 1.x to load into an app. - * + * * [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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) - * - * + * + * */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save) - * + * * @param options Additional options. * @param options.ignoreUnsupported When `true`, the scene will save even if it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. - * + * */ save(options?: WebSceneSaveOptions): IPromise; /** * Saves the webscene to a new portal item. If saving has completed successfully, then the saved portal item will be set in the portalItem property of the WebScene. This is a convenience method that will create a new [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) and use [PortalUser.addItem()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) to store the webscene in a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html). 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 always saves the webscene as a new portal item owned by the user performing the edits and executing the `saveAs()` method. If you want to modify the existing item without changing its ownership use [save()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save). The webscene will be automatically loaded if it is not already before saving. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) - * + * * @param portalItem The new portal item to which the scene will be saved. Portal item properties such as the title or description need to be explicitly set on the item and will not be automatically copied from the current associated scene portal item (if any). * @param options additional save options. * @param options.folder the folder in which to save the item. * @param options.ignoreUnsupported allow the scene to be saved even in the case it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. - * + * */ saveAs(portalItem: PortalItem | PortalItemProperties, options?: WebSceneSaveAsOptions): IPromise; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide and the [web scene specification](https://developers.arcgis.com/web-scene-specification/) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#toJSON) - * - * + * + * */ 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` 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 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): IPromise; } @@ -46232,20 +48485,19 @@ declare namespace __esri { interface WebSceneConstructor { /** * The web scene is the core element of 3D mapping across the ArcGIS platform. It defines the content, style, environment, and slides of your scene and it can be shared across multiple ArcGIS web and desktop applications. Web scenes can be created, published, and consumed in [ArcGIS Pro](http://pro.arcgis.com/en/pro-app/help/mapping/map-authoring/author-a-web-scene.htm) and ArcGIS Online with the [Scene Viewer](http://server.arcgis.com/en/portal/latest/use/make-your-first-scene.htm). The web scene is saved as a JSON document that can be consumed by the ArcGIS API for JavaScript via the WebScene class to easily create compelling 3D applications. The JSON document is written according to the [web scene specification](https://developers.arcgis.com/web-scene-specification/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) */ - new(properties?: WebSceneProperties): WebScene; - + new (properties?: WebSceneProperties): WebScene; /** * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. If the [WebScene]() is used outside of a view, you must call [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) explicitly to interact with its resources. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [web scene specification](https://developers.arcgis.com/web-scene-specification/) for more detailed information on serializing web scenes to JSON. - * + * */ fromJSON(json: any): any; } @@ -46255,51 +48507,51 @@ declare namespace __esri { interface WebSceneProperties extends MapProperties { /** * Configuration of application and UI elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#applicationProperties) */ applicationProperties?: ApplicationPropertiesProperties; /** * *This property only applies to local scenes.* Represents an optional clipping area used to define the bounds or [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. Set the [clippingEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) property to `true` to apply the specified clippingArea to the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) */ clippingArea?: ExtentProperties; /** * *This property only applies to local scenes.* Determines whether clipping using the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) - * + * * @default false */ clippingEnabled?: boolean; /** * The height model info of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This object defines the characteristics of the vertical coordinate system used by the scene. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), the height model info is used to avoid combining layers that have incompatible vertical coordinate systems. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#heightModelInfo) */ heightModelInfo?: HeightModelInfoProperties; /** * The initial view of the WebScene. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference), [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode), and [environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) that should be applied to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the scene loads. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) */ initialViewProperties?: websceneInitialViewPropertiesProperties; /** * The portal item from which the WebScene is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem) */ portalItem?: PortalItemProperties; /** * Provides a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of slides that act as bookmarks for saving predefined [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) and visible layers. - * + * * [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; @@ -46308,25 +48560,23 @@ declare namespace __esri { interface ApplicationProperties extends Accessor { /** * View-specific properties of application and UI elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-ApplicationProperties.html#viewing) */ viewing: Viewing; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-ApplicationProperties.html#clone) - * - * + * + * */ clone(): ApplicationProperties; } interface ApplicationPropertiesConstructor { - - - new(properties?: ApplicationPropertiesProperties): ApplicationProperties; + new (properties?: ApplicationPropertiesProperties): ApplicationProperties; } export const ApplicationProperties: ApplicationPropertiesConstructor; @@ -46334,7 +48584,7 @@ declare namespace __esri { interface ApplicationPropertiesProperties { /** * View-specific properties of application and UI elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-ApplicationProperties.html#viewing) */ viewing?: ViewingProperties; @@ -46343,37 +48593,35 @@ declare namespace __esri { interface Search extends Accessor { /** * Whether search functionality is enabled in the web scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#enabled) */ enabled: boolean; /** * The hint provided with the search dialog. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#hintText) */ hintText: string; /** * A collection of layers to be included in search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#layers) */ layers: Collection; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#clone) - * - * + * + * */ clone(): Search; } interface SearchConstructor { - - - new(properties?: SearchProperties): Search; + new (properties?: SearchProperties): Search; } export const Search: SearchConstructor; @@ -46381,19 +48629,19 @@ declare namespace __esri { interface SearchProperties { /** * Whether search functionality is enabled in the web scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#enabled) */ enabled?: boolean; /** * The hint provided with the search dialog. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#hintText) */ hintText?: string; /** * A collection of layers to be included in search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#layers) */ layers?: CollectionProperties; @@ -46402,37 +48650,35 @@ declare namespace __esri { interface SearchLayer extends Accessor { /** * The field to use for search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#field) */ field: SearchLayerField; /** * The id of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#id) */ id: string; /** * The sub layer index. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#subLayer) */ subLayer: number; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#clone) - * - * + * + * */ clone(): SearchLayer; } interface SearchLayerConstructor { - - - new(properties?: SearchLayerProperties): SearchLayer; + new (properties?: SearchLayerProperties): SearchLayer; } export const SearchLayer: SearchLayerConstructor; @@ -46440,19 +48686,19 @@ declare namespace __esri { interface SearchLayerProperties { /** * The field to use for search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#field) */ field?: SearchLayerFieldProperties; /** * The id of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#id) */ id?: string; /** * The sub layer index. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#subLayer) */ subLayer?: number; @@ -46461,37 +48707,35 @@ declare namespace __esri { interface SearchLayerField extends Accessor { /** * Whether or not the field is an exact match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#exactMatch) */ exactMatch: boolean; /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#name) */ name: string; /** * 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-webscene-applicationProperties-SearchLayerField.html#type) */ type: string; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#clone) - * - * + * + * */ clone(): SearchLayerField; } interface SearchLayerFieldConstructor { - - - new(properties?: SearchLayerFieldProperties): SearchLayerField; + new (properties?: SearchLayerFieldProperties): SearchLayerField; } export const SearchLayerField: SearchLayerFieldConstructor; @@ -46499,19 +48743,19 @@ declare namespace __esri { interface SearchLayerFieldProperties { /** * Whether or not the field is an exact match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#exactMatch) */ exactMatch?: boolean; /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#name) */ name?: string; /** * 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-webscene-applicationProperties-SearchLayerField.html#type) */ type?: string; @@ -46520,25 +48764,23 @@ declare namespace __esri { interface Viewing extends Accessor { /** * An object specifying the search parameters set within the web scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Viewing.html#search) */ search: Search; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Viewing.html#clone) - * - * + * + * */ clone(): Viewing; } interface ViewingConstructor { - - - new(properties?: ViewingProperties): Viewing; + new (properties?: ViewingProperties): Viewing; } export const Viewing: ViewingConstructor; @@ -46546,7 +48788,7 @@ declare namespace __esri { interface ViewingProperties { /** * An object specifying the search parameters set within the web scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Viewing.html#search) */ search?: SearchProperties; @@ -46555,10 +48797,10 @@ declare namespace __esri { interface Background extends Accessor, JSONSupport { /** * Creates a deep clone of the Background. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html#clone) - * - * + * + * */ clone(): Background; } @@ -46566,37 +48808,35 @@ declare namespace __esri { interface BackgroundConstructor { /** * The background of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) that lies behind the sky, atmosphere and stars. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html) */ - new(properties?: BackgroundProperties): Background; + new (properties?: BackgroundProperties): Background; fromJSON(json: any): Background; } export const Background: BackgroundConstructor; - interface BackgroundProperties { - - } + interface BackgroundProperties {} interface ColorBackground extends Background, JSONSupport { /** * The color of the background. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#color) - * + * * @default black */ color: Color; /** * Creates a deep clone of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#clone) - * - * + * + * */ clone(): ColorBackground; } @@ -46604,11 +48844,11 @@ declare namespace __esri { interface ColorBackgroundConstructor { /** * This type of [Background](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html) allows to set a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) as the background of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The view environment stars and atmosphere will show on top of the background when enabled. To have a clear background color only, make sure to set both the [view.environment.starsEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) and [view.environment.atmosphereEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) properties to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) */ - new(properties?: ColorBackgroundProperties): ColorBackground; + new (properties?: ColorBackgroundProperties): ColorBackground; fromJSON(json: any): ColorBackground; } @@ -46618,9 +48858,9 @@ declare namespace __esri { interface ColorBackgroundProperties extends BackgroundProperties { /** * The color of the background. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#color) - * + * * @default black */ color?: Color | number[] | string; @@ -46629,49 +48869,47 @@ declare namespace __esri { interface Environment extends Accessor { /** * Specifies whether the atmosphere should be displayed. Typically this consists of haze and sky. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#atmosphereEnabled) - * + * * @default true */ atmosphereEnabled: boolean; /** * 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) - * + * * @default null */ background: Background; /** * Settings for defining the lighting of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#lighting) */ lighting: Lighting; /** * Specifies whether stars should be displayed in the sky. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#starsEnabled) - * + * * @default true */ starsEnabled: boolean; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#clone) - * - * + * + * */ clone(): Environment; } interface EnvironmentConstructor { - - - new(properties?: EnvironmentProperties): Environment; + new (properties?: EnvironmentProperties): Environment; } export const Environment: EnvironmentConstructor; @@ -46679,31 +48917,31 @@ declare namespace __esri { interface EnvironmentProperties { /** * Specifies whether the atmosphere should be displayed. Typically this consists of haze and sky. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#atmosphereEnabled) - * + * * @default true */ atmosphereEnabled?: boolean; /** * 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) - * + * * @default null */ background?: BackgroundProperties; /** * Settings for defining the lighting of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#lighting) */ lighting?: LightingProperties; /** * Specifies whether stars should be displayed in the sky. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#starsEnabled) - * + * * @default true */ starsEnabled?: boolean; @@ -46712,45 +48950,43 @@ declare namespace __esri { interface websceneInitialViewProperties extends Accessor, corePromise { /** * The initial environment settings of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) */ environment: Environment; /** * The spatial reference of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.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. 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference) */ spatialReference: SpatialReference; /** * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Possible Values:** global | local - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode) - * + * * @default global */ viewingMode: string; /** * The initial viewpoint of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint) */ viewpoint: Viewpoint; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#clone) - * - * + * + * */ clone(): websceneInitialViewProperties; } interface websceneInitialViewPropertiesConstructor { - - - new(properties?: websceneInitialViewPropertiesProperties): websceneInitialViewProperties; + new (properties?: websceneInitialViewPropertiesProperties): websceneInitialViewProperties; } export const websceneInitialViewProperties: websceneInitialViewPropertiesConstructor; @@ -46758,27 +48994,27 @@ declare namespace __esri { interface websceneInitialViewPropertiesProperties { /** * The initial environment settings of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) */ environment?: EnvironmentProperties; /** * The spatial reference of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.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. 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Possible Values:** global | local - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode) - * + * * @default global */ viewingMode?: string; /** * The initial viewpoint of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint) */ viewpoint?: ViewpointProperties; @@ -46787,43 +49023,41 @@ declare namespace __esri { interface Lighting extends Accessor, corePromise { /** * The time and date for which the sun position and light direction is computed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#date) - * + * * @default null */ date: Date; /** * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#directShadowsEnabled) - * + * * @default false */ directShadowsEnabled: boolean; /** * The UTC time zone offset in hours that should be displayed in the UI to represent the date. This value does not have an impact on the actual lighting of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#displayUTCOffset) - * + * * @default null */ displayUTCOffset: number; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#clone) - * - * + * + * */ clone(): Lighting; } interface LightingConstructor { - - - new(properties?: LightingProperties): Lighting; + new (properties?: LightingProperties): Lighting; } export const Lighting: LightingConstructor; @@ -46831,25 +49065,25 @@ declare namespace __esri { interface LightingProperties { /** * The time and date for which the sun position and light direction is computed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#date) - * + * * @default null */ date?: DateProperties; /** * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#directShadowsEnabled) - * + * * @default false */ directShadowsEnabled?: boolean; /** * The UTC time zone offset in hours that should be displayed in the UI to represent the date. This value does not have an impact on the actual lighting of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#displayUTCOffset) - * + * * @default null */ displayUTCOffset?: number; @@ -46858,25 +49092,23 @@ declare namespace __esri { interface Presentation extends Accessor { /** * A collection of [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) that bookmark [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), visible layers, and other settings previously defined in a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) */ slides: Collection; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#clone) - * - * + * + * */ clone(): Presentation; } interface PresentationConstructor { - - - new(properties?: PresentationProperties): Presentation; + new (properties?: PresentationProperties): Presentation; } export const Presentation: PresentationConstructor; @@ -46884,7 +49116,7 @@ declare namespace __esri { interface PresentationProperties { /** * A collection of [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) that bookmark [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), visible layers, and other settings previously defined in a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) */ slides?: CollectionProperties; @@ -46892,8 +49124,8 @@ declare namespace __esri { interface Slide extends Accessor { /** - * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. - * + * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * * Value | Description * ------|------------ * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) @@ -46906,70 +49138,70 @@ declare namespace __esri { * 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) */ basemap: Basemap; /** * The description of the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) */ description: SlideDescription; /** * Represents settings that affect the environment in which the WebScene is displayed (such as lighting). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#environment) */ environment: Environment; /** * Ground properties for this slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) */ ground: SlideGround; /** * The unique id of a slide within the [slides property](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) of a [Presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#id) */ id: string; /** * A data URI encoded thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) */ thumbnail: SlideThumbnail; /** * The title of the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) */ title: SlideTitle; /** * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) */ viewpoint: Viewpoint; /** - * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: + * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer instances](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html): `[layerInstance, layerInstance]` * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer IDs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id): `["layer-1", "layer-2"]` - * - * + * + * * The specification for each object in the collection is outlined in the table below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) */ visibleLayers: Collection; /** * Applies a slide's settings to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) - * + * * @param view The SceneView the slide should be applied to. * @param options Animation options. See properties below for object specifications. * @param options.animate Indicates whether to animate the slide transition. @@ -46977,26 +49209,26 @@ declare namespace __esri { * @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. - * + * */ applyTo(view: SceneView, options?: SlideApplyToOptions): IPromise; /** * Creates a deep clone of this object. Note that the basemap instance is cloned, but the layers within the basemap are copied. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#clone) - * - * + * + * */ clone(): Slide; /** * Updates a slide from a [WebScene's slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides). Updating the slide is asynchronous and a snapshot of the view is only complete once the returned promise has resolved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @param view The SceneView from which the slide should update. * @param options Update options. See properties below for object specifications. * @param options.screenshot Screenshot options to use. See properties below for object specifications. - * + * */ updateFrom(view: SceneView, options?: SlideUpdateFromOptions): IPromise; } @@ -47004,22 +49236,21 @@ declare namespace __esri { interface SlideConstructor { /** * A slide stores a snapshot of several pre-set properties of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) and [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), such as the [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap), [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) and [visible layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers). The [visible layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) may contain references (by [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id)) to both operational layers from the [scene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) as well as elevation layers from the [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers), which affect the surface elevation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) */ - new(properties?: SlideProperties): Slide; - + new (properties?: SlideProperties): Slide; /** * Creates a slide from a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), which may be added to the [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) in the WebScene's [presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation). Updating the slide is asynchronous and a snapshot of the view is only complete once the returned promise has resolved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @param view The SceneView from which the slide should be created. * @param options Creation options. See properties below for object specifications. * @param options.screenshot Screenshot options to use. See properties below for object specifications. - * + * */ createFrom(view: SceneView, options?: SlideCreateFromOptions): IPromise; } @@ -47028,8 +49259,8 @@ declare namespace __esri { interface SlideProperties { /** - * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. - * + * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * * Value | Description * ------|------------ * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) @@ -47042,157 +49273,153 @@ declare namespace __esri { * 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) */ basemap?: BasemapProperties | string; /** * The description of the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) */ description?: SlideDescriptionProperties | string; /** * Represents settings that affect the environment in which the WebScene is displayed (such as lighting). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#environment) */ environment?: EnvironmentProperties; /** * Ground properties for this slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) */ ground?: SlideGroundProperties; /** * The unique id of a slide within the [slides property](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) of a [Presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#id) */ id?: string; /** * A data URI encoded thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) */ thumbnail?: SlideThumbnailProperties | string; /** * The title of the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) */ title?: SlideTitleProperties | string; /** * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) */ viewpoint?: ViewpointProperties; /** - * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: + * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer instances](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html): `[layerInstance, layerInstance]` * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer IDs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id): `["layer-1", "layer-2"]` - * - * + * + * * The specification for each object in the collection is outlined in the table below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) */ visibleLayers?: CollectionProperties; } - export interface SlideApplyToOptions extends Object { /** * Indicates whether to animate the slide transition. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) - * + * * @default true */ animate?: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) - * + * * @default 1 */ speedFactor?: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) */ duration?: number; /** * The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) - * + * * @default 8000 */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) */ easing?: string | EasingFunction; } - export interface SlideCreateFromOptions extends Object { /** * Screenshot options to use. See properties below for object specifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) */ screenshot?: SlideCreateFromOptionsScreenshot; } - export interface SlideCreateFromOptionsScreenshot extends Object { /** * The image format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @default jpeg */ format?: string; /** * The image quality (due to compression). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @default 80 */ quality?: number; /** * The image width. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @default 120 */ width?: number; /** * The image height. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @default 75 */ height?: number; } - export interface SlideDescriptionProperties extends Object { /** * The description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) */ text?: string; @@ -47201,17 +49428,16 @@ declare namespace __esri { export interface SlideDescription extends AnonymousAccessor { /** * The description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) */ text?: string; } - export interface SlideGroundProperties extends Object { /** * Ground opacity - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) */ opacity?: number; @@ -47220,17 +49446,16 @@ declare namespace __esri { export interface SlideGround extends AnonymousAccessor { /** * Ground opacity - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) */ opacity?: number; } - export interface SlideThumbnailProperties extends Object { /** * The URI pointing to the thumbnail image representing the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) */ url?: string; @@ -47239,17 +49464,16 @@ declare namespace __esri { export interface SlideThumbnail extends AnonymousAccessor { /** * The URI pointing to the thumbnail image representing the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) */ url?: string; } - export interface SlideTitleProperties extends Object { /** * The title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) */ text?: string; @@ -47258,197 +49482,451 @@ declare namespace __esri { export interface SlideTitle extends AnonymousAccessor { /** * The title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) */ text?: string; } - export interface SlideUpdateFromOptions extends Object { /** * Screenshot options to use. See properties below for object specifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) */ screenshot: SlideUpdateFromOptionsScreenshot; } - export interface SlideUpdateFromOptionsScreenshot extends Object { /** * The image format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @default jpeg */ format?: string; /** * The image quality (due to compression). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @default 80 */ quality?: number; /** * The image width. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @default 120 */ width?: number; /** * The image height. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @default 75 */ height?: number; } - export interface SlideVisibleLayersProperties extends Object { /** * The ID of a [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) in the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) or [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that is made `visible` in the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the slide is applied to the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) */ id?: string; + /** + * The service ids of the visible sublayers on the layer specified by the layer id. If this is not present, the visibilities of the sublayers are not changed when applying the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) + */ + sublayerIds?: number[]; } export interface SlideVisibleLayers extends AnonymousAccessor { /** * The ID of a [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) in the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) or [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that is made `visible` in the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the slide is applied to the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) */ id: string; + /** + * The service ids of the visible sublayers on the layer specified by the layer id. If this is not present, the visibilities of the sublayers are not changed when applying the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) + */ + sublayerIds: number[]; } - export interface WebSceneSaveAsOptions extends Object { /** * the folder in which to save the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) */ folder?: PortalFolder; /** * allow the scene to be saved even in the case it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) */ ignoreUnsupported?: boolean; } - export interface WebSceneSaveOptions extends Object { /** * When `true`, the scene will save even if it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save) */ ignoreUnsupported?: boolean; } - export interface WebSceneSourceVersion extends Object { /** * The major version of the WebScene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) */ major: number; /** * The minor version of the WebScene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) */ minor: number; } - export interface WebSceneUpdateFromOptions extends Object { /** * 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; /** * 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 AreaMeasurement2D extends Widget { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#iconClass) + */ + readonly iconClass: string; + /** + * The widget's default label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#label) + */ + readonly label: string; + /** + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#unit) + */ + unit: + | "metric" + | "imperial" + | "square-inches" + | "square-feet" + | "square-us-feet" + | "square-yards" + | "square-miles" + | "square-meters" + | "square-kilometers" + | "acres" + | "ares" + | "hectares"; + /** + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#unitOptions) + */ + unitOptions: string[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#view) + */ + view: MapView; + /** + * 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 [AreaMeasurement2DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#viewModel) + */ + viewModel: AreaMeasurement2DViewModel; + + /** + * *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-AreaMeasurement2D.html#render) + * + * + */ + render(): any; + } + + interface AreaMeasurement2DConstructor { + /** + * The AreaMeasurement2D widget calculates and displays the area and perimeter of a polygon in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). When the perimeter is less than 100 km, the default [mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#mode) is `planar`. When the perimeter is greater than or equal to 100 km, the default [mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#mode) is `geodesic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html) + */ + + new (properties?: AreaMeasurement2DProperties): AreaMeasurement2D; + } + + export const AreaMeasurement2D: AreaMeasurement2DConstructor; + + interface AreaMeasurement2DProperties extends WidgetProperties { + /** + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#unit) + */ + unit?: + | "metric" + | "imperial" + | "square-inches" + | "square-feet" + | "square-us-feet" + | "square-yards" + | "square-miles" + | "square-meters" + | "square-kilometers" + | "acres" + | "ares" + | "hectares"; + /** + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#unitOptions) + */ + unitOptions?: string[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#view) + */ + view?: MapViewProperties; + /** + * 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 [AreaMeasurement2DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#viewModel) + */ + viewModel?: AreaMeasurement2DViewModel; + } + + interface AreaMeasurement2DViewModel { + /** + * The threshold distance used by the "auto" mode to switch between planar and geodesic linear computations. The threshold is measured in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#geodesicDistanceThreshold) + * + * @default 100000 + */ + geodesicDistanceThreshold: number; + /** + * The area and perimeter of the measurement polygon in square meters and meters respectively. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) + */ + readonly measurement: AreaMeasurement2DViewModelMeasurement; + /** + * This property returns the locale specific representation of the area and perimeter. Areas and perimeters are rounded to two decimal places. Areas are sourced from the [measurement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) property (in square meters) and converted to the user defined units/system and mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurementLabel) + */ + readonly measurementLabel: AreaMeasurement2DViewModelMeasurementLabel; + /** + * The mode used to calculate the area and perimeter of a polygon. **Possible Values:** auto | planar | geodesic + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#mode) + * + * @default auto + */ + mode: "auto" | "planar" | "geodesic"; + /** + * An array of valid mode values. By default, the following units are included: `auto`, `planar`, `geodesic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#modes) + */ + readonly modes: string[]; + /** + * The ViewModel's state. **Possible Values:** disabled | ready | measuring + * + * Value | Description + * ------------|------------- + * disabled | not ready yet + * ready | ready for measuring + * measuring | measuring has started + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#unit) + */ + unit: + | "metric" + | "imperial" + | "square-inches" + | "square-feet" + | "square-us-feet" + | "square-yards" + | "square-miles" + | "square-meters" + | "square-kilometers" + | "acres" + | "ares" + | "hectares"; + /** + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#unitOptions) + */ + unitOptions: string[]; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#view) + */ + view: MapView; + + /** + * Clears the current measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#clearMeasurement) + * + * + */ + clearMeasurement(): void; + /** + * Starts a new measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#newMeasurement) + * + * + */ + newMeasurement(): void; + } + + interface AreaMeasurement2DViewModelConstructor { + new (properties?: any): AreaMeasurement2DViewModel; + } + + export const AreaMeasurement2DViewModel: AreaMeasurement2DViewModelConstructor; + + export interface AreaMeasurement2DViewModelMeasurement extends Object { + /** + * The area (m²). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) + */ + area: number; + /** + * The perimeter (m). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) + */ + perimeter: number; + /** + * Measurement area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) + */ + geometry: any; + } + + export interface AreaMeasurement2DViewModelMeasurementLabel extends Object { + /** + * The area (m²). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurementLabel) + */ + area: number; + /** + * The perimeter (m). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurementLabel) + */ + perimeter: number; + } + interface AreaMeasurement3D extends Widget { /** - * 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 - * + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#unit) */ unit: string; /** - * List of unit options in the widget drop down list. - * + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.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[]; /** * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#view) */ view: SceneView; /** * 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 [AreaMeasurement3DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#viewModel) */ viewModel: AreaMeasurement3DViewModel; /** * *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-AreaMeasurement3D.html#render) - * - * + * + * */ render(): any; } @@ -47456,39 +49934,37 @@ declare namespace __esri { interface AreaMeasurement3DConstructor { /** * The AreaMeasurement3D widget calculates and displays the area and perimeter of a polygon. This widget can be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) to measure the area and perimeter of a polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html) */ - new(properties?: AreaMeasurement3DProperties): AreaMeasurement3D; + new (properties?: AreaMeasurement3DProperties): AreaMeasurement3D; } export const AreaMeasurement3D: AreaMeasurement3DConstructor; interface AreaMeasurement3DProperties extends WidgetProperties { /** - * 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 - * + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#unit) */ unit?: string; /** - * List of unit options in the widget drop down list. - * + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.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[]; /** * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#view) */ view?: SceneViewProperties; /** * 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 [AreaMeasurement3DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#viewModel) */ viewModel?: AreaMeasurement3DViewModelProperties; @@ -47497,104 +49973,105 @@ declare namespace __esri { interface AreaMeasurement3DViewModel extends Accessor { /** * The current measurement of the area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ readonly measurement: AreaMeasurement3DViewModelMeasurement; /** - * The view model's state. - * + * The view model's state. + * * Value | Description * ------------|------------- * disabled | not ready yet * ready | ready for measuring * measuring | currently measuring - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** - * 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 - * + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | 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. - * + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * * [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: SceneView; /** * Clears the current measurement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#clearMeasurement) - * - * + * + * */ clearMeasurement(): void; + /** + * Starts a new measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#newMeasurement) + * + * + */ + newMeasurement(): void; } interface AreaMeasurement3DViewModelConstructor { - - - new(properties?: AreaMeasurement3DViewModelProperties): 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 - * + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | 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. - * + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * * [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 { /** * Describes the mode in which the measurement was taken. In `euclidean` mode, the area and perimeter length are computed from a flat polygon with straight segments on the perimeter in the [ECEF](https://en.wikipedia.org/wiki/ECEF) coordinate system. In `geodesic` mode, the area and perimeter length are computed from a geodesic polygon on the WGS84 ellipsoid. **Possible Values:** euclidean | geodesic - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ measurementMode: string; /** * The area of the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ area: MeasurementValue; /** * The perimeter length of the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ perimeterLength: MeasurementValue; @@ -47602,26 +50079,26 @@ declare namespace __esri { /** * Measurement value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#MeasurementValue) */ export interface MeasurementValue extends Object { /** * Textual representation of the measured value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#MeasurementValue) */ text: string; /** - * State of the measured value. - * + * State of the measured value. + * * Value | Description * ------------|------------- * available | measured value is available * unavailable | measured value is not available due an incomplete measurement * invalid | measured value is not available due to an invalid measurement configuration (e.g. self-intersecting polygon) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#MeasurementValue) */ state: string; @@ -47630,49 +50107,49 @@ declare namespace __esri { interface Attribution extends Widget { /** * Full attribution text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#attributionText) */ readonly attributionText: string; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#iconClass) */ readonly iconClass: string; /** * Text used to split attribution by [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#itemDelimiter) - * + * * @default | */ itemDelimiter: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#label) */ readonly label: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#view) */ view: MapView | SceneView; /** * 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 [AttributionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#viewModel) */ viewModel: AttributionViewModel; /** * *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-Attribution.html#render) - * - * + * + * */ render(): any; } @@ -47680,11 +50157,11 @@ declare namespace __esri { interface AttributionConstructor { /** * The Attribution displays attribution text for the layers in a map. The text displayed for the layers is either a list of data providers or sources as defined in the layer's custom attribution data, or the copyright text. This widget automatically updates based on layer visibility and map extent and displays a single line of attribution that can be expanded with a single click to view all data sources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) */ - new(properties?: AttributionProperties): Attribution; + new (properties?: AttributionProperties): Attribution; } export const Attribution: AttributionConstructor; @@ -47692,21 +50169,21 @@ declare namespace __esri { interface AttributionProperties extends WidgetProperties { /** * Text used to split attribution by [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#itemDelimiter) - * + * * @default | */ itemDelimiter?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [AttributionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#viewModel) */ viewModel?: AttributionViewModelProperties; @@ -47715,21 +50192,21 @@ declare namespace __esri { interface AttributionViewModel extends Accessor { /** * A collection of [AttributionItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#items) */ readonly items: Collection; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * 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: MapView | SceneView; @@ -47738,11 +50215,11 @@ declare namespace __esri { interface AttributionViewModelConstructor { /** * Provides the logic for the [Attribution](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) widget. Displays attribution text for the layers in a map. The text displayed for the layers is either a list of data providers or sources as defined in the layer's custom attribution data, or the copyright text. The attribution is automatically updated based on layer visibility and map extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) */ - new(properties?: AttributionViewModelProperties): AttributionViewModel; + new (properties?: AttributionViewModelProperties): AttributionViewModel; } export const AttributionViewModel: AttributionViewModelConstructor; @@ -47750,7 +50227,7 @@ declare namespace __esri { 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; @@ -47758,19 +50235,19 @@ declare namespace __esri { /** * The following properties define an attribution item that contains the attribution text for a layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) */ export interface AttributionItem extends Object { /** * The attribution text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) */ text: string; /** * The layer that has the attribution text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) */ layer: Layer; @@ -47779,47 +50256,47 @@ declare namespace __esri { interface BasemapGallery extends Widget { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#activeBasemap) */ activeBasemap: Basemap; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#iconClass) */ iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#label) */ readonly label: string; /** * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance, or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#source) */ source: LocalBasemapsSource | PortalBasemapsSource; /** * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#view) */ view: MapView | SceneView; /** * 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 [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#viewModel) */ viewModel: BasemapGalleryViewModel; /** * *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-BasemapGallery.html#render) - * - * + * + * */ render(): any; } @@ -47827,11 +50304,11 @@ declare namespace __esri { interface BasemapGalleryConstructor { /** * The BasemapGallery widget displays a collection images representing basemaps from ArcGIS.com or a user-defined set of map or image services. When a new basemap is selected from the BasemapGallery, the map's basemap layers are removed and replaced with the basemap layers of the associated basemap selected in the gallery. By default, the BasemapGallery widget looks like the following image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) */ - new(properties?: BasemapGalleryProperties): BasemapGallery; + new (properties?: BasemapGalleryProperties): BasemapGallery; } export const BasemapGallery: BasemapGalleryConstructor; @@ -47839,31 +50316,31 @@ declare namespace __esri { interface BasemapGalleryProperties extends WidgetProperties { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#activeBasemap) */ activeBasemap?: BasemapProperties; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#iconClass) */ iconClass?: string; /** * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance, or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#source) */ source?: LocalBasemapsSourceProperties | PortalBasemapsSourceProperties; /** * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#viewModel) */ viewModel?: BasemapGalleryViewModelProperties; @@ -47872,53 +50349,51 @@ declare namespace __esri { interface BasemapGalleryViewModel extends Accessor { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#activeBasemap) */ activeBasemap: Basemap; /** * A collection of [BasemapGalleryItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html)s representing basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#items) */ items: Collection; /** * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#source) */ source: LocalBasemapsSource | PortalBasemapsSource; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#view) */ view: MapView | SceneView; /** * A convenience function to check basemap equality. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#basemapEquals) - * + * * @param basemap1 The basemap to compare against `basemap2`. * @param basemap2 The basemap to compare against `basemap1`. - * + * */ basemapEquals(basemap1: Basemap, basemap2: Basemap): boolean; } interface BasemapGalleryViewModelConstructor { - - - new(properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; + new (properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; } export const BasemapGalleryViewModel: BasemapGalleryViewModelConstructor; @@ -47926,25 +50401,25 @@ declare namespace __esri { interface BasemapGalleryViewModelProperties { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#activeBasemap) */ activeBasemap?: BasemapProperties; /** * A collection of [BasemapGalleryItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html)s representing basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#items) */ items?: CollectionProperties; /** * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#source) */ source?: LocalBasemapsSourceProperties | PortalBasemapsSourceProperties; /** * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -47953,36 +50428,34 @@ declare namespace __esri { interface BasemapGalleryItem extends Accessor { /** * The item's associated basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#basemap) */ basemap: Basemap; /** * The Error object returned if an error occurred. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#error) */ readonly error: Error; /** * The item's state. **Possible Values:** loading | ready | error - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#state) - * + * * @default loading */ readonly state: string; /** * The view associated with this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#view) */ view: MapView | SceneView; } interface BasemapGalleryItemConstructor { - - - new(properties?: BasemapGalleryItemProperties): BasemapGalleryItem; + new (properties?: BasemapGalleryItemProperties): BasemapGalleryItem; } export const BasemapGalleryItem: BasemapGalleryItemConstructor; @@ -47990,13 +50463,13 @@ declare namespace __esri { interface BasemapGalleryItemProperties { /** * The item's associated basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#basemap) */ basemap?: BasemapProperties; /** * The view associated with this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -48005,31 +50478,29 @@ declare namespace __esri { interface LocalBasemapsSource extends Accessor { /** * A collection of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#basemaps) */ basemaps: Collection; /** * The source's state. The state is always `ready`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#state) */ readonly state: string; /** * Refreshes the source basemaps. Note: `refresh` will not affect LocalBasemapsSource. Modify basemaps directly instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#refresh) - * - * + * + * */ refresh(): void; } interface LocalBasemapsSourceConstructor { - - - new(properties?: LocalBasemapsSourceProperties): LocalBasemapsSource; + new (properties?: LocalBasemapsSourceProperties): LocalBasemapsSource; } export const LocalBasemapsSource: LocalBasemapsSourceConstructor; @@ -48037,7 +50508,7 @@ declare namespace __esri { interface LocalBasemapsSourceProperties { /** * A collection of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#basemaps) */ basemaps?: CollectionProperties; @@ -48046,34 +50517,32 @@ declare namespace __esri { interface PortalBasemapsSource extends LocalBasemapsSource { /** * Function used to filter basemaps after being fetched from the Portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#filterFunction) */ filterFunction: Function; /** * The Portal from which to fetch basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#portal) */ portal: Portal; /** * An object with key-value pairs used to create a custom basemap gallery group query. Note that all parameters will be joined using the `AND` operator. A query string can also be provided for more advanced use cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#query) */ query: any | string; /** * Callback for updating basemaps after being fetched and filtered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#updateBasemapsCallback) */ updateBasemapsCallback: Function; } interface PortalBasemapsSourceConstructor { - - - new(properties?: PortalBasemapsSourceProperties): PortalBasemapsSource; + new (properties?: PortalBasemapsSourceProperties): PortalBasemapsSource; } export const PortalBasemapsSource: PortalBasemapsSourceConstructor; @@ -48081,25 +50550,25 @@ declare namespace __esri { interface PortalBasemapsSourceProperties extends LocalBasemapsSourceProperties { /** * Function used to filter basemaps after being fetched from the Portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#filterFunction) */ filterFunction?: Function; /** * The Portal from which to fetch basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#portal) */ portal?: PortalProperties; /** * An object with key-value pairs used to create a custom basemap gallery group query. Note that all parameters will be joined using the `AND` operator. A query string can also be provided for more advanced use cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#query) */ query?: any | string; /** * Callback for updating basemaps after being fetched and filtered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#updateBasemapsCallback) */ updateBasemapsCallback?: Function; @@ -48108,53 +50577,53 @@ declare namespace __esri { interface BasemapToggle extends Widget { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#activeBasemap) */ readonly activeBasemap: Basemap; /** - * The next basemap for toggling. One of the following values may be set to this property: + * The next basemap for toggling. One of the following values may be set to this property: * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap) */ nextBasemap: Basemap; /** * Indicates if the title of the basemap is visible in the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#titleVisible) - * + * * @default false */ titleVisible: boolean; /** * 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). This view provides the BasemapToggle widget with access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) */ view: MapView | SceneView; /** * 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 [BasemapToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#viewModel) */ viewModel: BasemapToggleViewModel; /** * *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-BasemapToggle.html#render) - * - * + * + * */ render(): any; /** * Toggles to the [next basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#toggle) - * - * + * + * */ toggle(): void; } @@ -48162,41 +50631,41 @@ declare namespace __esri { interface BasemapToggleConstructor { /** * The BasemapToggle provides a widget which allows an end-user to switch between two basemaps. The toggled basemap is set inside the [view's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) */ - new(properties?: BasemapToggleProperties): BasemapToggle; + new (properties?: BasemapToggleProperties): BasemapToggle; } export const BasemapToggle: BasemapToggleConstructor; interface BasemapToggleProperties extends WidgetProperties { /** - * The next basemap for toggling. One of the following values may be set to this property: + * The next basemap for toggling. One of the following values may be set to this property: * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap) */ nextBasemap?: BasemapProperties | string; /** * Indicates if the title of the basemap is visible in the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#titleVisible) - * + * * @default false */ titleVisible?: boolean; /** * 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). This view provides the BasemapToggle widget with access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [BasemapToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#viewModel) */ viewModel?: BasemapToggleViewModelProperties; @@ -48205,56 +50674,53 @@ declare namespace __esri { interface BasemapToggleViewModel extends Accessor, Evented { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#activeBasemap) */ readonly activeBasemap: Basemap; /** - * The next basemap for toggling. One of the following values may be set to this property: + * The next basemap for toggling. One of the following values may be set to this property: * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap) */ nextBasemap: Basemap; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the widget will operate. This view provides access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#view) */ view: MapView | SceneView; /** * Toggles to the [next basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#toggle) - * - * + * + * */ toggle(): void; } interface BasemapToggleViewModelConstructor { - - - new(properties?: BasemapToggleViewModelProperties): BasemapToggleViewModel; - + new (properties?: BasemapToggleViewModelProperties): BasemapToggleViewModel; /** * Helper method to find a basemap's thumbnail URL. If the basemap does not have a thumbnail URL defined, this utility will try to find a thumbnail URL from the best matching well-known basemap. If no match is found, a thumbnail URL from the basemap's base layers will be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#getThumbnailUrl) - * + * * @param basemap The basemap used to retrieve the thumbnail URL. - * + * */ getThumbnailUrl(basemap: Basemap): string; } @@ -48263,16 +50729,16 @@ declare namespace __esri { interface BasemapToggleViewModelProperties { /** - * The next basemap for toggling. One of the following values may be set to this property: + * The next basemap for toggling. One of the following values may be set to this property: * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap) */ nextBasemap?: BasemapProperties | string; /** * The view from which the widget will operate. This view provides access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -48281,50 +50747,50 @@ declare namespace __esri { interface Bookmarks extends Widget, GoTo { /** * 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) */ readonly bookmarks: Collection; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#label) */ readonly label: string; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#view) */ view: MapView; /** * 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 [BookmarksViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#viewModel) */ viewModel: BookmarksViewModel; /** * Zoom to a specific bookmark. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#goTo) - * + * * @param Bookmark The bookmark to zoom to. - * + * */ goTo(Bookmark: Bookmark): IPromise; /** * *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-Bookmarks.html#render) - * - * + * + * */ render(): any; } @@ -48332,11 +50798,11 @@ 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](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) */ - new(properties?: BookmarksProperties): Bookmarks; + new (properties?: BookmarksProperties): Bookmarks; } export const Bookmarks: BookmarksConstructor; @@ -48344,13 +50810,13 @@ declare namespace __esri { interface BookmarksProperties extends WidgetProperties, GoToProperties { /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#view) */ view?: MapViewProperties; /** * 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 [BookmarksViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#viewModel) */ viewModel?: BookmarksViewModelProperties; @@ -48359,46 +50825,44 @@ declare namespace __esri { interface BookmarksViewModel extends Accessor, GoTo { /** * 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) */ readonly bookmarks: Collection; /** * The view model's state. **Possible Values:** loading | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#view) */ view: MapView; /** * Zoom to a specific bookmark. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#goTo) - * + * * @param Bookmark The bookmark to zoom to. - * + * */ goTo(Bookmark: Bookmark): IPromise; } interface BookmarksViewModelConstructor { - - - new(properties?: BookmarksViewModelProperties): BookmarksViewModel; + new (properties?: BookmarksViewModelProperties): BookmarksViewModel; } export const BookmarksViewModel: BookmarksViewModelConstructor; @@ -48406,7 +50870,7 @@ declare namespace __esri { interface BookmarksViewModelProperties extends GoToProperties { /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#view) */ view?: MapViewProperties; @@ -48415,114 +50879,114 @@ declare namespace __esri { interface ColorSlider extends Accessor, Widgette { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#handlesVisible) - * + * * @default true */ handlesVisible: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) */ histogram: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramVisible) - * + * * @default true */ histogramVisible: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be less than the value of the maximum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) */ maxValue: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be greater than the value of the minimum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) */ minValue: number; /** * Indicates the number of handles to show on the slider. Acceptable values are `2` or `3`. If `3` handles are specified, then the [syncedHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) property may be enabled to sync the movement of the outside handles with the middle, or primary, handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) - * + * * @default {"value":2,"set":""} */ numHandles: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ statistics: ColorSliderStatistics; /** * Indicates whether to show the average in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible: boolean; /** * Only applicable when [numHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) is set to `3`. This property indicates whether the outside handles are synced with the middle, or primary, handle. If the primary handle is dragged then the outside handles are dragged while maintaining the same distance from the primary handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) - * + * * @default false */ syncedHandles: boolean; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#ticksVisible) - * + * * @default true */ ticksVisible: boolean; /** * Each object in this array represents a stop in the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) associated with the slider. The properties of each object describe whether the stop has a slider handle, the value of the handle and its associated color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) */ readonly values: ColorSliderValues[]; /** * The color visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the [colorRendererCreator](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) helper methods. A new color visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; } interface ColorSliderConstructor { /** * The ColorSlider is a widget intended for authoring and exploring data-driven visualizations 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) using color. To display properly, this slider requires a [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) and a [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) object. Other optional properties may be used, including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html) */ - new(properties?: ColorSliderProperties): ColorSlider; + new (properties?: ColorSliderProperties): ColorSlider; } export const ColorSlider: ColorSliderConstructor; @@ -48530,145 +50994,143 @@ declare namespace __esri { interface ColorSliderProperties extends WidgetteProperties { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#handlesVisible) - * + * * @default true */ handlesVisible?: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) */ histogram?: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramVisible) - * + * * @default true */ histogramVisible?: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth?: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be less than the value of the maximum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) */ maxValue?: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be greater than the value of the minimum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) */ minValue?: number; /** * Indicates the number of handles to show on the slider. Acceptable values are `2` or `3`. If `3` handles are specified, then the [syncedHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) property may be enabled to sync the movement of the outside handles with the middle, or primary, handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) - * + * * @default {"value":2,"set":""} */ numHandles?: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ statistics?: ColorSliderStatistics; /** * Indicates whether to show the average in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible?: boolean; /** * Only applicable when [numHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) is set to `3`. This property indicates whether the outside handles are synced with the middle, or primary, handle. If the primary handle is dragged then the outside handles are dragged while maintaining the same distance from the primary handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) - * + * * @default false */ syncedHandles?: boolean; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#ticksVisible) - * + * * @default true */ ticksVisible?: boolean; /** * The color visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the [colorRendererCreator](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) helper methods. A new color visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) */ - visualVariable?: ColorVisualVariable; + visualVariable?: ColorVariableProperties; } - export interface ColorSliderStatistics extends Object { /** * The average of all data values represented in the color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ avg: number; /** * The maximum of all data values represented in the color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ max: number; /** * The minimum of all data values represented in the color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ min: number; /** * The standard deviation calculated from all data values represented in the color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ stddev: number; } - export interface ColorSliderValues extends Object { /** * The color used to represent features with values at the associated stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) */ color: Color; /** * The value of the stop for the associated handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) */ value: number; /** * The label used to display the value to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) */ label: string; @@ -48677,43 +51139,43 @@ declare namespace __esri { interface Compass extends Widget, GoTo { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#label) */ readonly label: string; /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#view) */ view: MapView | SceneView; /** * 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 [CompassViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#viewModel) */ viewModel: CompassViewModel; /** * *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-Compass.html#render) - * - * + * + * */ render(): any; /** * If working in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), sets the view's [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) to `0`. If working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), sets the camera's [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to `0`. This method is executed each time the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#reset) - * - * + * + * */ reset(): void; } @@ -48721,11 +51183,11 @@ declare namespace __esri { interface CompassConstructor { /** * The Compass widget indicates where north is in relation to the current view [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) or [camera heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading). Clicking the Compass widget rotates the view to face north (heading = 0). This widget is added to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) */ - new(properties?: CompassProperties): Compass; + new (properties?: CompassProperties): Compass; } export const Compass: CompassConstructor; @@ -48733,13 +51195,13 @@ declare namespace __esri { interface CompassProperties extends WidgetProperties, GoToProperties { /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [CompassViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#viewModel) */ viewModel?: CompassViewModelProperties; @@ -48748,33 +51210,33 @@ declare namespace __esri { interface CompassViewModel extends Accessor, GoTo { /** * The orientation axes (x, y, z). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#orientation) - * + * * @default { x: 0, y: 0, z: 0 } */ orientation: any; /** * The view model's state. **Possible Values:** compass | rotation | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#view) */ view: MapView | SceneView; /** * If working in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), sets the view's [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) is to `0`. If working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), sets the camera's [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to `0`. This method is executed each time the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#reset) - * - * + * + * */ reset(): void; } @@ -48782,11 +51244,11 @@ declare namespace __esri { interface CompassViewModelConstructor { /** * Provides the logic for the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) */ - new(properties?: CompassViewModelProperties): CompassViewModel; + new (properties?: CompassViewModelProperties): CompassViewModel; } export const CompassViewModel: CompassViewModelConstructor; @@ -48794,15 +51256,15 @@ declare namespace __esri { interface CompassViewModelProperties extends GoToProperties { /** * The orientation axes (x, y, z). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#orientation) - * + * * @default { x: 0, y: 0, z: 0 } */ orientation?: any; /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -48811,85 +51273,85 @@ declare namespace __esri { interface CoordinateConversion extends Widget, GoTo { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#conversions) */ conversions: Collection; /** * Describes the location of the coordinates currently displayed by the widget as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#conversions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#currentLocation) */ currentLocation: Point; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) that the widget is capable of displaying. The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#formats) */ formats: Collection; /** - * Describes the current mode of the widget. **Possible Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#mode) - * + * * @default live */ mode: string; /** * If this property is set to `true`, multiple conversions can be displayed. For a simpler experience with only one conversion at a time, this property can be set to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#multipleConversions) - * + * * @default true */ multipleConversions: boolean; /** * Determines whether the widget should expand up or down. If set to `auto` the widget will be oriented based on its position in the view. **Possible Values:** auto | expand-up | expand-down - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#orientation) - * + * * @default auto */ orientation: string; /** * The number of milliseconds of delay before conversion requests will be sent to the [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html). This only affects conversions that cannot be performed in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#requestDelay) - * + * * @default 300 */ requestDelay: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#view) */ view: MapView | SceneView; /** * The view model for this widget. The view model contains the logic that controls the Coordinate Widget's behavior. See the [CoordinateConversionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#viewModel) */ viewModel: CoordinateConversionViewModel; /** * *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-CoordinateConversion.html#render) - * - * + * + * */ render(): any; /** * Attempt to convert a string into a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The format of the string must be specified. A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of available formats can be obtained from the [formats](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#formats) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#reverseConvert) - * + * * @param coordinate The coordinate string. * @param format Specifies the format of the input coordinate. - * + * */ reverseConvert(coordinate: string, format: Format): IPromise; } @@ -48897,11 +51359,11 @@ declare namespace __esri { interface CoordinateConversionConstructor { /** * The CoordinateConversion widget provides a way to display user cursor position either as map coordinates or as any of several popular coordinate notations. Additionally, the widget provides a way to convert user input coordinates into a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html) */ - new(properties?: CoordinateConversionProperties): CoordinateConversion; + new (properties?: CoordinateConversionProperties): CoordinateConversion; } export const CoordinateConversion: CoordinateConversionConstructor; @@ -48909,65 +51371,65 @@ declare namespace __esri { interface CoordinateConversionProperties extends WidgetProperties, GoToProperties { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#conversions) */ conversions?: CollectionProperties; /** * Describes the location of the coordinates currently displayed by the widget as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#conversions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#currentLocation) */ currentLocation?: PointProperties; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) that the widget is capable of displaying. The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#formats) */ formats?: CollectionProperties; /** - * Describes the current mode of the widget. **Possible Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#mode) - * + * * @default live */ mode?: string; /** * If this property is set to `true`, multiple conversions can be displayed. For a simpler experience with only one conversion at a time, this property can be set to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#multipleConversions) - * + * * @default true */ multipleConversions?: boolean; /** * Determines whether the widget should expand up or down. If set to `auto` the widget will be oriented based on its position in the view. **Possible Values:** auto | expand-up | expand-down - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#orientation) - * + * * @default auto */ orientation?: string; /** * The number of milliseconds of delay before conversion requests will be sent to the [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html). This only affects conversions that cannot be performed in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#requestDelay) - * + * * @default 300 */ requestDelay?: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. The view model contains the logic that controls the Coordinate Widget's behavior. See the [CoordinateConversionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#viewModel) */ viewModel?: CoordinateConversionViewModelProperties; @@ -48976,97 +51438,95 @@ declare namespace __esri { interface CoordinateConversionViewModel extends Accessor, GoTo { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#conversions) */ conversions: Collection; /** * Describes the location of the coordinates currently displayed by the widget as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#conversions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#currentLocation) */ currentLocation: Point; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) that the widget is capable of displaying. The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#formats) */ formats: Collection; /** * This symbol is used to visualize the location currently described by the widget when `capture` mode is active. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#locationSymbol) */ locationSymbol: SimpleMarkerSymbol | PictureMarkerSymbol; /** - * Describes the current mode of the widget. **Possible Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#mode) - * + * * @default live */ mode: string; /** * The number of milliseconds of delay before conversion requests will be sent to the [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html). This only affects conversions that cannot be performed in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#requestDelay) - * + * * @default 300 */ requestDelay: number; /** * The view model's state. **Possible Values:** ready | loading | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#view) */ view: MapView | SceneView; /** * Attempt to convert a point into a [Position](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#Position). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#convert) - * + * * @param point The point to convert. * @param format The format that describes how the point should be converted. - * + * */ convert(point: Point, format: Format): IPromise; /** * Attempt to convert a string into a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The format of the string must be specified. A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of available formats can be obtained from the [formats](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#formats) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#reverseConvert) - * + * * @param coordinate The coordinate string. * @param format Specifies the format of the input coordinate. - * + * */ reverseConvert(coordinate: string, format: Format): IPromise; /** * Update the input conversions based on the input point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#updateConversions) - * + * * @param location A point that will be used to update each input conversion. * @param conversions An array of [Conversions](esri-widgets-CoordinateConversion-support-Conversion.html) to be updated. - * + * */ updateConversions(location: Point, conversions: Conversion[]): IPromise; } interface CoordinateConversionViewModelConstructor { - - - new(properties?: CoordinateConversionViewModelProperties): CoordinateConversionViewModel; + new (properties?: CoordinateConversionViewModelProperties): CoordinateConversionViewModel; } export const CoordinateConversionViewModel: CoordinateConversionViewModelConstructor; @@ -49074,49 +51534,49 @@ declare namespace __esri { interface CoordinateConversionViewModelProperties extends GoToProperties { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#conversions) */ conversions?: CollectionProperties; /** * Describes the location of the coordinates currently displayed by the widget as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#conversions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#currentLocation) */ currentLocation?: PointProperties; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) that the widget is capable of displaying. The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#formats) */ formats?: CollectionProperties; /** * This symbol is used to visualize the location currently described by the widget when `capture` mode is active. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#locationSymbol) */ locationSymbol?: SimpleMarkerSymbolProperties | PictureMarkerSymbolProperties; /** - * Describes the current mode of the widget. **Possible Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#mode) - * + * * @default live */ mode?: string; /** * The number of milliseconds of delay before conversion requests will be sent to the [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html). This only affects conversions that cannot be performed in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#requestDelay) - * + * * @default 300 */ requestDelay?: number; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -49124,41 +51584,40 @@ declare namespace __esri { /** * Describes a point in terms of a location, a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), and a coordinate, a string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#Position) */ export interface Position extends Object { /** * A point geometry representing the location described by the conversion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#Position) */ location: Point; /** * A string representing the location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#Position) */ coordinate: string; } - interface Conversion { /** * A formatted string based on the current [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#position) and display information on the [format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#format). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#displayCoordinate) */ readonly displayCoordinate: string; /** * The [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) for this conversion. The Format contains information detailing how the Conversion should be performed and how it will be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#format) */ format: Format; /** * The position property contains the location information for this conversion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#position) */ position: ConversionPosition; @@ -49168,75 +51627,74 @@ declare namespace __esri { /** * Describes a point in terms of a location, a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), and a coordinate, a string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#Position) */ export interface ConversionPosition extends Object { /** * A point geometry representing the location described by the conversion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#Position) */ location: Point; /** * A string representing the location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#Position) */ coordinate: string; } - interface Format { /** * Contains information that describes how this Format should be converted. This property should only be set when creating a custom Format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#conversionInfo) - * + * * @default null */ conversionInfo: ConversionInfo; /** * A array of [Coordinate Segments](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment). Each segment represents a section of the Format's coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#coordinateSegments) - * + * * @default null */ coordinateSegments: CoordinateSegment[]; /** * A string that serves as a pattern describing how this Format should be displayed. The pattern should contain all of aliases specified by the Format's [coordinateSegments property](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#coordinateSegments). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#currentPattern) - * + * * @default null */ currentPattern: string; /** * The default pattern describing how this Format should be displayed. See [currentPattern](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#currentPattern). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#defaultPattern) - * + * * @default null */ defaultPattern: string; /** * The name of the coordinate. A [CoordinateConversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html) widget should not contain multiple Formats with the same name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#name) - * + * * @default null */ name: string; /** * The [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) for this format. Coordinates generated for a format will be derived from points in this spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#spatialReference) */ spatialReference: SpatialReference; /** * The view model of the [CoordinateConversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html) widget that is utilizing this format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#viewModel) */ viewModel: CoordinateConversionViewModel; @@ -49246,50 +51704,50 @@ declare namespace __esri { /** * This object describes how a Format should be projected and formatted for display. Used to define custom Formats that require custom conversion and/or projection logic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) */ export interface ConversionInfo extends Object { /** * A function that takes a point and returns a [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) - * - * + * + * */ convert(): void; /** * A function that takes a string and returns a Point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) - * - * + * + * */ reverseConvert(): void; } /** - * A coordinate segment represents one piece of a coordinate string. + * A coordinate segment represents one piece of a coordinate string. * > A MGRS coordinate, for example `30UVG898998`, is described by four segments: 1. Alias `Z`, the gridzone: `30U` 2. Alias `S`, the 100,000 meter square designator: `VG` 3. Alias `X`, the easting (x coordinate with respect to the 10,000 meter square): `898` 4. Alias `Y`, the northing (y coordinate with respect to the 10,000 meter square): `998` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment) */ export interface CoordinateSegment extends Object { /** * A string that provides the name for this segment of a coordinate string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment) */ alias: string; /** * A string that describes the role of this segment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment) */ description: string; /** * A regular expression that should extract this segment from the complete coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment) */ searchPattern: RegExp; @@ -49297,19 +51755,19 @@ declare namespace __esri { /** * Describes a point in terms of a location, a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), and a coordinate, a string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position) */ export interface FormatPosition extends Object { /** * A point geometry representing the location described by the conversion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position) */ location: Point; /** * A string representing the location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position) */ coordinate: string; @@ -49318,87 +51776,87 @@ declare namespace __esri { interface Directions extends Widget, GoTo { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#label) */ readonly label: string; /** * The maximum number of stops allowed for routing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#maxStops) - * + * * @default 50 */ maxStops: number; /** * The URL of the REST endpoint of the Route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeServiceUrl) - * + * * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" */ routeServiceUrl: string; /** * Defines the symbol used to draw the route on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeSymbol) */ routeSymbol: SimpleLineSymbol; /** * Controls the default properties used when [searching](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). Note that the default `searchProperties` differ slightly from the [Search widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#searchProperties) - * + * * @default null */ searchProperties: DirectionsSearchProperties; /** * The default stop symbols used to display locations between the origin and final destination. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ stopSymbols: DirectionsStopSymbols; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view) */ view: MapView | SceneView; /** * 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 [DirectionsViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#viewModel) */ viewModel: DirectionsViewModel; /** * Calculate the route to the input locations and display the list of directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#getDirections) - * - * + * + * */ getDirections(): IPromise; /** * *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-Directions.html#render) - * - * + * + * */ render(): any; /** * Zoom so that the full route is displayed within the current map extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#zoomToRoute) - * - * + * + * */ zoomToRoute(): void; } @@ -49406,11 +51864,11 @@ declare namespace __esri { interface DirectionsConstructor { /** * The Directions Widget provides a way to build driving and walking directions using ArcGIS online and custom Network Analysis Route services. Similar to how the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) works, this widget generates a route finding a least-cost path between multiple points using a specified network. The resulting directions are displayed with detailed turn-by-turn instructions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html) */ - new(properties?: DirectionsProperties): Directions; + new (properties?: DirectionsProperties): Directions; } export const Directions: DirectionsConstructor; @@ -49418,49 +51876,49 @@ declare namespace __esri { interface DirectionsProperties extends WidgetProperties, GoToProperties { /** * The maximum number of stops allowed for routing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#maxStops) - * + * * @default 50 */ maxStops?: number; /** * The URL of the REST endpoint of the Route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeServiceUrl) - * + * * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" */ routeServiceUrl?: string; /** * Defines the symbol used to draw the route on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeSymbol) */ routeSymbol?: SimpleLineSymbolProperties; /** * Controls the default properties used when [searching](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). Note that the default `searchProperties` differ slightly from the [Search widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#searchProperties) - * + * * @default null */ searchProperties?: DirectionsSearchProperties; /** * The default stop symbols used to display locations between the origin and final destination. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ stopSymbols?: DirectionsStopSymbols; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [DirectionsViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#viewModel) */ viewModel?: DirectionsViewModelProperties; @@ -49469,166 +51927,166 @@ declare namespace __esri { interface DirectionsViewModel extends Accessor, GoTo { /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#impedanceAttribute) */ impedanceAttribute: string; /** * The most recent route result. Returns an object containing properties for any barriers used when generating the route, messages that may arise when solving the route, and finally an array of returned [RouteResults](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) - * + * * @default null */ readonly lastRoute: DirectionsViewModelLastRoute; /** * The maximum number of stops allowed for routing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#maxStops) - * + * * @default 50 */ maxStops: number; /** * Route Parameters object used to call the service. Please refer to the [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html) documentation for the list of available settings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeParameters) */ routeParameters: RouteParameters; /** * The URL of the REST endpoint of the Route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeServiceUrl) - * + * * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" */ routeServiceUrl: string; /** * Defines the symbol used to draw the route on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeSymbol) */ routeSymbol: SimpleLineSymbol; /** * The selected travel mode. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) - * + * * @default null | 'Driving Time' */ readonly selectedTravelMode: DirectionsViewModelSelectedTravelMode; /** * The Service Description object returned by the Route REST Endpoint. This object contains service specific details like available Cost attributes, supported Restrictions, default Attribute Parameter Values, Service Limits (like maximum input stop count), default Impedance Attribute, etc. This information is useful when implementing complex logistics scenarios operating with limitations or preferences on vehicle or stop properties, for example avoiding toll roads, dealing with hazardous materials, working with stop service times, etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#serviceDescription) - * + * * @default null */ readonly serviceDescription: any; /** * The current state of the view model. **Possible Values:** disabled | ready - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * An array of graphics that define the stop locations along the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stops) */ stops: Collection; /** * The default stop symbols used to display locations between the origin and final destination. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ stopSymbols: DirectionsViewModelStopSymbols; /** * The name of the network attribute to use for the drive time when computing directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) */ timeAttribute: DirectionsViewModelTimeAttribute; /** * Array of objects containing properties specific to either an ArcGIS service or organization's travel modes. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#travelModes) */ readonly travelModes: TravelMode[]; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#view) */ view: MapView | SceneView; /** * Centers the map at the specified maneuver or stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#centerAt) - * + * * @param stopOrManeuver The stop or maneuver where the map should be centered. - * + * */ centerAt(stopOrManeuver: Graphic): void; /** * Clears any highlighted route segments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#clearHighlights) - * - * + * + * */ clearHighlights(): void; /** * Removes the route directions from the directions list, leaving the inputs untouched. The route and locations persist on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#clearResults) - * - * + * + * */ clearResults(): void; /** * Returns cost attribute name specific to a particular route service. This can be used as a [travel mode impedance](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getCostAttribute) - * + * * @param attributeName The attribute name specifying the cost attribute used as an impedance. - * + * */ getCostAttribute(attributeName: string): string; /** * Calculate the route to the input locations and display the list of directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getDirections) - * - * + * + * */ getDirections(): IPromise; /** * Highlights the specified route segment on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#highlightSegment) - * + * * @param maneuver The route segment to highlight. - * + * */ highlightSegment(maneuver: Graphic): void; /** * Resets the state of the ViewModel, clearing off all the input stops, and results in the widget. The results persist in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#reset) - * - * + * + * */ reset(): void; /** * Zoom so that the full route is displayed within the current map extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#zoomToRoute) - * - * + * + * */ zoomToRoute(): void; } @@ -49636,11 +52094,11 @@ declare namespace __esri { interface DirectionsViewModelConstructor { /** * Provides the communication and data manipulation logic for the [Directions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html) */ - new(properties?: DirectionsViewModelProperties): DirectionsViewModel; + new (properties?: DirectionsViewModelProperties): DirectionsViewModel; } export const DirectionsViewModel: DirectionsViewModelConstructor; @@ -49648,109 +52106,107 @@ declare namespace __esri { interface DirectionsViewModelProperties extends GoToProperties { /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#impedanceAttribute) */ impedanceAttribute?: string; /** * The maximum number of stops allowed for routing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#maxStops) - * + * * @default 50 */ maxStops?: number; /** * Route Parameters object used to call the service. Please refer to the [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html) documentation for the list of available settings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeParameters) */ routeParameters?: RouteParametersProperties; /** * The URL of the REST endpoint of the Route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeServiceUrl) - * + * * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" */ routeServiceUrl?: string; /** * Defines the symbol used to draw the route on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeSymbol) */ routeSymbol?: SimpleLineSymbolProperties; /** * An array of graphics that define the stop locations along the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stops) */ stops?: CollectionProperties; /** * The default stop symbols used to display locations between the origin and final destination. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ stopSymbols?: DirectionsViewModelStopSymbols; /** * The name of the network attribute to use for the drive time when computing directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) */ timeAttribute?: DirectionsViewModelTimeAttribute; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; } - export interface DirectionsViewModelLastRoute extends Object { /** * Array of graphics representing the point barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ barriers: Graphic[]; /** * An array of messages serialized to JSON. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ messages: DirectionsViewModelLastRouteMessages[]; /** * Array of graphics representing the polygon barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ polygonBarriers: Graphic[]; /** * Array of graphics representing the polygon barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ polylineBarriers: Graphic[]; /** * An array of [RouteResults](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ routeResults: RouteResult; } - export interface DirectionsViewModelLastRouteMessages extends Object { /** * A descriptive message of the returned mesage. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ description: string; /** * Number indicating the message type returned from the service. This number correlates to one of the possible values listed below. - * + * * Number | Value * ------|------------ * 0 | informative @@ -49761,92 +52217,89 @@ declare namespace __esri { * 100 | error * 101 | empty * 200 | abort - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ type: number; } - export interface DirectionsViewModelSelectedTravelMode extends TravelMode { /** * The description explaining the selected travel mode. A listing of these descriptions can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ description: string; /** * The unique identifier specific for this travel mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ id: string; /** * The cost attribute on which to optimize the analysis. For example `Miles`, `Minutes`, `Travel Time`, `Kilometers`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. Take note that attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ impedanceAttributeName: string; /** * Name of the travel mode. Users of ArcGIS Online or ArcGIS Enterprise can define custom travel modes inside their Organization settings. Authors of stand alone Network Analysis Services can define their own travel modes inside a network dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ name: string; /** * The time-based cost attribute for reporting directions. For example, `Minutes`, `Travel Time`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ timeAttributeName: string; } - export interface DirectionsViewModelStopSymbols extends Object { /** * The first stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ first?: Symbol; /** * The middle stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ middle?: Symbol; /** * The last stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ last?: Symbol; /** * An unlocated stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ unlocated?: Symbol; /** * A waypoint stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ waypoint?: Symbol; } - export interface DirectionsViewModelTimeAttribute extends Object { /** * The name of the network attribute to use for the drive time when computing directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) */ name: string; /** * The units to use when calculating drive time for directions. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) */ units?: string; @@ -49854,71 +52307,70 @@ declare namespace __esri { /** * Array of objects containing properties specific to either an ArcGIS service or organization's travel modes. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ export interface TravelMode extends Object { /** * The description explaining the selected travel mode. A listing of these descriptions can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ description?: string; /** * The unique identifier specific for this travel mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ id?: string; /** * The cost attribute on which to optimize the analysis. For example `Miles`, `Minutes`, `Travel Time`, `Kilometers`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. Take note that attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ impedanceAttributeName?: string; /** * Name of the travel mode. Users of ArcGIS Online or ArcGIS Enterprise can define custom travel modes inside their Organization settings. Authors of stand alone Network Analysis Services can define their own travel modes inside a network dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ name?: string; /** * The time-based cost attribute for reporting directions. For example, `Minutes`, `Travel Time`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ timeAttributeName?: string; } - export interface DirectionsStopSymbols extends Object { /** * The first stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ first?: Symbol; /** * The middle stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ middle?: Symbol; /** * The last stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ last?: Symbol; /** * An unlocated stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ unlocated?: Symbol; /** * A waypoint stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ waypoint?: Symbol; @@ -49926,109 +52378,109 @@ declare namespace __esri { /** * Configurable Search properties of the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ export interface DirectionsSearchProperties extends Object { - /** - * 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-Directions.html#SearchProperties) - */ - popupOpenOnSelect?: boolean; /** * Number index indicating the current selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ activeSourceIndex?: number; + /** + * String value used as a hint for input text when searching on multiple sources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + allPlaceholder?: string; /** * Indicates whether to automatically navigate to the selected result once selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ autoNavigate?: boolean; /** * Indicates whether to automatically select and zoom to the first geocoded result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ autoSelect?: boolean; /** * Indicates the maximum number of search results to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ 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-Directions.html#SearchProperties) */ 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-Directions.html#SearchProperties) */ minSuggestCharacters?: number; /** * 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-Directions.html#SearchProperties) */ popupEnabled?: boolean; /** - * String value used as a hint for input text when searching on multiple sources. - * + * 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-Directions.html#SearchProperties) */ - allPlaceholder?: string; + popupOpenOnSelect?: boolean; /** * A customized PopupTemplate for the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ popupTemplate?: PopupTemplate; /** * Indicates whether to show a graphic on the map for the selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ resultGraphicEnabled?: boolean; /** * Indicates whether to display the option to search all sources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ searchAllEnabled?: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ searchTerm?: string; /** * Specifies the sources to search in the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ sources?: Collection; /** * 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-Directions.html#SearchProperties) */ suggestionsEnabled?: boolean; /** * The view of the widget. - * + * * [Read more...](global.html) */ view?: MapView | SceneView; /** * The Search widget's view model. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ viewModel?: SearchViewModel; @@ -50036,38 +52488,36 @@ declare namespace __esri { interface DirectLineMeasurement3D extends Widget { /** - * 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 - * + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unit) */ unit: string; /** - * List of unit options in the widget drop down list. - * + * List of unit systems (imperial, metric) and specific units for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unitOptions) - * - * @default ["metric", "imperial", "inches", "feet", "yards", "miles", "nautical-miles", "us-feet", "meters", "kilometers"] */ unitOptions: string[]; /** * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#view) */ view: SceneView; /** * 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 [DirectLineMeasurement3DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#viewModel) */ viewModel: DirectLineMeasurement3DViewModel; /** * *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-DirectLineMeasurement3D.html#render) - * - * + * + * */ render(): any; } @@ -50075,39 +52525,37 @@ declare namespace __esri { interface DirectLineMeasurement3DConstructor { /** * The DirectLineMeasurement3D widget calculates and displays the 3D distance between two points. This widget can be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) to measure the vertical, horizontal, and direct distance between two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html) */ - new(properties?: DirectLineMeasurement3DProperties): DirectLineMeasurement3D; + new (properties?: DirectLineMeasurement3DProperties): DirectLineMeasurement3D; } export const DirectLineMeasurement3D: DirectLineMeasurement3DConstructor; interface DirectLineMeasurement3DProperties extends WidgetProperties { /** - * 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 - * + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unit) */ unit?: string; /** - * List of unit options in the widget drop down list. - * + * List of unit systems (imperial, metric) and specific units for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unitOptions) - * - * @default ["metric", "imperial", "inches", "feet", "yards", "miles", "nautical-miles", "us-feet", "meters", "kilometers"] */ unitOptions?: string[]; /** * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#view) */ view?: SceneViewProperties; /** * 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 [DirectLineMeasurement3DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#viewModel) */ viewModel?: DirectLineMeasurement3DViewModelProperties; @@ -50116,110 +52564,111 @@ declare namespace __esri { interface DirectLineMeasurement3DViewModel extends Accessor { /** * The current measurement calculated between the two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ readonly measurement: DirectLineMeasurement3DViewModelMeasurement; /** - * The view model's state. - * + * The view model's state. + * * Value | Description * ------------|------------- * disabled | not ready yet * ready | ready for measuring * measuring | currently measuring - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** - * 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 - * + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * * [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. - * + * List of unit systems (imperial, metric) and specific units for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * * [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: SceneView; /** * Clears the current measurement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#clearMeasurement) - * - * + * + * */ clearMeasurement(): void; + /** + * Starts a new measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#newMeasurement) + * + * + */ + newMeasurement(): void; } interface DirectLineMeasurement3DViewModelConstructor { - - - new(properties?: DirectLineMeasurement3DViewModelProperties): 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 - * + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * * [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. - * + * List of unit systems (imperial, metric) and specific units for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * * [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 { /** * Describes the mode in which the measurement was taken. In `euclidean` mode, the distances are measured as straight lines in the [ECEF](https://en.wikipedia.org/wiki/ECEF) coordinate system. In `geodesic` mode, the distances are measured as geodesic lines on the WGS84 ellipsoid. **Possible Values:** euclidean | geodesic - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ measurementMode: string; /** * The direct distance between the two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ directDistance: DirectLineMeasurement3DViewModelMeasurementValue; /** * The horizontal distance between the two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ horizontalDistance: DirectLineMeasurement3DViewModelMeasurementValue; /** * The vertical distance between the two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ verticalDistance: DirectLineMeasurement3DViewModelMeasurementValue; @@ -50227,159 +52676,382 @@ declare namespace __esri { /** * Measurement value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#MeasurementValue) */ export interface DirectLineMeasurement3DViewModelMeasurementValue extends Object { /** * Textual representation of the measured value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#MeasurementValue) */ text: string; /** - * State of the measured value. - * + * State of the measured value. + * * Value | Description * ------------|------------- * available | measured value is available * unavailable | measured value is not available due an incomplete measurement or because the value is not available for the given measurement configuration (e.g. direct distance is unavailable in `geodesic` mode) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#MeasurementValue) */ state: string; } + interface DistanceMeasurement2D extends Widget { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#iconClass) + */ + readonly iconClass: string; + /** + * The widget's default label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#label) + */ + readonly label: string; + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unit) + */ + unit: + | "metric" + | "imperial" + | "inches" + | "feet" + | "us-feet" + | "yards" + | "miles" + | "nautical-miles" + | "meters" + | "kilometers"; + /** + * List of available units and unit systems (imperial, metric) for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unitOptions) + */ + unitOptions: string[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#view) + */ + view: MapView; + /** + * 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 [DistanceMeasurement2DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#viewModel) + */ + viewModel: DistanceMeasurement2DViewModel; + + /** + * *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-DistanceMeasurement2D.html#render) + * + * + */ + render(): any; + } + + interface DistanceMeasurement2DConstructor { + /** + * The DistanceMeasurement2D widget calculates and displays the distance between two or more points in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). When the distance is less than 100 km, the default [mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#mode) is `planar`. When the distance is greater than or equal to 100 km, the default [mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#mode) is `geodesic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html) + */ + + new (properties?: DistanceMeasurement2DProperties): DistanceMeasurement2D; + } + + export const DistanceMeasurement2D: DistanceMeasurement2DConstructor; + + interface DistanceMeasurement2DProperties extends WidgetProperties { + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unit) + */ + unit?: + | "metric" + | "imperial" + | "inches" + | "feet" + | "us-feet" + | "yards" + | "miles" + | "nautical-miles" + | "meters" + | "kilometers"; + /** + * List of available units and unit systems (imperial, metric) for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unitOptions) + */ + unitOptions?: string[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#view) + */ + view?: MapViewProperties; + /** + * 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 [DistanceMeasurement2DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#viewModel) + */ + viewModel?: DistanceMeasurement2DViewModel; + } + + interface DistanceMeasurement2DViewModel { + /** + * The threshold distance used by the "auto" mode to switch between planar and geodesic linear computations. The threshold is measured in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#geodesicDistanceThreshold) + * + * @default 100000 + */ + geodesicDistanceThreshold: number; + /** + * The length and geometry of the measurement polyline in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurement) + */ + readonly measurement: DistanceMeasurement2DViewModelMeasurement; + /** + * This property returns the locale specific representation of the length. Lengths are rounded to two decimal places. Lengths are sourced from the [measurement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurement) property (in meters) and converted to the user defined units or system and mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurementLabel) + */ + readonly measurementLabel: string; + /** + * The mode used to calculate the length of lines. **Possible Values:** auto | planar | geodesic + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#mode) + * + * @default auto + */ + mode: "auto" | "planar" | "geodesic"; + /** + * An array of valid mode values. By default, the following units are included: `auto`, `planar`, `geodesic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#modes) + */ + readonly modes: string[]; + /** + * The view model's state. **Possible Values:** disabled | ready | measuring + * + * Value | Description + * ------------|------------- + * disabled | not ready yet + * ready | ready for measuring + * measuring | measuring has started + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#unit) + */ + unit: + | "metric" + | "imperial" + | "inches" + | "feet" + | "us-feet" + | "yards" + | "miles" + | "nautical-miles" + | "meters" + | "kilometers"; + /** + * List of available units and unit systems (imperial, metric) for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#unitOptions) + */ + unitOptions: string[]; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#view) + */ + view: MapView; + + /** + * Clears the current measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#clearMeasurement) + * + * + */ + clearMeasurement(): void; + /** + * Starts a new measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#newMeasurement) + * + * + */ + newMeasurement(): void; + } + + interface DistanceMeasurement2DViewModelConstructor { + new (properties?: any): DistanceMeasurement2DViewModel; + } + + export const DistanceMeasurement2DViewModel: DistanceMeasurement2DViewModelConstructor; + + export interface DistanceMeasurement2DViewModelMeasurement extends Object { + /** + * Line length (m). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurement) + */ + length: number; + /** + * Measurement line. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurement) + */ + geometry: any; + } + interface Expand extends Widget { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#autoCollapse) - * + * * @default false */ autoCollapse: boolean; /** * Icon font used to style the Expand button. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseIconClass) */ collapseIconClass: string; /** * Tooltip to display to indicate Expand widget can be collapsed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseTooltip) - * + * * @default "Collapse" (English locale) */ collapseTooltip: string; /** * The content to display within the expanded Expand widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) */ content: Node | string | Widget; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) */ expandIconClass: string; /** * Tooltip to display to indicate Expand widget can be expanded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandTooltip) - * + * * @default "Expand" (English locale) */ expandTooltip: string; /** * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group) */ 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/assets/img/apiref/widgets/expand-with-iconnumber.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#iconNumber) */ iconNumber: number; /** - * The mode in which the widget displays. These modes are listed below. - * + * The mode in which the widget displays. These modes are listed below. + * * mode | description * ---------------|------------ * auto | This is the default mode. It is responsive to browser size changes and will update based on whether the widget is viewed in a desktop or mobile application. * floating | Use this mode if you wish to always display the widget as floating regardless of browser size. * drawer | Use this mode if you wish to always display the widget in a panel regardless of browser size. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#mode) - * + * * @default "auto" */ mode: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#view) */ view: MapView | SceneView; /** * 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 [ExpandViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#viewModel) */ viewModel: ExpandViewModel; /** * Collapse the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapse) - * - * + * + * */ collapse(): void; /** * Expand the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expand) - * - * + * + * */ expand(): void; /** * *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-Expand.html#render) - * - * + * + * */ render(): any; /** * Toggle the widget by expanding it if it's collapsed, or collapsing it if it's expanded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#toggle) - * - * + * + * */ toggle(): void; } interface ExpandConstructor { - - - new(properties?: ExpandProperties): Expand; + new (properties?: ExpandProperties): Expand; } export const Expand: ExpandConstructor; @@ -50387,90 +53059,90 @@ declare namespace __esri { interface ExpandProperties extends WidgetProperties { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#autoCollapse) - * + * * @default false */ autoCollapse?: boolean; /** * Icon font used to style the Expand button. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseIconClass) */ collapseIconClass?: string; /** * Tooltip to display to indicate Expand widget can be collapsed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseTooltip) - * + * * @default "Collapse" (English locale) */ collapseTooltip?: string; /** * The content to display within the expanded Expand widget. - * + * * [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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) */ expandIconClass?: string; /** * Tooltip to display to indicate Expand widget can be expanded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandTooltip) - * + * * @default "Expand" (English locale) */ expandTooltip?: string; /** * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group) */ 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/assets/img/apiref/widgets/expand-with-iconnumber.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#iconNumber) */ iconNumber?: number; /** - * The mode in which the widget displays. These modes are listed below. - * + * The mode in which the widget displays. These modes are listed below. + * * mode | description * ---------------|------------ * auto | This is the default mode. It is responsive to browser size changes and will update based on whether the widget is viewed in a desktop or mobile application. * floating | Use this mode if you wish to always display the widget as floating regardless of browser size. * drawer | Use this mode if you wish to always display the widget in a panel regardless of browser size. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#mode) - * + * * @default "auto" */ mode?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [ExpandViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#viewModel) */ viewModel?: ExpandViewModelProperties; @@ -50479,46 +53151,44 @@ declare namespace __esri { interface ExpandViewModel extends Accessor { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#autoCollapse) - * + * * @default false */ autoCollapse: boolean; /** * Whether the widget is currently expanded or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#expanded) - * + * * @default false */ readonly expanded: boolean; /** * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#group) */ group: string; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view in which the Expand is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#view) */ view: MapView | SceneView; } interface ExpandViewModelConstructor { - - - new(properties?: ExpandViewModelProperties): ExpandViewModel; + new (properties?: ExpandViewModelProperties): ExpandViewModel; } export const ExpandViewModel: ExpandViewModelConstructor; @@ -50526,21 +53196,21 @@ declare namespace __esri { interface ExpandViewModelProperties { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#autoCollapse) - * + * * @default false */ autoCollapse?: boolean; /** * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#group) */ group?: string; /** * The view in which the Expand is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -50549,77 +53219,75 @@ declare namespace __esri { interface Feature extends Widget { /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#graphic) - * + * * @default null */ graphic: Graphic; /** * The title for the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#title) - * + * * @default null */ readonly title: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#view) - * + * * @default null */ view: MapView | SceneView; /** * 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 [FeatureViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#viewModel) */ viewModel: FeatureViewModel; /** * Paginates to a specified [media](esri-PopupTemplate.html#media) info object. For example, you may have [media](esri-PopupTemplate.html#media) content which contains multiple `mediaInfos`. This method allows you to specify the index of the `mediaInfos` you wish to display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#goToMedia) - * + * * @param contentElementIndex The index position of the [media](esri-PopupTemplate.html#media) content element to be updated. * @param mediaInfoIndex The index position of the [media](esri-PopupTemplate.html#media) info object you wish to display. - * + * */ goToMedia(contentElementIndex: number, mediaInfoIndex: number): void; /** * Paginates to the next [media](esri-PopupTemplate.html#media) info. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#nextMedia) - * + * * @param contentElementIndex The index position of the [media](esri-PopupTemplate.html#media) content element. - * + * */ nextMedia(contentElementIndex: number): void; /** * Paginates to the previous [media](esri-PopupTemplate.html#media) info in the specified [media](esri-PopupTemplate.html#media) content element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#previousMedia) - * + * * @param contentElementIndex The index position of the [media](esri-PopupTemplate.html#media) content element. - * + * */ previousMedia(contentElementIndex: number): void; /** * *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-Feature.html#render) - * - * + * + * */ render(): any; } interface FeatureConstructor { - - - new(properties?: FeatureProperties): Feature; + new (properties?: FeatureProperties): Feature; } export const Feature: FeatureConstructor; @@ -50627,23 +53295,23 @@ declare namespace __esri { interface FeatureProperties extends WidgetProperties { /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#graphic) - * + * * @default null */ graphic?: GraphicProperties; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#view) - * + * * @default null */ view?: MapViewProperties | SceneViewProperties; /** * 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 [FeatureViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#viewModel) */ viewModel?: FeatureViewModelProperties; @@ -50652,9 +53320,9 @@ declare namespace __esri { interface FeatureViewModel extends Accessor { /** * The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#content) - * + * * @default null */ readonly content: string | any[] | HTMLElement | Widget; @@ -50662,50 +53330,48 @@ declare namespace __esri { * The formatted attributes calculated from `fieldInfo` [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) content. They are obtained from the feature's [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) attribute values and can be read: * * globally using the [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property directly at the root level of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), or * * per an individual content element. This element is defined with a type of fields on the PopupTemplate's content property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#formattedAttributes) - * + * * @default null */ readonly formattedAttributes: FeatureViewModelFormattedAttributes; /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) - * + * * @default null */ graphic: Graphic; /** * The title for the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#title) - * + * * @default null */ readonly title: string; /** * The view associated with the Feature instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#view) - * + * * @default null */ view: MapView | SceneView; /** * Indicates whether the feature is currently waiting for all of its content to finish loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#waitingForContent) - * + * * @default true */ readonly waitingForContent: boolean; } interface FeatureViewModelConstructor { - - - new(properties?: FeatureViewModelProperties): FeatureViewModel; + new (properties?: FeatureViewModelProperties): FeatureViewModel; } export const FeatureViewModel: FeatureViewModelConstructor; @@ -50713,33 +53379,32 @@ declare namespace __esri { interface FeatureViewModelProperties { /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) - * + * * @default null */ graphic?: GraphicProperties; /** * The view associated with the Feature instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#view) - * + * * @default null */ view?: MapViewProperties | SceneViewProperties; } - export interface FeatureViewModelFormattedAttributes extends Object { /** * The formatted attributes specified at the root level of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) using the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. - * + * * [Read more...](global.html) */ global?: any; /** * The formatted attributes for an individual content element. This is derived from the module:esri/PopupTemplate#fields content property of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) defined as type `fields`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#formattedAttributes) */ content?: any; @@ -50748,64 +53413,78 @@ declare namespace __esri { 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. + * Array of individual or grouped field configuration objects. This is where you specify what fields to display and how you wish to display them. It is possible to configure individual or [grouped fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html). For an example of individual field configurations, please refer to the [Update FeatureLayer using ApplyEdits](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/index.html) sample. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. * > 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[]; + fieldConfig: FieldConfig[] | FieldGroupConfig[]; + /** + * Defines how groups will be displayed to the user. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * all | All groups will be expanded. + * sequential | A single group will be expanded at a time. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#groupDisplay) + * + * @default all + */ + groupDisplay: string; /** * 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). - * + * 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. You can configure field groupings to aid in display and organization of form data. 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; + new (properties?: FeatureFormProperties): FeatureForm; } export const FeatureForm: FeatureFormConstructor; @@ -50813,26 +53492,40 @@ declare namespace __esri { 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. + * Array of individual or grouped field configuration objects. This is where you specify what fields to display and how you wish to display them. It is possible to configure individual or [grouped fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html). For an example of individual field configurations, please refer to the [Update FeatureLayer using ApplyEdits](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/index.html) sample. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. * > 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[]; + fieldConfig?: FieldConfigProperties[] | FieldGroupConfigProperties[]; + /** + * Defines how groups will be displayed to the user. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * all | All groups will be expanded. + * sequential | A single group will be expanded at a time. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#groupDisplay) + * + * @default all + */ + groupDisplay?: string; /** * 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; @@ -50841,58 +53534,67 @@ declare namespace __esri { 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. + * Array of individual or grouped field configuration objects. This is where you specify what fields to display and how you wish to display them. It is possible to configure individual or [grouped fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html). For an example of individual field configurations, please refer to the [Update FeatureLayer using ApplyEdits](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/index.html) sample. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. * > 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[]; + fieldConfig: FieldConfig[] | FieldGroupConfig[]; /** - * The input fields to be rendered by the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. - * + * The input fields and/or grouped field 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[]; + readonly inputField: InputField[] | InputFieldGroup[]; /** * 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. - * + * 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; + /** + * Convenience method to find input fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#findField) + * + * @param fieldName The input field to find. + * + */ + findField(fieldName: string): InputField; /** * 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; } @@ -50900,11 +53602,11 @@ declare namespace __esri { 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; + new (properties?: FeatureFormViewModelProperties): FeatureFormViewModel; } export const FeatureFormViewModel: FeatureFormViewModelConstructor; @@ -50912,372 +53614,735 @@ declare namespace __esri { 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. + * Array of individual or grouped field configuration objects. This is where you specify what fields to display and how you wish to display them. It is possible to configure individual or [grouped fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html). For an example of individual field configurations, please refer to the [Update FeatureLayer using ApplyEdits](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/index.html) sample. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. * > 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[]; + fieldConfig?: FieldConfigProperties[] | FieldGroupConfigProperties[]; /** * 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's description. The description is shown below the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.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-FieldConfig.html#domain) + */ + domain: CodedValueDomain | RangeDomain; + /** + * Indicates whether the field can be edited. + * > This does not change the underlying service's field and whether it can be edited. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.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-FieldConfig.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-FieldConfig.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-FieldConfig.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-FieldConfig.html#maxLength) + * + * @default -1 + */ + maxLength: number; /** * 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) + * 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-FieldConfig.html#required) + * + * @default false */ - options: FieldOptions; + required: boolean; } interface FieldConfigConstructor { - - - new(properties?: FieldConfigProperties): FieldConfig; + 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) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#description) */ description?: string; /** - * The field's domain. This is used to constrain the allowable values of the layer. + * 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) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.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) - * + * Indicates whether the field can be edited. + * > This does not change the underlying service's field and whether it can be edited. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#editable) + * * @default true */ editable?: boolean; /** - * The type of editor to use for `string` field types. Possible values are in the table below. - * + * 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) - * + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.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) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.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) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#label) */ label?: string; /** - * Restricts the input length. + * 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) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.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) - * + * The field name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#name) + */ + name?: string; + /** + * 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-FieldConfig.html#required) + * * @default false */ required?: boolean; + } + + interface FieldGroupConfig extends Accessor { /** - * 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 + * The field's description. The description is shown below the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#description) */ - visible?: boolean; + description: string; + /** + * The field configurations belonging to a group. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#fieldConfig) + */ + fieldConfig: FieldConfig[]; + /** + * The field's label. The label is shown above the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#label) + */ + label: string; + } + + interface FieldGroupConfigConstructor { + new (properties?: FieldGroupConfigProperties): FieldGroupConfig; + } + + export const FieldGroupConfig: FieldGroupConfigConstructor; + + interface FieldGroupConfigProperties { + /** + * The field's description. The description is shown below the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#description) + */ + description?: string; + /** + * The field configurations belonging to a group. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#fieldConfig) + */ + fieldConfig?: FieldConfigProperties[]; + /** + * The field's label. The label is shown above the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#label) + */ + label?: string; } 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. - * + * When true, the field can be edited. + * * [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. - * + * 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" + * + * @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; + /** + * The group this input field belongs to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#group) + */ + readonly group: InputFieldGroup; /** * 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. - * + * 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; + new (properties?: InputFieldProperties): InputField; } export const InputField: InputFieldConstructor; - interface InputFieldProperties { + interface InputFieldProperties {} + interface InputFieldGroup extends Accessor { + /** + * The group's description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#description) + */ + description: string; + /** + * The input fields belonging to this group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#inputFields) + */ + readonly inputFields: InputField[]; + /** + * The group's label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#label) + */ + readonly label: string; + /** + * The group's visibility. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#visible) + */ + readonly visible: boolean; } + interface InputFieldGroupConstructor { + new (properties?: InputFieldGroupProperties): InputFieldGroup; + } + + export const InputFieldGroup: InputFieldGroupConstructor; + + interface InputFieldGroupProperties { + /** + * The group's description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#description) + */ + description?: string; + } + + interface FeatureTemplates extends Widget { + /** + * When `true`, displays the template [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction). ![featureTemplatesFilter](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilter.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterEnabled) + * + * @default true + */ + filterEnabled: boolean; + /** + * [Function](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#FilterFunction) can be defined to help filter [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) within the widget. A custom function can be used to aid when searching for templates. It takes a function which passes in an object containing a [name](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) property of the [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). ![featureTemplatesFilterFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilterFunction.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction) + */ + filterFunction: FilterFunction; + /** + * It is possible to group [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). This can aid in managing various template items and how they display within the widget. The values are discussed below. + * + * Type | Description | Example + * ----- | ----------- | ------- + * layer | This is the *default* grouping. Groups template items by layers. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByLayers.png) + * geometry | Groups template items by geometry type. | ![FeatureTemplatesGroupByGeometry](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByGeometry.png) + * none | The widget displays everything in one list with no grouping. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByNone.png) + * [GroupByFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#GroupByFunction) | Custom function that takes an object containing a [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). | ![FeatureTemplatesGroupByCustomGroupFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupCustomGroup.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#groupBy) + * + * @default layer + */ + groupBy: string | GroupByFunction; + /** + * An array of [Featurelayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) to display within the widget. The order in which these layers are set in the array dictates how they display within the widget. + * > The widget is designed to only display layers that are enabled for editing. It will not display layers that are enabled to only edit attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#layers) + */ + layers: 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 [FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#viewModel) + */ + viewModel: FeatureTemplatesViewModel; + + /** + * *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-FeatureTemplates.html#render) + * + * + */ + render(): any; + } + + interface FeatureTemplatesConstructor { + /** + * The FeatureTemplates widget is part of the overall editing workflow. Its main purpose is to display [templates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#templates) from one or more [feature layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). In addition to displaying feature layer templates, it is also possible to [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction) and [group](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#groupBy) templates for an easier editing experience. The widget listens for an end user to select a specific template in the widget. Its [select](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#event:select) event is fired and the resulting template information is returned. This widget can be used in conjunction with [FeatureLayer.applyEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) to enable an end user to update one of its feature layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) + */ + + new (properties?: FeatureTemplatesProperties): FeatureTemplates; + } + + export const FeatureTemplates: FeatureTemplatesConstructor; + + interface FeatureTemplatesProperties extends WidgetProperties { + /** + * When `true`, displays the template [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction). ![featureTemplatesFilter](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilter.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterEnabled) + * + * @default true + */ + filterEnabled?: boolean; + /** + * [Function](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#FilterFunction) can be defined to help filter [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) within the widget. A custom function can be used to aid when searching for templates. It takes a function which passes in an object containing a [name](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) property of the [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). ![featureTemplatesFilterFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilterFunction.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction) + */ + filterFunction?: FilterFunction; + /** + * It is possible to group [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). This can aid in managing various template items and how they display within the widget. The values are discussed below. + * + * Type | Description | Example + * ----- | ----------- | ------- + * layer | This is the *default* grouping. Groups template items by layers. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByLayers.png) + * geometry | Groups template items by geometry type. | ![FeatureTemplatesGroupByGeometry](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByGeometry.png) + * none | The widget displays everything in one list with no grouping. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByNone.png) + * [GroupByFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#GroupByFunction) | Custom function that takes an object containing a [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). | ![FeatureTemplatesGroupByCustomGroupFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupCustomGroup.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#groupBy) + * + * @default layer + */ + groupBy?: string | GroupByFunction; + /** + * An array of [Featurelayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) to display within the widget. The order in which these layers are set in the array dictates how they display within the widget. + * > The widget is designed to only display layers that are enabled for editing. It will not display layers that are enabled to only edit attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#layers) + */ + layers?: 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 [FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#viewModel) + */ + viewModel?: FeatureTemplatesViewModelProperties; + } + + interface FeatureTemplatesViewModel extends Accessor { + /** + * [Function](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#FilterFunction) can be defined to help filter [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) within the widget. A custom function can be used to aid when searching for templates. It takes a function which passes in an object containing a [name](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) property of the [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). ![featureTemplatesFilterFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilterFunction.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#filterFunction) + */ + filterFunction: FilterFunction; + /** + * It is possible to group [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). This can aid in managing various template items and how they display within the widget. The values are discussed below. + * + * Type | Description | Example + * ----- | ----------- | ------- + * layer | This is the *default* grouping. Groups template items by layers. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByLayers.png) + * geometry | Groups template items by geometry type. | ![FeatureTemplatesGroupByGeometry](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByGeometry.png) + * none | The widget displays everything in one list with no grouping. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByNone.png) + * [GroupByFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#GroupByFunction) | Custom function that takes an object containing a [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). | ![FeatureTemplatesGroupByCustomGroupFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupCustomGroup.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#groupBy) + * + * @default layer + */ + groupBy: string | GroupByFunction; + /** + * The template items or grouped template items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#items) + */ + readonly items: TemplateItem | TemplateItemGroup; + /** + * An array of [Featurelayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that are associated with the widget. The order in which these layers are set in the array dictates how they display within the widget. + * > The widget is designed to only display layers that are enabled for editing. It will not display layers that are enabled to only edit attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#layers) + */ + layers: FeatureLayer[]; + /** + * The widget's state. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * ready | Dependencies are met and has valid property values. + * loading | Layers are still loading and not ready yet. + * disabled | No layers are available to load. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + + /** + * Use this method to apply a filter on the items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#refresh) + * + * + */ + refresh(): void; + } + + interface FeatureTemplatesViewModelConstructor { + new (properties?: FeatureTemplatesViewModelProperties): FeatureTemplatesViewModel; + } + + export const FeatureTemplatesViewModel: FeatureTemplatesViewModelConstructor; + + interface FeatureTemplatesViewModelProperties { + /** + * [Function](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#FilterFunction) can be defined to help filter [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) within the widget. A custom function can be used to aid when searching for templates. It takes a function which passes in an object containing a [name](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) property of the [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). ![featureTemplatesFilterFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilterFunction.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#filterFunction) + */ + filterFunction?: FilterFunction; + /** + * It is possible to group [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). This can aid in managing various template items and how they display within the widget. The values are discussed below. + * + * Type | Description | Example + * ----- | ----------- | ------- + * layer | This is the *default* grouping. Groups template items by layers. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByLayers.png) + * geometry | Groups template items by geometry type. | ![FeatureTemplatesGroupByGeometry](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByGeometry.png) + * none | The widget displays everything in one list with no grouping. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByNone.png) + * [GroupByFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#GroupByFunction) | Custom function that takes an object containing a [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). | ![FeatureTemplatesGroupByCustomGroupFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupCustomGroup.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#groupBy) + * + * @default layer + */ + groupBy?: string | GroupByFunction; + /** + * An array of [Featurelayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that are associated with the widget. The order in which these layers are set in the array dictates how they display within the widget. + * > The widget is designed to only display layers that are enabled for editing. It will not display layers that are enabled to only edit attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#layers) + */ + layers?: FeatureLayerProperties[]; + } + + interface TemplateItem extends Accessor { + /** + * The description that is displayed for the template item. This is similar to the description provided in [FeatureTemplate.description](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#description) + */ + description: string; + /** + * The label that is displayed for the template item. This is similar to the name provided in [FeatureTemplate.name](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) + */ + label: string; + /** + * The [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) associated with the template item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#layer) + */ + layer: FeatureLayer; + /** + * The associated [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#template) + */ + template: FeatureTemplate; + /** + * An object used to create a thumbnail image that represents a feature type in the feature template. This is similar to [FeatureTemplate.thumbnail](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#thumbnail) + */ + readonly thumbnail: HTMLElement; + + /** + * Fetches the thumbnail used to display the template item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#fetchThumbnail) + * + * + */ + fetchThumbnail(): IPromise; + } + + interface TemplateItemConstructor { + new (properties?: TemplateItemProperties): TemplateItem; + } + + export const TemplateItem: TemplateItemConstructor; + + interface TemplateItemProperties { + /** + * The description that is displayed for the template item. This is similar to the description provided in [FeatureTemplate.description](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#description) + */ + description?: string; + /** + * The label that is displayed for the template item. This is similar to the name provided in [FeatureTemplate.name](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) + */ + label?: string; + /** + * The [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) associated with the template item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#layer) + */ + layer?: FeatureLayerProperties; + /** + * The associated [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#template) + */ + template?: FeatureTemplateProperties; + } + + interface TemplateItemGroup extends Accessor { + /** + * An array of [TemplateItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) grouped to display in the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItemGroup.html#items) + */ + readonly items: TemplateItem[]; + /** + * The name displayed in the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) widget indicating the grouped [TemplateItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItemGroup.html#label) + */ + readonly label: string; + } + + interface TemplateItemGroupConstructor { + new (properties?: TemplateItemGroupProperties): TemplateItemGroup; + } + + export const TemplateItemGroup: TemplateItemGroupConstructor; + + interface TemplateItemGroupProperties {} + + export type FilterFunction = (filterName: any) => boolean; + + export type GroupByFunction = (grouping: any) => string | any; + interface Fullscreen extends Widget { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#element) */ element: HTMLElement; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#view) */ view: MapView | SceneView; /** * 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 [FullscreenViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#viewModel) */ viewModel: FullscreenViewModel; /** * *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-Fullscreen.html#render) - * - * + * + * */ render(): any; } @@ -51285,11 +54350,11 @@ declare namespace __esri { interface FullscreenConstructor { /** * Provides a simple widget to present the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) or a user-defined [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) using the entire screen. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html) */ - new(properties?: FullscreenProperties): Fullscreen; + new (properties?: FullscreenProperties): Fullscreen; } export const Fullscreen: FullscreenConstructor; @@ -51297,19 +54362,19 @@ declare namespace __esri { interface FullscreenProperties extends WidgetProperties { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#element) */ element?: HTMLElement; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [FullscreenViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#viewModel) */ viewModel?: FullscreenViewModelProperties; @@ -51318,55 +54383,53 @@ declare namespace __esri { interface FullscreenViewModel extends Accessor { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#element) */ element: HTMLElement; /** * The view model's state. **Possible Values:** active | ready | feature-unsupported | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view associated with the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#view) */ view: MapView | SceneView; /** * Enter fullscreen - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#enter) - * - * + * + * */ enter(): void; /** * Exit fullscreen - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#exit) - * - * + * + * */ exit(): void; /** * Toggle fullscreen - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#toggle) - * - * + * + * */ toggle(): void; } interface FullscreenViewModelConstructor { - - - new(properties?: FullscreenViewModelProperties): FullscreenViewModel; + new (properties?: FullscreenViewModelProperties): FullscreenViewModel; } export const FullscreenViewModel: FullscreenViewModelConstructor; @@ -51374,13 +54437,13 @@ declare namespace __esri { interface FullscreenViewModelProperties { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#element) */ element?: HTMLElement; /** * The view associated with the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -51389,60 +54452,60 @@ declare namespace __esri { interface Home extends Widget, GoTo { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#label) */ readonly label: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#view) */ view: MapView | SceneView; /** * 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 [HomeViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewModel) */ viewModel: HomeViewModel; /** - * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint) */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#go) - * - * + * + * */ go(): void; /** * *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-Home.html#render) - * - * + * + * */ render(): any; } @@ -51450,11 +54513,11 @@ declare namespace __esri { interface HomeConstructor { /** * Provides a simple widget that switches the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to its initial [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or a previously defined [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint). By default this button looks like the following: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html) */ - new(properties?: HomeProperties): Home; + new (properties?: HomeProperties): Home; } export const Home: HomeConstructor; @@ -51462,22 +54525,22 @@ declare namespace __esri { interface HomeProperties extends WidgetProperties, GoToProperties { /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [HomeViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewModel) */ viewModel?: HomeViewModelProperties; /** - * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint) */ viewpoint?: ViewpointProperties; @@ -51486,52 +54549,50 @@ declare namespace __esri { interface HomeViewModel extends Accessor, Evented, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | going-home - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view associated with the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#view) */ view: MapView | SceneView; /** - * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint) - * + * * @default null */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#go) - * - * + * + * */ go(): void; } interface HomeViewModelConstructor { - - - new(properties?: HomeViewModelProperties): HomeViewModel; + new (properties?: HomeViewModelProperties): HomeViewModel; } export const HomeViewModel: HomeViewModelConstructor; @@ -51539,18 +54600,18 @@ declare namespace __esri { interface HomeViewModelProperties extends GoToProperties { /** * The view associated with the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; /** - * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint) - * + * * @default null */ viewpoint?: ViewpointProperties; @@ -51559,73 +54620,71 @@ declare namespace __esri { interface LayerList extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#label) */ readonly label: string; /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable properties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. - * + * * [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) */ readonly operationalItems: Collection; /** * Option for enabling status indicators, which indicate whether or not each layer is loading resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#statusIndicatorsVisible) - * + * * @default true */ statusIndicatorsVisible: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#view) */ view: MapView | SceneView; /** * 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 [LayerListViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#viewModel) */ viewModel: LayerListViewModel; /** * *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-LayerList.html#render) - * - * + * + * */ render(): any; /** * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#event:trigger-action) event and executes the given [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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#triggerAction) - * + * * @param action The action to execute. * @param item An item associated with the action. - * + * */ triggerAction(action: ActionButton | ActionToggle, item: ListItem): void; } interface LayerListConstructor { - - - new(properties?: LayerListProperties): LayerList; + new (properties?: LayerListProperties): LayerList; } export const LayerList: LayerListConstructor; @@ -51633,27 +54692,27 @@ declare namespace __esri { interface LayerListProperties extends WidgetProperties { /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable properties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) */ listItemCreatedFunction?: ListItemCreatedHandler; /** * Option for enabling status indicators, which indicate whether or not each layer is loading resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#statusIndicatorsVisible) - * + * * @default true */ statusIndicatorsVisible?: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [LayerListViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#viewModel) */ viewModel?: LayerListViewModelProperties; @@ -51662,47 +54721,45 @@ declare namespace __esri { interface LayerListViewModel extends Accessor { /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable propeties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) */ listItemCreatedFunction: Function; /** * 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-LayerListViewModel.html#operationalItems) */ readonly operationalItems: Collection; /** * The view model's state. **Possible Values:** loading | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#view) */ view: MapView | SceneView; /** * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#event:trigger-action) event and executes the given [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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#triggerAction) - * + * * @param action The action to execute. * @param item An item associated with the action. - * + * */ triggerAction(action: ActionButton | ActionToggle, item: ListItem): void; } interface LayerListViewModelConstructor { - - - new(properties?: LayerListViewModelProperties): LayerListViewModel; + new (properties?: LayerListViewModelProperties): LayerListViewModel; } export const LayerListViewModel: LayerListViewModelConstructor; @@ -51710,13 +54767,13 @@ declare namespace __esri { interface LayerListViewModelProperties { /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable propeties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) */ listItemCreatedFunction?: Function; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -51725,124 +54782,121 @@ declare namespace __esri { interface ListItem { /** * Whether the actional panel is open in the LayerList. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsOpen) - * + * * @default false */ actionsOpen: boolean; /** * A nested 2-dimensional collection of actions that could be triggered on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) */ actionsSections: Collection>; /** * When a layer contains sublayers, this property is a Collection of ListItem objects belonging to the given layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#children) */ children: Collection; /** * The Error object returned if an error occurred. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#error) */ readonly error: Error; /** * The layer associated with the triggered action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layer) - * + * * @default null */ layer: Layer; /** * The [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) displaying data for the associated [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layerView) */ readonly layerView: LayerView; /** * Whether the layer is open in the LayerList. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#open) - * + * * @default false */ open: boolean; /** * Allows you to display custom content for each ListItem in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. A common scenario for using ListItemPanel is to display a [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget within each list item. The `legend` keyword can be used in the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content) property of the panel to display a legend for each layer in the LayerList. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#panel) */ panel: ListItemPanel; /** * The parent of this item - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#parent) - * + * * @default null */ parent: ListItem; /** * The title of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#title) */ title: string; /** * Value is `true` when the layer is updating; for example, if it is in the process of fetching data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#updating) - * + * * @default false */ readonly updating: boolean; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#view) */ view: MapView | SceneView; /** * Indicates how to manage the visibility of the children layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visibilityMode) */ readonly visibilityMode: string; /** * Indicates if the ListItem is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visible) - * + * * @default true */ visible: boolean; /** * Whether the layer is visible at the current scale or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visibleAtCurrentScale) - * + * * @default true */ readonly visibleAtCurrentScale: boolean; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#clone) - * - * + * + * */ clone(): ListItem; } interface ListItemConstructor { - - - - new(): ListItem; + new (): ListItem; } export const ListItem: ListItemConstructor; @@ -51850,49 +54904,49 @@ declare namespace __esri { interface ListItemPanel { /** * Adds a CSS class used to style a node that represents the panel. Clicking the node will open and close the panel. Typically, an icon font is used for this property. [Esri Icon Fonts](https://developers.arcgis.com/javascript/latest/guide/esri-icon-font/index.html) are automatically made available and can be used to represent this content. To use one of these provided icon fonts, you must prefix the class name with `esri-`. For example, the default icon font is `esri-icon-layer-list`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#className) - * + * * @default esri-icon-layer-list */ className: string; /** * The content displayed in the ListItem panel. This can be raw text, a [Widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) instance, an HTML Element, or an array of any of those elements. If the text `legend` is used, then an instance of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget is placed in the content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content) */ 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/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) */ image: string; /** * The panel's parent ListItem that represents a layer in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#listItem) */ listItem: ListItem; /** * Indicates if the panel's content is open and visible to the user. This is different from the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#visible) property, which is used for toggling the visibility of the icon used to control whether the content is expanded or collapsed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#open) - * + * * @default false */ open: boolean; /** * The title of the panel. By default, this title matches the ListItem's title. Changing this value will not change the title of the ListItem in the LayerList. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#title) */ title: string; /** * Indicates if the node containing the [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#image) or [icon font](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#className) is visible to the user. Setting this value to `false` will prevent the user from toggling the visibility of the panel's content. Use [open](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#open) to programmatically set the visibility of the panel's content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#visible) - * + * * @default true */ visible: boolean; @@ -51901,12 +54955,11 @@ declare namespace __esri { interface ListItemPanelConstructor { /** * This class allows you to display custom content for each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html) in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. ListItemPanel objects typically aren't constructed. Rather, they are modified using the [listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) property in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html) */ - - new(): ListItemPanel; + new (): ListItemPanel; } export const ListItemPanel: ListItemPanelConstructor; @@ -51916,43 +54969,43 @@ declare namespace __esri { interface Legend extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#label) */ readonly label: string; /** * Specifies a subset of the layers to display in the legend. If this property is not set, all layers in the map will display in the legend. Objects in this array are defined with the properties listed below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ layerInfos: LegendLayerInfos[]; /** * 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 | 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#view) */ view: MapView | SceneView; /** * *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-Legend.html#render) - * - * + * + * */ render(): any; } @@ -51960,11 +55013,11 @@ declare namespace __esri { interface LegendConstructor { /** * The Legend widget displays labels and symbols for layers in a map. Labels and their corresponding symbols depend on the values set in the [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) of the layer. The legend will only display layers and sublayers that are visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) */ - new(properties?: LegendProperties): Legend; + new (properties?: LegendProperties): Legend; } export const Legend: LegendConstructor; @@ -51972,68 +55025,66 @@ declare namespace __esri { interface LegendProperties extends WidgetProperties { /** * Specifies a subset of the layers to display in the legend. If this property is not set, all layers in the map will display in the legend. Objects in this array are defined with the properties listed below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ layerInfos?: LegendLayerInfos[]; /** * 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 | 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#view) */ view?: MapViewProperties | SceneViewProperties; } - export interface LegendLayerInfos extends Object { /** * Specifies a title for the layer to display above its symbols and descriptions. If no title is specified the service name is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ title?: string; /** * A layer to display in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ layer: Layer; } - export interface LegendStyle extends Object { /** - * Specifies the style of the legend. There are two possible values listed in the table below: - * + * 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. - * + * 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; @@ -52042,89 +55093,89 @@ declare namespace __esri { 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions: any; /** * Indicates whether the widget should navigate the view to the position and scale of the geolocated result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled: boolean; /** * The graphic used to show the user's location on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#graphic) */ graphic: Graphic; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#iconClass) */ iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#label) */ readonly label: string; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#scale) - * + * * @default null */ scale: number; /** * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#useHeadingEnabled) - * + * * @default true */ useHeadingEnabled: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#view) */ view: MapView | SceneView; /** * 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 [LocateViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#viewModel) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#locate) - * - * + * + * */ locate(): IPromise; /** * *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-Locate.html#render) - * - * + * + * */ render(): any; } @@ -52132,11 +55183,11 @@ declare namespace __esri { interface LocateConstructor { /** * Provides a simple widget that animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's current location. The view rotates according to the direction where the tracked device is heading towards. By default the widget looks like the following: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html) */ - new(properties?: LocateProperties): Locate; + new (properties?: LocateProperties): Locate; } export const Locate: LocateConstructor; @@ -52144,57 +55195,57 @@ declare namespace __esri { interface LocateProperties extends WidgetProperties, GoToProperties { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions?: any; /** * Indicates whether the widget should navigate the view to the position and scale of the geolocated result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled?: boolean; /** * The graphic used to show the user's location on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#graphic) */ graphic?: GraphicProperties; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#iconClass) */ iconClass?: string; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#scale) - * + * * @default null */ scale?: number; /** * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#useHeadingEnabled) - * + * * @default true */ useHeadingEnabled?: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [LocateViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#viewModel) */ viewModel?: LocateViewModelProperties; @@ -52203,27 +55254,27 @@ declare namespace __esri { interface LocateViewModel extends Accessor, Evented, GeolocationPositioning, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | locating - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#state) - * + * * @default disabled */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate) - * - * + * + * */ locate(): IPromise; } @@ -52231,73 +55282,71 @@ declare namespace __esri { interface LocateViewModelConstructor { /** * Provides the logic for the [Locate](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html) widget, which animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) */ - new(properties?: LocateViewModelProperties): LocateViewModel; + new (properties?: LocateViewModelProperties): LocateViewModel; } export const LocateViewModel: LocateViewModelConstructor; - interface LocateViewModelProperties extends GeolocationPositioningProperties, GoToProperties { - - } + interface LocateViewModelProperties extends GeolocationPositioningProperties, GoToProperties {} interface NavigationToggle extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#label) */ readonly label: string; /** - * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. - * + * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. + * * Possible Value | Example * ---------------|-------- * 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) - * + * * @default vertical */ layout: string; /** * A reference to the SceneView. Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) */ view: SceneView; /** * 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 [NavigationToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#viewModel) */ viewModel: NavigationToggleViewModel; /** * *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-NavigationToggle.html#render) - * - * + * + * */ render(): any; /** * Toggles the navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) from `pan` to `rotate` or vice versa. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#toggle) - * - * + * + * */ toggle(): void; } @@ -52305,39 +55354,39 @@ declare namespace __esri { interface NavigationToggleConstructor { /** * Provides two simple buttons for toggling the [navigation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Note that this widget is designed only for 3D mouse interaction in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It has no effect on touch navigation and it should not be used with 2D mouse interaction in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html) */ - new(properties?: NavigationToggleProperties): NavigationToggle; + new (properties?: NavigationToggleProperties): NavigationToggle; } export const NavigationToggle: NavigationToggleConstructor; interface NavigationToggleProperties extends WidgetProperties { /** - * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. - * + * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. + * * Possible Value | Example * ---------------|-------- * 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) - * + * * @default vertical */ layout?: string; /** * A reference to the SceneView. Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) */ view?: SceneViewProperties; /** * 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 [NavigationToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#viewModel) */ viewModel?: NavigationToggleViewModelProperties; @@ -52345,40 +55394,40 @@ declare namespace __esri { interface NavigationToggleViewModel extends Accessor { /** - * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. - * + * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------- * pan | The mouse drag gesture pans the view. Right-click + drag allows the user to perform a 3D rotate around the center of the view. * rotate | The mouse drag gesture performs a 3D rotate around the center of the view and the right-click + drag gesture pans the view. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) - * + * * @default pan */ navigationMode: string; /** * The state of the widget. **Possible Values:** disabled | ready - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view associated with the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) */ view: SceneView; /** * Toggles the navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) from `pan` to `rotate` or vice versa. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#toggle) - * - * + * + * */ toggle(): void; } @@ -52386,33 +55435,33 @@ declare namespace __esri { interface NavigationToggleViewModelConstructor { /** * Provides the logic for the [NavigationToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html) widget, which provides two simple buttons for toggling the [navigation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Note that this is not designed for 2D mouse interaction in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), nor for touch navigation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) */ - new(properties?: NavigationToggleViewModelProperties): NavigationToggleViewModel; + new (properties?: NavigationToggleViewModelProperties): NavigationToggleViewModel; } export const NavigationToggleViewModel: NavigationToggleViewModelConstructor; interface NavigationToggleViewModelProperties { /** - * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. - * + * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------- * pan | The mouse drag gesture pans the view. Right-click + drag allows the user to perform a 3D rotate around the center of the view. * rotate | The mouse drag gesture performs a 3D rotate around the center of the view and the right-click + drag gesture pans the view. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) - * + * * @default pan */ navigationMode?: string; /** * The view associated with the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) */ view?: SceneViewProperties; @@ -52421,196 +55470,204 @@ 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/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) */ actions: Collection; /** * Position of the popup in relation to the selected feature. **Possible Values:** auto | top-center | top-right | bottom-left | bottom-center | bottom-right | Function - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#alignment) - * + * * @default "auto" */ alignment: string | Function; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoCloseEnabled) - * + * * @default false */ autoCloseEnabled: boolean; + /** + * This property indicates to the `Popup` that it needs to allow or disallow the click event propagation. Use `view.popup.autoOpenEnabled = false;` when needing to stop the click event propagation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoOpenEnabled) + * + * @default true + */ + autoOpenEnabled: boolean; /** * Indicates whether the popup displays its content. If `true`, only the header displays. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapsed) - * + * * @default false */ collapsed: boolean; /** * Indicates whether to enable collapse functionality for the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapseEnabled) - * + * * @default true */ collapseEnabled: boolean; /** * The content of the popup. When set directly on the Popup, this content is static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) */ content: string | HTMLElement | Widget; /** * Dock position in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). **Possible Values:** top-left | top-center | top-right | bottom-left | bottom-center | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#currentDockPosition) */ readonly currentDockPosition: string; /** * Indicates whether the placement of the popup is docked to the side of the view. Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is attached to a side, the top, or the bottom of the view. See [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) to override default options related to docking the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockEnabled) - * + * * @default false */ dockEnabled: boolean; /** * Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is placed in one of the corners of the view or to the top or bottom of it. This property allows the developer to set various options for docking the popup. See the object specification table below to override default docking properties on the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) */ dockOptions: PopupDockOptions; /** * The number of selected [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) available to the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#featureCount) - * + * * @default 0 */ 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/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) */ featureNavigationEnabled: boolean; /** * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). This value is `null` if no features are associated with the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) - * + * * @default true */ highlightEnabled: boolean; /** * Point used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) */ location: Point; /** * An array of pending Promises that have not yet been fulfilled. If there are no pending promises, the value is `null`. When the pending promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) */ promises: IPromise[]; /** * The selected feature accessed by the popup. The content of the Popup is determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) assigned to this feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) */ readonly selectedFeature: Graphic; /** * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) are set, the first index is automatically selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeatureIndex) */ selectedFeatureIndex: number; /** * Indicates whether to display a spinner at the popup location prior to its display when it has pending promises. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#spinnerEnabled) */ spinnerEnabled: boolean; /** * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) */ title: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#view) */ view: MapView | SceneView; /** * This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PopupViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#viewModel) */ viewModel: PopupViewModel; /** * Indicates whether the popup is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) */ visible: boolean; /** * Use this method to remove focus from the Widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#blur) - * - * + * + * */ blur(): void; /** * Removes [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises), [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features), [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content), [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) and [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) from the Popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#clear) - * - * + * + * */ clear(): void; /** * Closes the popup by setting its [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `false`. Users can alternatively close the popup by directly setting the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#close) - * - * + * + * */ close(): void; /** * Use this method to give focus to the Widget if the widget is able to be focused. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#focus) - * - * + * + * */ focus(): void; /** * Selects the feature at the next index in relation to the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#next) - * - * + * + * */ next(): PopupViewModel; /** * Opens the popup at the given location with content defined either explicitly with `content` or driven from the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) of input features. This method sets the popup's [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `true`. Users can alternatively open the popup by directly setting the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `true`. The popup will only display if the view's size constraints in [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) are met or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) property is set to a geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) - * + * * @param options Defines the location and content of the popup when opened. * @param options.title Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup. * @param options.content Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the popup. @@ -52620,40 +55677,40 @@ declare namespace __esri { * @param options.featureMenuOpen **Since:** 4.5 This property enables multiple features in a popup to display in a list rather than displaying the first selected feature. Setting this to `true` allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. * @param options.updateLocationEnabled When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) geometry. * @param options.collapsed **Since:** 4.5 When `true`, indicates that only the popup header will display. - * + * */ open(options?: PopupOpenOptions): void; /** * Selects the feature at the previous index in relation to the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#previous) - * - * + * + * */ previous(): PopupViewModel; /** * *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-Popup.html#render) - * - * + * + * */ render(): any; /** * Positions the popup on the view. Moves the popup into the view's extent if the popup is partially or fully outside the view's extent. If the popup is partially out of view, the view will move to fully show the popup. If the popup is fully out of view, the view will move to the popup's location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#reposition) - * - * + * + * */ reposition(): void; /** * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event and executes the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) at the specified index in the [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#triggerAction) - * + * * @param actionIndex The index of the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) to execute. - * + * */ triggerAction(actionIndex: number): void; } @@ -52661,11 +55718,11 @@ declare namespace __esri { interface PopupConstructor { /** * The popup widget allows users to view content from feature attributes. Popups enhance web applications by providing users with a simple way to interact with and view attributes in a layer. They play an important role in relaying information to the user, which improves the storytelling capabilities of the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) */ - new(properties?: PopupProperties): Popup; + new (properties?: PopupProperties): Popup; } export const Popup: PopupConstructor; @@ -52673,127 +55730,135 @@ 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/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) */ actions?: CollectionProperties; /** * Position of the popup in relation to the selected feature. **Possible Values:** auto | top-center | top-right | bottom-left | bottom-center | bottom-right | Function - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#alignment) - * + * * @default "auto" */ alignment?: string | Function; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoCloseEnabled) - * + * * @default false */ autoCloseEnabled?: boolean; + /** + * This property indicates to the `Popup` that it needs to allow or disallow the click event propagation. Use `view.popup.autoOpenEnabled = false;` when needing to stop the click event propagation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoOpenEnabled) + * + * @default true + */ + autoOpenEnabled?: boolean; /** * Indicates whether the popup displays its content. If `true`, only the header displays. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapsed) - * + * * @default false */ collapsed?: boolean; /** * Indicates whether to enable collapse functionality for the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapseEnabled) - * + * * @default true */ collapseEnabled?: boolean; /** * The content of the popup. When set directly on the Popup, this content is static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) */ content?: string | HTMLElement | WidgetProperties; /** * Indicates whether the placement of the popup is docked to the side of the view. Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is attached to a side, the top, or the bottom of the view. See [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) to override default options related to docking the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockEnabled) - * + * * @default false */ dockEnabled?: boolean; /** * Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is placed in one of the corners of the view or to the top or bottom of it. This property allows the developer to set various options for docking the popup. See the object specification table below to override default docking properties on the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) */ 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/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) */ featureNavigationEnabled?: boolean; /** * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). This value is `null` if no features are associated with the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) - * + * * @default true */ highlightEnabled?: boolean; /** * Point used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) */ location?: PointProperties; /** * An array of pending Promises that have not yet been fulfilled. If there are no pending promises, the value is `null`. When the pending promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) */ promises?: IPromise[]; /** * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) are set, the first index is automatically selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeatureIndex) */ selectedFeatureIndex?: number; /** * Indicates whether to display a spinner at the popup location prior to its display when it has pending promises. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#spinnerEnabled) */ spinnerEnabled?: boolean; /** * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) */ title?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PopupViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#viewModel) */ viewModel?: PopupViewModelProperties; /** * Indicates whether the popup is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) */ visible?: boolean; @@ -52802,165 +55867,188 @@ 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/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) */ actions: Collection; /** * A collection of [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggles](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) used within the [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-Popup-PopupViewModel.html#allActions) */ readonly allActions: Collection; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoCloseEnabled) - * + * * @default false */ autoCloseEnabled: boolean; + /** + * This property indicates to the `Popup` that it needs to allow or disallow the click event propagation. Use `view.popup.autoOpenEnabled = false;` when needing to stop the click event propagation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoOpenEnabled) + * + * @default true + */ + autoOpenEnabled: boolean; /** * The content of the popup. When set directly on the Popup, this content may only be static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) */ content: string | HTMLElement | Widget; /** * The number of selected [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) available to the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#featureCount) - * + * * @default 0 */ readonly featureCount: number; /** * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the poup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). This value is `null` if no features are associated with the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) - * + * * @default true */ highlightEnabled: boolean; /** * Geometry used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) */ location: Point; /** * The number of [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) remaining to be resolved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#pendingPromisesCount) - * + * * @default 0 */ readonly pendingPromisesCount: number; /** * The number of selected [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) available to the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promiseCount) - * + * * @default 0 */ readonly promiseCount: number; /** * An array of pending Promises that have not yet been fulfilled. If there are no pending Promises, the value is `null`. When the pending Promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) */ promises: IPromise[]; /** * The selected feature accessed by the popup. The content of the Popup is determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) assigned to this feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) */ readonly selectedFeature: Graphic; /** * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) are set, the first index is automatically selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeatureIndex) */ selectedFeatureIndex: number; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) */ title: string; /** * The view associated with the Popup instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#view) */ view: MapView | SceneView; /** * Indicates whether the popup is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) */ visible: boolean; /** * Removes [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises), [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features), [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content), [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) and [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) from the Popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#clear) - * - * + * + * */ clear(): void; /** * Selects the feature at the next index in relation to the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#next) - * - * + * + * */ next(): PopupViewModel; + /** + * Opens the popup at the given location with content defined either explicitly with `content` or driven from the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) of input features. This method sets the popup's [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) property to `true`. Users can alternatively open the popup by directly setting the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) property to `true`. The popup will only display if the view's size constraints in [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#dockOptions) are met or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) property is set to a geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + * + * @param options Defines the location and content of the popup when opened. + * @param options.title Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the popup. + * @param options.content Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) of the popup. + * @param options.location Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location), which is the geometry used to position the popup. + * @param options.features Sets the popup's [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features), which populate the title and content of the popup based on each graphic's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * @param options.promises Sets pending [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) on the popup. The popup will display once the promises resolve. Each promise must resolve to an array of [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. + * @param options.updateLocationEnabled When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) geometry. + * @param options.collapsed **Since:** 4.5 When `true`, indicates that only the popup header will display. + * + */ + open(options?: PopupViewModelOpenOptions): void; /** * Selects the feature at the previous index in relation to the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#previous) - * - * + * + * */ previous(): PopupViewModel; /** * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event and executes the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) at the specified index in the [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#triggerAction) - * + * * @param actionIndex The index of the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) to execute. - * + * */ triggerAction(actionIndex: number): void; - on(name: "trigger-action", eventHandler: PopupViewModelTriggerActionEventHandler): IHandle; } interface PopupViewModelConstructor { /** * Provides the logic for the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) widget, which allows users to view content from feature attributes. Popups enhance web applications by providing users with a simple way to interact with and view attributes in a layer. They play an important role in relaying information to the user, which improves the storytelling capabilities of the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) */ - new(properties?: PopupViewModelProperties): PopupViewModel; + new (properties?: PopupViewModelProperties): PopupViewModel; } export const PopupViewModel: PopupViewModelConstructor; @@ -52968,100 +56056,155 @@ 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/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) */ actions?: CollectionProperties; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoCloseEnabled) - * + * * @default false */ autoCloseEnabled?: boolean; + /** + * This property indicates to the `Popup` that it needs to allow or disallow the click event propagation. Use `view.popup.autoOpenEnabled = false;` when needing to stop the click event propagation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoOpenEnabled) + * + * @default true + */ + autoOpenEnabled?: boolean; /** * The content of the popup. When set directly on the Popup, this content may only be static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) */ content?: string | HTMLElement | WidgetProperties; /** * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the poup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). This value is `null` if no features are associated with the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) - * + * * @default true */ highlightEnabled?: boolean; /** * Geometry used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) */ location?: PointProperties; /** * An array of pending Promises that have not yet been fulfilled. If there are no pending Promises, the value is `null`. When the pending Promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) */ promises?: IPromise[]; /** * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) are set, the first index is automatically selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeatureIndex) */ selectedFeatureIndex?: number; /** * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) */ title?: string; /** * The view associated with the Popup instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * Indicates whether the popup is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) */ visible?: boolean; } - export interface PopupViewModelTriggerActionEvent { - - action: ActionButton | ActionToggle; + export interface PopupViewModelOpenOptions extends Object { + /** + * Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + title?: string; + /** + * Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) of the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + content?: string; + /** + * Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location), which is the geometry used to position the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + location?: Geometry; + /** + * Sets the popup's [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features), which populate the title and content of the popup based on each graphic's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + features?: Graphic[]; + /** + * Sets pending [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) on the popup. The popup will display once the promises resolve. Each promise must resolve to an array of [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + promises?: IPromise[]; + /** + * When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + * + * @default false + */ + updateLocationEnabled?: boolean; + /** + * **Since:** 4.5 When `true`, indicates that only the popup header will display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + * + * @default false + */ + collapsed?: boolean; } + export interface PopupViewModelTriggerActionEvent { + action: ActionButton | ActionToggle; + } export interface PopupDockOptions extends Object { /** * Defines the dimensions of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which to dock the popup. Set to `false` to disable docking at a breakpoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) - * + * * @default true */ breakpoint?: boolean | PopupDockOptionsBreakpoint; /** * If `true`, displays the dock button. If `false`, hides the dock button from the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) */ buttonEnabled?: boolean; /** - * The position in the view at which to dock the popup. Can be set as either a string or function. See the table below for known string values and their position in the view based on the view's size. - * + * The position in the view at which to dock the popup. Can be set as either a string or function. See the table below for known string values and their position in the view based on the view's size. + * * Known Value | View size > breakpoint | View size < breakpoint * --------------- | ------------------------------- | ------------- * auto | top-right | bottom 100% @@ -53071,88 +56214,86 @@ declare namespace __esri { * bottom-left | bottom-left | bottom 100% * bottom-center | bottom-center | bottom 100% * bottom-right | bottom-right | bottom 100% - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) - * + * * @default auto */ position?: string | Function; } - export interface PopupDockOptionsBreakpoint extends Object { /** * The maximum width of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which the popup will be set to dockEnabled automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) - * + * * @default 544 */ width?: number; /** * The maximum height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which the popup will be set to dockEnabled automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) - * + * * @default 544 */ height?: number; } - export interface PopupOpenOptions extends Object { /** * Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ title?: string; /** * Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ content?: string | HTMLElement | Widget; /** * Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location), which is the geometry used to position the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ location?: Geometry; /** * Sets the popup's [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features), which populate the title and content of the popup based on each graphic's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ features?: Graphic[]; /** * Sets pending [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) on the popup. The popup will display once the promises resolve. Each promise must resolve to an array of [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ promises?: IPromise[]; /** * **Since:** 4.5 This property enables multiple features in a popup to display in a list rather than displaying the first selected feature. Setting this to `true` allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) - * + * * @default false */ featureMenuOpen?: boolean; /** * When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) - * + * * @default false */ updateLocationEnabled?: boolean; /** * **Since:** 4.5 When `true`, indicates that only the popup header will display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) - * + * * @default false */ collapsed?: boolean; @@ -53161,47 +56302,47 @@ declare namespace __esri { interface Print extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#label) */ readonly label: string; /** * The URL of the REST endpoint of the Export Web Map Task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#printServiceUrl) */ printServiceUrl: string; /** * Defines the layout template options used by the [Print](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) widget to generate the print page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#templateOptions) */ templateOptions: TemplateOptions; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#view) */ view: MapView; /** * 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 [PrintViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#viewModel) */ viewModel: PrintViewModel; /** * *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-Print.html#render) - * - * + * + * */ render(): any; } @@ -53209,11 +56350,11 @@ declare namespace __esri { interface PrintConstructor { /** * The Print widget connects your application with a [printing service](https://server.arcgis.com/en/portal/latest/administer/windows/configure-the-portal-to-print-maps.htm) to allow the map to be printed. It takes advantage of server-side, high-quality, full cartographic print functionality using the ExportWebMap service of ArcGIS, which can be configured with custom layout templates. One is provided that shows the map only, while another provides a layout with legend, etc. The Print widget works with the [PrintTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html) which generates a printer-ready version of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) */ - new(properties?: PrintProperties): Print; + new (properties?: PrintProperties): Print; } export const Print: PrintConstructor; @@ -53221,25 +56362,25 @@ declare namespace __esri { interface PrintProperties extends WidgetProperties { /** * The URL of the REST endpoint of the Export Web Map Task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#printServiceUrl) */ printServiceUrl?: string; /** * Defines the layout template options used by the [Print](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) widget to generate the print page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#templateOptions) */ templateOptions?: TemplateOptionsProperties; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#view) */ view?: MapViewProperties; /** * 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 [PrintViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#viewModel) */ viewModel?: PrintViewModelProperties; @@ -53248,40 +56389,38 @@ declare namespace __esri { interface PrintViewModel extends Accessor { /** * The URL of the REST endpoint of the Export Web Map Task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#printServiceUrl) */ printServiceUrl: string; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#updateDelay) - * + * * @default 1000 */ updateDelay: number; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#view) */ view: MapView; /** * Prints (exports) the current MapView according to selected options. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#print) - * + * * @param printTemplate The [PrintTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html) is used to specify the layout template options which is then used by the PrintTask to generate the print page. - * + * */ print(printTemplate: PrintTemplate): IPromise; } interface PrintViewModelConstructor { - - - new(properties?: PrintViewModelProperties): PrintViewModel; + new (properties?: PrintViewModelProperties): PrintViewModel; } export const PrintViewModel: PrintViewModelConstructor; @@ -53289,21 +56428,21 @@ declare namespace __esri { interface PrintViewModelProperties { /** * The URL of the REST endpoint of the Export Web Map Task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#printServiceUrl) */ printServiceUrl?: string; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#updateDelay) - * + * * @default 1000 */ updateDelay?: number; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#view) */ view?: MapViewProperties; @@ -53312,57 +56451,57 @@ declare namespace __esri { interface TemplateOptions extends Accessor { /** * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#attributionEnabled) - * + * * @default true */ attributionEnabled: boolean; /** * The text used for the author if the specified layout contains an author text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#author) */ author: string; /** * The text used for the copyright if the specified layout contains an copyright text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#copyright) */ copyright: string; /** * Resolution in dots per inch. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#dpi) - * + * * @default 96 */ dpi: string; /** * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#forceFeatureAttributes) - * + * * @default false */ forceFeatureAttributes: boolean; /** * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#format) - * + * * @default pdf */ format: string; /** * Map height. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#height) */ height: number; /** * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: - * + * * Value | Description * | --- | --- * map-only | Map does not contain any layout elements. Only map image is printed. @@ -53374,47 +56513,45 @@ declare namespace __esri { * letter-ansi-a-portrait | Letter ANSI A Portrait * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) - * + * * @default letter-ansi-a-landscape */ layout: string; /** * When `false`, the legend is not displayed on the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * When `true`, scale is used in the printed map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#scaleEnabled) - * + * * @default false */ scaleEnabled: boolean; /** * The text used for the map title if the specified layout contains a title text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#title) */ title: string; /** * Map width. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#width) */ width: number; } interface TemplateOptionsConstructor { - - - new(properties?: TemplateOptionsProperties): TemplateOptions; + new (properties?: TemplateOptionsProperties): TemplateOptions; } export const TemplateOptions: TemplateOptionsConstructor; @@ -53422,57 +56559,57 @@ declare namespace __esri { interface TemplateOptionsProperties { /** * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#attributionEnabled) - * + * * @default true */ attributionEnabled?: boolean; /** * The text used for the author if the specified layout contains an author text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#author) */ author?: string; /** * The text used for the copyright if the specified layout contains an copyright text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#copyright) */ copyright?: string; /** * Resolution in dots per inch. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#dpi) - * + * * @default 96 */ dpi?: string; /** * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#forceFeatureAttributes) - * + * * @default false */ forceFeatureAttributes?: boolean; /** * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#format) - * + * * @default pdf */ format?: string; /** * Map height. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#height) */ height?: number; /** * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: - * + * * Value | Description * | --- | --- * map-only | Map does not contain any layout elements. Only map image is printed. @@ -53484,38 +56621,38 @@ declare namespace __esri { * letter-ansi-a-portrait | Letter ANSI A Portrait * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) - * + * * @default letter-ansi-a-landscape */ layout?: string; /** * When `false`, the legend is not displayed on the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * When `true`, scale is used in the printed map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#scaleEnabled) - * + * * @default false */ scaleEnabled?: boolean; /** * The text used for the map title if the specified layout contains a title text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#title) */ title?: string; /** * Map width. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#width) */ width?: number; @@ -53524,37 +56661,37 @@ declare namespace __esri { interface ScaleBar extends Widget { /** * The style for the scale bar. When `unit` is set to `dual`, the style will always be `line`. **Possible Values:** ruler | line - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style) */ style: string; /** - * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. **Possible Values:** non-metric | metric | dual - * + * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values show either kilometers or meters depending on the scale, and non-metric values show either miles or feet depending on the scale. **Possible Values:** non-metric | metric | dual + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) - * - * @default non-metric (i.e. miles and feet) + * + * @default non-metric */ unit: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#view) */ view: MapView; /** * 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 [ScaleBarViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#viewModel) */ viewModel: ScaleBarViewModel; /** * *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-ScaleBar.html#render) - * - * + * + * */ render(): any; } @@ -53562,11 +56699,11 @@ declare namespace __esri { interface ScaleBarConstructor { /** * The ScaleBar widget displays a scale bar on the map or in a specified HTML node. The widget respects various coordinate systems and displays units in metric or non-metric values. Metric values shows either kilometers or meters depending on the scale, and likewise non-metric values shows miles and feet depending on the scale. When working with Web Mercator or geographic coordinate systems the scale bar takes into account projection distortion and dynamically adjusts the scale bar. The ScaleBar sample, which uses a map using the Web Mercator projection, shows this behavior. Open the sample and note that as you pan the map south towards the equator the scale bar gets shorter and as you pan north it gets longer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html) */ - new(properties?: ScaleBarProperties): ScaleBar; + new (properties?: ScaleBarProperties): ScaleBar; } export const ScaleBar: ScaleBarConstructor; @@ -53574,27 +56711,27 @@ declare namespace __esri { interface ScaleBarProperties extends WidgetProperties { /** * The style for the scale bar. When `unit` is set to `dual`, the style will always be `line`. **Possible Values:** ruler | line - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style) */ style?: string; /** - * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. **Possible Values:** non-metric | metric | dual - * + * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values show either kilometers or meters depending on the scale, and non-metric values show either miles or feet depending on the scale. **Possible Values:** non-metric | metric | dual + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) - * - * @default non-metric (i.e. miles and feet) + * + * @default non-metric */ unit?: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#view) */ view?: MapViewProperties; /** * 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 [ScaleBarViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#viewModel) */ viewModel?: ScaleBarViewModelProperties; @@ -53603,16 +56740,14 @@ declare namespace __esri { interface ScaleBarViewModel extends Accessor { /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html#view) */ view: MapView; } interface ScaleBarViewModelConstructor { - - - new(properties?: ScaleBarViewModelProperties): ScaleBarViewModel; + new (properties?: ScaleBarViewModelProperties): ScaleBarViewModel; } export const ScaleBarViewModel: ScaleBarViewModelConstructor; @@ -53620,7 +56755,7 @@ declare namespace __esri { interface ScaleBarViewModelProperties { /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html#view) */ view?: MapViewProperties; @@ -53629,238 +56764,239 @@ 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 [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: FeatureLayerSearchSource | LocatorSearchSource; /** * The selected source's index. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSourceIndex) - * + * * @default 0 */ 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/assets/img/apiref/widgets/search-allplaceholder.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allPlaceholder) - * + * * @default "Find address or place" */ allPlaceholder: string; /** * 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.html#event:search-complete) event handler and get the results through the event object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#autoSelect) - * + * * @default true */ autoSelect: boolean; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#iconClass) */ readonly iconClass: string; /** * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#includeDefaultSources) - * + * * @default true */ includeDefaultSources: boolean | Function; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#label) */ readonly label: string; /** - * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/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) - * + * * @default true */ locationEnabled: boolean; /** * The maximum number of results returned by the widget if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxResults) - * + * * @default 6 */ maxResults: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions: number; /** * The minimum number of characters needed for the search if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#minSuggestCharacters) - * + * * @default 1 */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupEnabled) - * + * * @default true */ popupEnabled: 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) - * + * * @default null */ popupTemplate: PopupTemplate; /** * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#portal) */ 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) */ readonly resultGraphic: Graphic; /** * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) will display at the location of the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphicEnabled) - * + * * @default true */ resultGraphicEnabled: boolean; /** * An array of objects, each containing a [SearchResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) from the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#results) */ 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/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) - * + * * @default true */ searchAllEnabled: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchTerm) */ searchTerm: string; /** * The result selected from a search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#selectedResult) */ 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: + * 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: * * [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 these sources may be used together in the same instance of the Search widget. - * + * > Feature layers created from client-side graphics are not supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ 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 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 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) - * + * * @default true */ suggestionsEnabled: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) */ view: MapView | SceneView; /** * 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 [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#viewModel) */ viewModel: SearchViewModel; /** * Unfocuses the widget's text input. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#blur) - * - * + * + * */ blur(): void; /** * Clears the current searchTerm, search results, suggest results, graphic, and graphics layer. It also hides any open menus. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#clear) - * - * + * + * */ clear(): void; /** * Brings focus to the widget's text input. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#focus) - * - * + * + * */ focus(): void; /** * *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-Search.html#render) - * - * + * + * */ render(): any; /** * Depending on the sources specified, search() queries the feature layer(s) and/or performs address matching using any specified [Locator(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and returns any applicable results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search) - * + * * @param searchTerm This searchTerm can be a string, geometry, suggest candidate object, or an array of [longitude,latitude] coordinate pairs. If a geometry is supplied, then it will reverse geocode (locator) or findAddressCandidates with geometry instead of text. - * + * */ 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 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) - * + * * @param value The string value used to suggest() on an active Locator or feature layer. If nothing is passed in, takes the current value of the widget. - * + * */ suggest(value?: string): IPromise; } @@ -53868,11 +57004,11 @@ declare namespace __esri { interface widgetsSearchConstructor { /** * The Search widget provides a way to perform search operations on [locator service(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and/or [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html)/[feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) service feature layer(s). If using a locator with a geocoding service, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation is used, whereas [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) are used on feature layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) */ - new(properties?: widgetsSearchProperties): widgetsSearch; + new (properties?: widgetsSearchProperties): widgetsSearch; } export const widgetsSearch: widgetsSearchConstructor; @@ -53880,141 +57016,142 @@ declare namespace __esri { interface widgetsSearchProperties extends WidgetProperties, GoToProperties { /** * The selected source's index. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSourceIndex) - * + * * @default 0 */ 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/assets/img/apiref/widgets/search-allplaceholder.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allPlaceholder) - * + * * @default "Find address or place" */ allPlaceholder?: string; /** * 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.html#event:search-complete) event handler and get the results through the event object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#autoSelect) - * + * * @default true */ autoSelect?: boolean; /** * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#includeDefaultSources) - * + * * @default true */ includeDefaultSources?: boolean | Function; /** - * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/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) - * + * * @default true */ locationEnabled?: boolean; /** * The maximum number of results returned by the widget if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxResults) - * + * * @default 6 */ maxResults?: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions?: number; /** * The minimum number of characters needed for the search if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#minSuggestCharacters) - * + * * @default 1 */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupEnabled) - * + * * @default true */ popupEnabled?: 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) - * + * * @default null */ popupTemplate?: PopupTemplateProperties; /** * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#portal) */ portal?: PortalProperties; /** * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) will display at the location of the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphicEnabled) - * + * * @default true */ 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/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) - * + * * @default true */ searchAllEnabled?: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchTerm) */ 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: + * 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: * * [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 these sources may be used together in the same instance of the Search widget. - * + * > Feature layers created from client-side graphics are not supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ sources?: CollectionProperties; /** * 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) - * + * * @default true */ suggestionsEnabled?: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#viewModel) */ viewModel?: SearchViewModelProperties; @@ -54023,63 +57160,68 @@ declare namespace __esri { 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**. - * + * > Feature layers created from client-side graphics are not supported. + * * [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 { + /** + * 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 a [Search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) widget instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + */ - - new(properties?: FeatureLayerSearchSourceProperties): FeatureLayerSearchSource; + new (properties?: FeatureLayerSearchSourceProperties): FeatureLayerSearchSource; fromJSON(json: any): FeatureLayerSearchSource; } @@ -54089,45 +57231,46 @@ declare namespace __esri { 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**. - * + * > Feature layers created from client-side graphics are not supported. + * * [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; @@ -54136,69 +57279,67 @@ declare namespace __esri { 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; + new (properties?: LocatorSearchSourceProperties): LocatorSearchSource; fromJSON(json: any): LocatorSearchSource; } @@ -54208,188 +57349,234 @@ declare namespace __esri { 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 SearchResultRenderer extends Widget { + /** + * Indicates whether to display the `Show more results` link within the search result's popup. A value of `true` will not display the link in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#showMoreResultsOpen) + * + * @default false + */ + showMoreResultsOpen: boolean; + /** + * 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 [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#viewModel) + */ + viewModel: SearchViewModel; + + /** + * *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-Search-SearchResultRenderer.html#render) + * + * + */ + render(): any; + } + + interface SearchResultRendererConstructor { + new (properties?: SearchResultRendererProperties): SearchResultRenderer; + } + + export const SearchResultRenderer: SearchResultRendererConstructor; + + interface SearchResultRendererProperties extends WidgetProperties { + /** + * Indicates whether to display the `Show more results` link within the search result's popup. A value of `true` will not display the link in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#showMoreResultsOpen) + * + * @default false + */ + showMoreResultsOpen?: boolean; + /** + * 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 [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#viewModel) + */ + viewModel?: SearchViewModelProperties; + } + 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`. + * 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; + new (properties?: SearchSourceProperties): SearchSource; fromJSON(json: any): SearchSource; } @@ -54399,126 +57586,125 @@ declare namespace __esri { 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`. + * 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; @@ -54527,272 +57713,273 @@ declare namespace __esri { 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: FeatureLayerSearchSource | LocatorSearchSource; /** * The selected source's index. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSourceIndex) - * + * * @default 0 */ 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/assets/img/apiref/widgets/search-allplaceholder.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allPlaceholder) - * + * * @default "Find address or place" */ allPlaceholder: string; /** * The combined collection of [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) and [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). The [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) displays first in the Search UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allSources) */ 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#autoSelect) - * + * * @default true */ autoSelect: boolean; /** * 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; /** * The default [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the search result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSymbol) - * + * * @default PictureMarkerSymbol */ defaultSymbol: Symbol; /** * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#includeDefaultSources) - * + * * @default true */ includeDefaultSources: boolean | Function; /** - * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/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) */ locationEnabled: boolean; /** * The maximum character length of the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxInputLength) - * + * * @default 128 */ maxInputLength: number; /** * The maximum number of results returned by the widget if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults) - * + * * @default 6 */ maxResults: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions: number; /** * The minimum number of characters needed for the search if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#minSuggestCharacters) - * + * * @default 1 */ minSuggestCharacters: number; /** * The placeholder used by the [activeSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSource). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#placeholder) */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) - * + * * @default true */ popupEnabled: 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupTemplate) - * + * * @default null */ popupTemplate: PopupTemplate; /** * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#portal) */ portal: Portal; /** * The graphic used to highlight the resulting feature or location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) - * + * * @default null */ 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) - * + * * @default true */ resultGraphicEnabled: boolean; /** * An array of current results from the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#results) - * + * * @default null */ 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/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) - * + * * @default true */ searchAllEnabled: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchTerm) */ searchTerm: string; /** * The result selected from a search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#selectedResult) - * + * * @default null */ readonly selectedResult: any; /** * The selected SuggestResult. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#selectedSuggestion) - * + * * @default null */ 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: + * 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: * * [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 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; /** - * 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 - * + * 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 | loading + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#state) - * + * * @default ready */ readonly state: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionDelay) - * + * * @default 150 */ 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 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) - * + * * @default null */ readonly suggestions: SearchViewModelSuggestResult[]; /** * 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) - * + * * @default true */ suggestionsEnabled: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) - * + * * @default null */ view: MapView | SceneView; /** * Clears the current value, search results, suggest results, graphic, and graphics layer. It also hides any open menus. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#clear) - * - * + * + * */ clear(): void; /** * Depending on the sources specified, `search()` queries the feature layer(s) and/or performs address matching using any specified [Locator(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and returns the applicable results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search) - * + * * @param searchTerm This searchTerm can be a string, geometry, suggest candidate object, or an array of [latitude,longitude]. If a geometry is supplied, then it will reverse geocode (locator) or findAddressCandidates with geometry instead of text (featurelayer). - * + * */ - search(searchTerm?: string | Geometry | SearchViewModelSuggestResult | number[][]): IPromise; + search( + searchTerm?: string | Geometry | SearchViewModelSuggestResult | number[][] + ): IPromise; /** * Returns search results near your current location. It checks whether [locationEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) is `true`. If so, and your browser supports [geolocation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation), it will return search results nearby your current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchNearby) - * - * + * + * */ 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 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) - * + * * @param value The string value used to suggest() on an active Locator or feature layer. If nothing is passed in, takes the current value of the widget. - * + * */ suggest(value?: string): IPromise; - on(name: "search-clear", eventHandler: SearchViewModelSearchClearEventHandler): IHandle; on(name: "search-start", eventHandler: SearchViewModelSearchStartEventHandler): IHandle; @@ -54807,9 +57994,7 @@ declare namespace __esri { } interface SearchViewModelConstructor { - - - new(properties?: SearchViewModelProperties): SearchViewModel; + new (properties?: SearchViewModelProperties): SearchViewModel; } export const SearchViewModel: SearchViewModelConstructor; @@ -54817,170 +58002,168 @@ declare namespace __esri { interface SearchViewModelProperties extends GoToProperties { /** * The selected source's index. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSourceIndex) - * + * * @default 0 */ 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/assets/img/apiref/widgets/search-allplaceholder.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allPlaceholder) - * + * * @default "Find address or place" */ allPlaceholder?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#autoSelect) - * + * * @default true */ autoSelect?: boolean; /** * The default [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the search result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSymbol) - * + * * @default PictureMarkerSymbol */ defaultSymbol?: SymbolProperties; /** * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#includeDefaultSources) - * + * * @default true */ includeDefaultSources?: boolean | Function; /** - * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/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) */ locationEnabled?: boolean; /** * The maximum character length of the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxInputLength) - * + * * @default 128 */ maxInputLength?: number; /** * The maximum number of results returned by the widget if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults) - * + * * @default 6 */ maxResults?: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions?: number; /** * The minimum number of characters needed for the search if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#minSuggestCharacters) - * + * * @default 1 */ 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). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) - * + * * @default true */ popupEnabled?: 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupTemplate) - * + * * @default null */ popupTemplate?: PopupTemplateProperties; /** * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#portal) */ 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) - * + * * @default true */ 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/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) - * + * * @default true */ searchAllEnabled?: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchTerm) */ 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: + * 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: * * [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 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; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionDelay) - * + * * @default 150 */ suggestionDelay?: number; /** * 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) - * + * * @default true */ suggestionsEnabled?: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) - * + * * @default null */ view?: MapViewProperties | SceneViewProperties; } - export interface SearchViewModelSearchClearEvent { - } + export interface SearchViewModelSearchClearEvent {} export interface SearchViewModelSearchCompleteEvent { - activeSourceIndex: number; errors: Error[]; @@ -54994,37 +58177,37 @@ declare namespace __esri { /** * When resolved, returns this response after calling [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ export interface SearchViewModelSearchResponse extends Object { /** * The index of the source from which the search result was obtained. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ activeSourceIndex: number; /** * An array of error objects returned from the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ errors: Error[]; /** * The number of search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ numResults: number; /** * The searched expression - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ searchTerm: string; /** * An array of objects representing the results of search. See object specification table below for more information about the result object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ results: SearchViewModelSearchResponseResults[]; @@ -55032,35 +58215,33 @@ declare namespace __esri { /** * The result object returned from the [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) */ export interface SearchViewModelSearchResult extends Object { /** * The extent, or bounding box, of the returned feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) */ extent: Extent; /** * The resulting feature or location obtained from the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) */ feature: Graphic; /** * The name of the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) */ name: string; } - export interface SearchViewModelSearchStartEvent { - } + export interface SearchViewModelSearchStartEvent {} export interface SearchViewModelSelectResultEvent { - result: SearchViewModelSelectResultEventResult; source: any; @@ -55069,7 +58250,6 @@ declare namespace __esri { } export interface SearchViewModelSuggestCompleteEvent { - activeSourceIndex: number; errors: Error[]; @@ -55082,38 +58262,38 @@ declare namespace __esri { } /** - * When resolved, returns this reponse after calling [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). - * + * When resolved, returns this response after calling [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ export interface SearchViewModelSuggestResponse extends Object { /** * The index of the source from which suggestions are obtained. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ activeSourceIndex: number; /** * An array of error objects returned from the suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ errors: Error[]; /** * The number of suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ numResults: number; /** * The search expression used for the suggest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ searchTerm: string; /** * An array of objects representing the results of suggest. See object specification table below for more information about the result object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ results: SearchViewModelSuggestResponseResults[]; @@ -55121,36 +58301,33 @@ declare namespace __esri { /** * The result object returned from a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) */ export interface SearchViewModelSuggestResult extends Object { /** * The key related to the suggest result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) */ key: string; /** * The string name of the suggested location to geocode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) */ text: string; /** * The index of the currently selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) */ sourceIndex: number; } - export interface SearchViewModelSuggestStartEvent { - } - + export interface SearchViewModelSuggestStartEvent {} export interface SearchViewModelSearchCompleteEventResults extends Object { - results: SearchResult[]; sourceIndex: number; @@ -55158,31 +58335,28 @@ declare namespace __esri { source: any[]; } - export interface SearchViewModelSearchResponseResults extends Object { /** * An array of search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ results: SearchViewModelSearchResult[]; /** * The index of the currently selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ sourceIndex: number; /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) of the selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ source: any; } - export interface SearchViewModelSelectResultEventResult extends Object { - extent: Extent; feature: Graphic; @@ -55190,9 +58364,7 @@ declare namespace __esri { name: string; } - export interface SearchViewModelSuggestCompleteEventResults extends Object { - results: SearchViewModelSuggestResult[]; sourceIndex: number; @@ -55200,23 +58372,22 @@ declare namespace __esri { source: any; } - export interface SearchViewModelSuggestResponseResults extends Object { /** * An array of suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ results: SearchViewModelSuggestResult[]; /** * The index of the currently selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ sourceIndex: number; /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) of the selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ source: any; @@ -55224,37 +58395,37 @@ declare namespace __esri { /** * When resolved, returns this response after calling [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ export interface SearchResponse extends Object { /** * The index of the source from which the search result was obtained. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ activeSourceIndex: number; /** * An array of error objects returned from the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ errors: Error[]; /** * The number of search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ numResults: number; /** * The searched expression - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ searchTerm: string; /** * An array of objects representing the results of search. See object specification table below for more information about the result object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ results: SearchResponseResults[]; @@ -55262,25 +58433,25 @@ declare namespace __esri { /** * The result object returned from a [search()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) */ export interface SearchResult extends Object { /** * The extent, or bounding box, of the returned feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) */ extent: Extent; /** * The resulting feature or location obtained from the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) */ feature: Graphic; /** * The name of the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) */ name: string; @@ -55288,37 +58459,37 @@ declare namespace __esri { /** * When resolved, returns this response after calling [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ export interface SuggestResponse extends Object { /** * The index of the source from which suggestions are obtained. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ activeSourceIndex: number; /** * An array of error objects returned from the suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ errors: Error[]; /** * The number of suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ numResults: number; /** * The search expression used for the suggest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ searchTerm: string; /** * An array of objects representing the results of suggest. See object specification table below for more information about the result object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ results: SuggestResponseResults[]; @@ -55326,69 +58497,67 @@ declare namespace __esri { /** * The result object returned from a [suggest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) */ export interface SuggestResult extends Object { /** * The key related to the suggest result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) */ key: string; /** * The string name of the suggested location to geocode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) */ text: string; /** * The index of the currently selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) */ sourceIndex: number; } - export interface SearchResponseResults extends Object { /** * An array of search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ results: SearchResult[]; /** * The index of the currently selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ sourceIndex: number; /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) of the selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ source: any; } - export interface SuggestResponseResults extends Object { /** * An array of suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ results: SuggestResult[]; /** * The index of the currently selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ sourceIndex: number; /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) of the selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ source: any; @@ -55397,116 +58566,116 @@ declare namespace __esri { interface SizeSlider extends Accessor, Widgette { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#handlesVisible) - * + * * @default true */ handlesVisible: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) */ histogram: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramVisible) - * + * * @default true */ histogramVisible: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The size in points or pixels with which features will be represented at or above the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxSize) */ readonly maxSize: number; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) */ maxValue: number; /** * The size in points or pixels with which features will be represented at or below the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minSize) */ readonly minSize: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) */ minValue: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ statistics: SizeSliderStatistics; /** * Indicates whether to show the average value of features in the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible: boolean; /** * The symbol on the slider representing the features in the view. This symbol type should match the symbol type of the appropriate features. This can be an instance of [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), which is the default value, or [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#symbol) */ symbol: SimpleMarkerSymbol | SimpleLineSymbol; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#ticksVisible) - * + * * @default true */ ticksVisible: boolean; /** - * Represents the data values corresponding to the handles on the slider. It is an array of numbers indicating the `minDataValue` and the `maxDataValue` of the [visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) represented by the slider. - * + * Represents the data values corresponding to the handles on the slider. It is an array of numbers indicating the `minDataValue` and the `maxDataValue` of the [visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) represented by the slider. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) */ readonly values: number[]; /** * The size visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the sizeRendererCreator helper methods. A new size visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) */ - visualVariable: SizeVisualVariable; + visualVariable: SizeVariable; } interface SizeSliderConstructor { /** * The SizeSlider is a widget intended for authoring and exploring data-driven visualizations 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) using the size of marker symbols or 3D object symbol layers. To display properly, this slider requires a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) and [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) object. Other optional properties may be used including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html) */ - new(properties?: SizeSliderProperties): SizeSlider; + new (properties?: SizeSliderProperties): SizeSlider; } export const SizeSlider: SizeSliderConstructor; @@ -55514,122 +58683,328 @@ declare namespace __esri { interface SizeSliderProperties extends WidgetteProperties { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#handlesVisible) - * + * * @default true */ handlesVisible?: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) */ histogram?: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramVisible) - * + * * @default true */ histogramVisible?: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth?: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) */ maxValue?: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) */ minValue?: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ statistics?: SizeSliderStatistics; /** * Indicates whether to show the average value of features in the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible?: boolean; /** * The symbol on the slider representing the features in the view. This symbol type should match the symbol type of the appropriate features. This can be an instance of [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), which is the default value, or [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#symbol) */ symbol?: SimpleMarkerSymbolProperties | SimpleLineSymbolProperties; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#ticksVisible) - * + * * @default true */ ticksVisible?: boolean; /** * The size visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the sizeRendererCreator helper methods. A new size visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) */ - visualVariable?: SizeVisualVariable; + visualVariable?: SizeVariableProperties; } - export interface SizeSliderStatistics extends Object { /** * The average of all data values represented in the size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ avg?: number; /** * The maximum of all data values represented in the size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ max: number; /** * The minimum of all data values represented in the size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ min: number; } + interface Sketch extends Widget { + /** + * Returns the name of the active tool associated with the Sketch widget instance. **Possible Values:** point | polyline | polygon | circle | rectangle | move | transform | reshape + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#activeTool) + */ + readonly activeTool: string; + /** + * The graphic that is being created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#createGraphic) + */ + readonly createGraphic: Graphic; + /** + * The Sketch widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#iconClass) + */ + readonly iconClass: string; + /** + * The [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) associated with the Sketch widget. The Sketch widget adds new [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) to this layer or can only update graphics stored in this layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer) + */ + layer: GraphicsLayer; + /** + * Determines the layout/orientation of the Sketch widget. **Possible Values:** vertical | horizontal + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layout) + * + * @default horizontal + */ + layout: string; + /** + * The Sketch widget's state. **Possible Values:** ready | disabled | active + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#state) + */ + readonly state: string; + /** + * An array of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) that are being updated by the Sketch widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#updateGraphics) + */ + readonly updateGraphics: Collection; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the Sketch widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#view) + */ + view: MapView; + /** + * The view model for the Sketch widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SketchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) class to access all properties and methods on the Sketch widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#viewModel) + */ + viewModel: SketchViewModel; + /** + * The Sketch widget's default label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#widgetLabel) + */ + readonly widgetLabel: string; + + /** + * Cancels the active operation and fires the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event and changes the event's state to `cancel`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#cancel) + * + * + */ + cancel(): void; + /** + * Completes the active operation and fires the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event and changes the event's state to `complete`. If called in midst of create operation, `complete()` finishes the active create operation and keeps the valid geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#complete) + * + * + */ + complete(): void; + /** + * Create a graphic with a geometry specified in `tool`. When first vertex of the graphic is added, [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) event will start firing. **Note:** Creating a circle geometry does not work in all spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#create) + * + * @param tool Name of the create tool. Specifies the geometry type for the graphic to be created. **Possible Values:** point | polyline | polygon | rectangle | circle + * @param createOptions Options for the graphic to be created. + * @param createOptions.mode + * Specifies how the graphic can be created. The create mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. + * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. + * click | Vertices are added when the pointer is clicked. + * + */ + create(tool: string, createOptions?: SketchCreateCreateOptions): 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.html#event:redo) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#redo) + * + * + */ + redo(): void; + /** + * *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-Sketch.html#render) + * + * + */ + render(): any; + /** + * Resets the Sketch widget to prepare for another create operation. Reset discards the current sketch, if called in middle of create operation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#reset) + * + * + */ + 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.html#event:undo) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#undo) + * + * + */ + undo(): void; + /** + * Initializes an update operation for the specified graphic(s) and fires [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @param graphics An array of graphics to be updated. Only graphics added to the Sketch widget's [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer) property can be updated. + * @param updateOptions Update options for the graphics to be updated. + * @param updateOptions.tool + * Name of the update tool. Specifies the update operation for the selected graphics. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * transform | The *default* tool for graphics with [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting `enableRotation`, `enableScaling` or `preserveAspectRatio` properties when calling `update` method or setting them on [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) property when the Sketch widget initializes. This tool does not apply if selected graphics have only [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. + * reshape | It allows the entire graphic or individual vertices of the graphic to be moved. Vertices can be added or removed. This tool can only be used with one graphic and the graphic's geometry has to be [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html). + * move | The *default* tool for graphics with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. It should be used for specific cases where you just want to move selected `polygon` and `polyline` graphics without additional options. Additionally, the `move` tool does not support toggling to different modes, since `move` operation is already built into both `transform` and `reshape` tools by default. + * @param updateOptions.enableRotation Indicates if the `rotation` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * @param updateOptions.enableScaling Indicates if the `scale` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * @param updateOptions.preserveAspectRatio Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. Only applies if `tool` is `transform`. + * @param updateOptions.toggleToolOnClick Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * + */ + update(graphics: Graphic[], updateOptions?: SketchUpdateUpdateOptions): void; + } + + interface SketchConstructor { + /** + * Sketch widget provides a simple UI for creating and updating graphics on the 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). This significantly minimizes the code required for working with graphics in the view. It is intended to be used with [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) stored in its [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html) + */ + + new (properties?: SketchProperties): Sketch; + } + + export const Sketch: SketchConstructor; + + interface SketchProperties extends WidgetProperties { + /** + * The [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) associated with the Sketch widget. The Sketch widget adds new [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) to this layer or can only update graphics stored in this layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer) + */ + layer?: GraphicsLayerProperties; + /** + * Determines the layout/orientation of the Sketch widget. **Possible Values:** vertical | horizontal + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layout) + * + * @default horizontal + */ + layout?: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the Sketch widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#view) + */ + view?: MapViewProperties; + /** + * The view model for the Sketch widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SketchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) class to access all properties and methods on the Sketch widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#viewModel) + */ + viewModel?: SketchViewModelProperties; + } + interface SketchViewModel extends Accessor, Evented { /** - * 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) + * Returns the name of the active tool associated with the SketchViewModel instance. **Possible Values:** point | multipoint | polyline | polygon | circle | rectangle | move | transform | reshape + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#activeTool) */ - readonly graphic: Graphic; + readonly activeTool: string; /** - * GraphicsLayer associated with the SketchViewModel. It allows you to organize where temporary graphics are placed when the drawing is completed. - * + * The graphic that is being created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#createGraphic) + */ + readonly createGraphic: Graphic; + /** + * Default update options set for the SketchViewModel. Update options set on this property will be overwritten if the update options are changed when [update()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) method is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + */ + readonly defaultUpdateOptions: SketchViewModelDefaultUpdateOptions; + /** + * The [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) associated with the SketchViewModel. The SketchViewModel adds new [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) to this layer or can only update graphics stored in this layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer) */ layer: GraphicsLayer; @@ -55647,7 +59022,7 @@ declare namespace __esri { * } * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) */ pointSymbol: SimpleMarkerSymbol; @@ -55663,7 +59038,7 @@ declare namespace __esri { * } * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) */ polygonSymbol: SimpleFillSymbol; @@ -55676,100 +59051,133 @@ declare namespace __esri { * width: 2 * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) */ polylineSymbol: SimpleLineSymbol; /** - * The sketch view model's state. **Possible Values:** ready | disabled | creating | updating - * + * The sketch view model's state. **Possible Values:** ready | disabled | active + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#state) */ readonly state: string; + /** + * An array of graphics that are being updated by the SketchViewModel. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#updateGraphics) + */ + readonly updateGraphics: Collection; + /** + * Indicates if a graphic can be selected to be updated. If `false`, graphics cannot selected to be updated. Set this property to `false` to add a custom [hitTest](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) logic for [updating](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#updateOnGraphicClick) + */ + updateOnGraphicClick: boolean; /** * The view in which geometries will be sketched by the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#view) */ 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) 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. - * + * Cancels the active operation and fires the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update) event and changes the event's state to `cancel`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#cancel) + * + * + */ + cancel(): void; + /** + * Completes the active operation and fires the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update) event and changes the event's state to `complete`. If called in midst of create operation, `complete()` finishes the active create operation and keeps the valid geometry. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#complete) - * - * + * + * */ complete(): void; /** - * Creates the requested draw action. **Note:** Creating a circle geometry does not work in all spatial references. - * + * Create a graphic with a geometry specified in `tool` parameter. When first vertex of the graphic is added, [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create) event will start firing. **Note:** Creating a circle geometry does not work in all spatial references. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#create) - * - * @param drawAction Name of the draw action tool. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle - * @param drawOptions Object of the drawing options for the geometry to be created. - * @param drawOptions.mode - * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** - * + * + * @param tool Name of the create tool. Specifies the geometry type for the graphic to be created. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle + * @param createOptions Options for the graphic to be created. + * @param createOptions.mode + * Specifies how the graphic can be created. The create mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. * click | Vertices are added when the pointer is clicked. - * + * */ - create(drawAction: string, drawOptions?: SketchViewModelCreateDrawOptions): void; + create(tool: string, createOptions?: SketchViewModelCreateCreateOptions): 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. - * + * Resets SketchViewModel to prepare for another create operation. Reset discards the current sketch, if called in middle of create operation. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#reset) - * - * + * + * */ 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. - * + * Initializes an update operation for the specified graphic(s) and fires [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update) event. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) - * - * @param graphic The graphic to be updated. - * + * + * @param graphics An array of graphics to be updated. Only graphics added to SketchViewModel's [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer) property can be updated. + * @param updateOptions Update options for the graphics to be updated. + * @param updateOptions.tool + * Name of the update tool. Specifies the update operation for the selected graphics. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * transform | The *default* tool for graphics with [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting `enableRotation`, `enableScaling` or `preserveAspectRatio` properties when calling `update` method or setting them on [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) property when the widget initializes. This tool does not apply if selected graphics have only [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometries. + * reshape | It allows the entire graphic or individual vertices of the graphic to be moved. Vertices can be added or removed. This tool can only be used with one graphic and the graphic's geometry has to be [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html). + * move | The *default* tool for graphics with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometries. It should be used for specific cases where you just want to move selected `polygon` and `polyline` graphics without additional options. Additionally, the `move` tool does not support toggling to different modes, since `move` operation is already built into both `transform` and `reshape` tools by default. + * @param updateOptions.enableRotation Indicates if the `rotation` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * @param updateOptions.enableScaling Indicates if the `scale` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * @param updateOptions.preserveAspectRatio Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. Only applies if `tool` is `transform`. + * @param updateOptions.toggleToolOnClick Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * */ - update(graphic: Graphic): void; + update(graphics: Graphic[], updateOptions?: SketchViewModelUpdateUpdateOptions): void; } interface SketchViewModelConstructor { /** - * SketchViewModel simplifies the process of adding and updating graphics on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). SketchViewModel is intended to be used with [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). Its [events](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#events-summary) allow control of a graphic's geometry. Use the [DrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) class if more fine-grained control is needed with vertices when creating graphics. - * + * Provides the logic for the [Sketch](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html) widget. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) */ - new(properties?: SketchViewModelProperties): SketchViewModel; + new (properties?: SketchViewModelProperties): SketchViewModel; } export const SketchViewModel: SketchViewModelConstructor; interface SketchViewModelProperties { /** - * GraphicsLayer associated with the SketchViewModel. It allows you to organize where temporary graphics are placed when the drawing is completed. - * + * The [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) associated with the SketchViewModel. The SketchViewModel adds new [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) to this layer or can only update graphics stored in this layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer) */ layer?: GraphicsLayerProperties; @@ -55787,7 +59195,7 @@ declare namespace __esri { * } * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) */ pointSymbol?: SimpleMarkerSymbolProperties; @@ -55803,7 +59211,7 @@ declare namespace __esri { * } * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) */ polygonSymbol?: SimpleFillSymbolProperties; @@ -55816,78 +59224,553 @@ declare namespace __esri { * width: 2 * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) */ polylineSymbol?: SimpleLineSymbolProperties; + /** + * Indicates if a graphic can be selected to be updated. If `false`, graphics cannot selected to be updated. Set this property to `false` to add a custom [hitTest](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) logic for [updating](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#updateOnGraphicClick) + */ + updateOnGraphicClick?: boolean; /** * The view in which geometries will be sketched by the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#view) */ view?: MapViewProperties; } - - export interface SketchViewModelCreateDrawOptions extends Object { + export interface SketchViewModelCreateCreateOptions extends Object { /** - * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** - * + * Specifies how the graphic can be created. The create mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#create) */ mode?: string; } + export interface SketchViewModelDefaultUpdateOptions extends Object { + /** + * Name of the update tool. The default tool is `move` for graphics with `point` and `multipoint` geometries and `transform` for graphics with `polygon` and `polyline` geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + */ + tool?: string; + /** + * Indicates if the `rotation` operation will be enabled when updating graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default true + */ + enableRotation?: boolean; + /** + * Indicates if the `scale` operation will be enabled when updating graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default true + */ + enableScaling?: boolean; + /** + * Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default false + */ + preserveAspectRatio?: boolean; + /** + * Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default true + */ + toggleToolOnClick?: boolean; + } + + export interface SketchViewModelUpdateUpdateOptions extends Object { + /** + * Name of the update tool. Specifies the update operation for the selected graphics. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * transform | The *default* tool for graphics with [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting `enableRotation`, `enableScaling` or `preserveAspectRatio` properties when calling `update` method or setting them on [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) property when the widget initializes. This tool does not apply if selected graphics have only [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometries. + * reshape | It allows the entire graphic or individual vertices of the graphic to be moved. Vertices can be added or removed. This tool can only be used with one graphic and the graphic's geometry has to be [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html). + * move | The *default* tool for graphics with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometries. It should be used for specific cases where you just want to move selected `polygon` and `polyline` graphics without additional options. Additionally, the `move` tool does not support toggling to different modes, since `move` operation is already built into both `transform` and `reshape` tools by default. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + */ + tool?: string; + /** + * Indicates if the `rotation` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + * + * @default true + */ + enableRotation?: boolean; + /** + * Indicates if the `scale` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + * + * @default true + */ + enableScaling?: boolean; + /** + * Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + * + * @default false + */ + preserveAspectRatio?: boolean; + /** + * Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + * + * @default true + */ + toggleToolOnClick?: boolean; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) event when the graphic is being created. It returns [VertexAddEventInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexAddEventInfo) when the user clicks the view or [CursorUpdateEventInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CursorUpdateEventInfo) or when the user moves the cursor. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CreateToolEventInfo) + */ + export type CreateToolEventInfo = VertexAddEventInfo | CursorUpdateEventInfo; + + /** + * This information is returned as `toolEventInfo` parameter for the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) event when the user moves the cursor on the view while the graphic is being created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CursorUpdateEventInfo) + */ + export interface CursorUpdateEventInfo extends Object { + /** + * Type is always `cursor-update`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CursorUpdateEventInfo) + */ + type: string; + /** + * An array of numbers representing the coordinates of the cursor location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CursorUpdateEventInfo) + */ + coordinates: number[]; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event while the user is moving the graphics. It returns additional information associated with the move operation and what stage it is at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + export interface MoveEventInfo extends Object { + /** + * Returns information indicating the stage of the move operation. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * move-start | The type changes to `move-start` at the start of `move` operation. + * move | The type changes to `move` while graphics are being moved. + * move-stop | The type changes to `move-stop` once graphics are moved. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + type: string; + /** + * Number of pixels moved on the x-axis from the last known position. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + dx: number; + /** + * Number of pixels moved on the y-axis from the last known position. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + dy: number; + /** + * The instance of the graphic that is being moved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + mover: Graphic; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event while the user is reshaping the graphics. It returns additional information associated with the reshape operation and what stage it is at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ReshapeEventInfo) + */ + export interface ReshapeEventInfo extends Object { + /** + * Returns information indicating the stage of the reshape operation. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * reshape-start | The type changes to `reshape-start` at the start of `reshape` operation. + * reshape | The type changes to `reshape` while graphics are being reshaped. + * reshape-stop | The type changes to `reshape-stop` once graphics are reshaped. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ReshapeEventInfo) + */ + type: string; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event while the user is rotating the graphics. It returns additional information associated with the rotate operation and what stage it is at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#RotateEventInfo) + */ + export interface RotateEventInfo extends Object { + /** + * Returns information indicating the stage of the rotate operation. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * rotate-start | The type changes to `rotate-start` at the start of `rotate` operation. + * rotate | The type changes to `rotate` while graphics are being rotated. + * rotate-stop | The type changes to `rotate-stop` once graphics are rotated. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#RotateEventInfo) + */ + type: string; + /** + * Angle of rotation in degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#RotateEventInfo) + */ + angle: number; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event while the user is scaling or resizing the graphics. It returns additional information associated with the scale operation and what stage it is at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ScaleEventInfo) + */ + export interface ScaleEventInfo extends Object { + /** + * Returns information indicating the stage of the scale operation. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * scale-start | The type changes to `scale-start` at the start of scale or resize operation. + * scale | The type changes to `scale` while graphics are being scaled or resized. + * scale-stop | The type changes to `scale-stop` once graphics are scaled or resized. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ScaleEventInfo) + */ + type: string; + /** + * The x scale factor used to enlarge or shrink the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ScaleEventInfo) + */ + xScale: number; + /** + * The y scale factor used to enlarge or shrink the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ScaleEventInfo) + */ + yScale: number; + } + + export interface SketchCreateCreateOptions extends Object { + /** + * Specifies how the graphic can be created. The create mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. + * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. + * click | Vertices are added when the pointer is clicked. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#create) + */ + mode?: string; + } + + export interface SketchUpdateUpdateOptions extends Object { + /** + * Name of the update tool. Specifies the update operation for the selected graphics. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * transform | The *default* tool for graphics with [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting `enableRotation`, `enableScaling` or `preserveAspectRatio` properties when calling `update` method or setting them on [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) property when the Sketch widget initializes. This tool does not apply if selected graphics have only [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. + * reshape | It allows the entire graphic or individual vertices of the graphic to be moved. Vertices can be added or removed. This tool can only be used with one graphic and the graphic's geometry has to be [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html). + * move | The *default* tool for graphics with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. It should be used for specific cases where you just want to move selected `polygon` and `polyline` graphics without additional options. Additionally, the `move` tool does not support toggling to different modes, since `move` operation is already built into both `transform` and `reshape` tools by default. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + */ + tool?: string; + /** + * Indicates if the `rotation` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @default true + */ + enableRotation?: boolean; + /** + * Indicates if the `scale` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @default true + */ + enableScaling?: boolean; + /** + * Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @default false + */ + preserveAspectRatio?: boolean; + /** + * Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @default true + */ + toggleToolOnClick?: boolean; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event when the user is updating graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#UpdateToolEventInfo) + */ + export type UpdateToolEventInfo = + | MoveEventInfo + | ReshapeEventInfo + | RotateEventInfo + | ScaleEventInfo + | VertexAddEventInfo + | VertexRemoveEventInfo; + + /** + * This information is returned as `toolEventInfo` parameter for the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event when the user adds vertices to the graphic being created or updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexAddEventInfo) + */ + export interface VertexAddEventInfo extends Object { + /** + * Type is always `vertex-add`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexAddEventInfo) + */ + type: string; + /** + * An array of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries representing the vertices that were added. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexAddEventInfo) + */ + added: Graphic[]; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event when the user is removing vertices from the graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexRemoveEventInfo) + */ + export interface VertexRemoveEventInfo extends Object { + /** + * Type is always `vertex-remove`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexRemoveEventInfo) + */ + type: string; + /** + * An array of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries representing the vertices that were removed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexRemoveEventInfo) + */ + removed: Graphic[]; + } + + interface Slice extends Widget { + /** + * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#view) + */ + view: SceneView; + /** + * The view model for this widget. This is a class that contains the properties and methods that control this widget's behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#viewModel) + */ + viewModel: SliceViewModel; + + /** + * *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-Slice.html#render) + * + * + */ + render(): any; + } + + interface SliceConstructor { + /** + * The slice widget is a 3D analysis tool that can be used to reveal occluded content in a {@link module:esri/views/SceneView}. The slice widget can be applied to any layer type, making it possible to see inside buildings or to explore geological surfaces. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html) + */ + + new (properties?: SliceProperties): Slice; + } + + export const Slice: SliceConstructor; + + interface SliceProperties extends WidgetProperties { + /** + * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#view) + */ + view?: SceneViewProperties; + /** + * The view model for this widget. This is a class that contains the properties and methods that control this widget's behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#viewModel) + */ + viewModel?: SliceViewModelProperties; + } + + interface SliceViewModel extends Accessor { + /** + * Add layers to this collection to exclude them from the slice. Layers that are draped on the ground surface are not affected by this property and can be excluded from the slice using [excludeGroundSurface](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludeGroundSurface). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludedLayers) + */ + excludedLayers: Collection; + /** + * Indicates whether the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) and layers that are draped on the ground surface are excluded from the slice. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludeGroundSurface) + */ + excludeGroundSurface: boolean; + /** + * The view model's state. + * + * Value | Description + * ------------|------------- + * disabled | not ready yet + * ready | ready for slicing + * slicing | currently slicing + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + + /** + * Clears the current slice. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#clearSlice) + * + * + */ + clearSlice(): void; + /** + * Starts a new slice. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#newSlice) + * + * + */ + newSlice(): void; + } + + interface SliceViewModelConstructor { + new (properties?: SliceViewModelProperties): SliceViewModel; + } + + export const SliceViewModel: SliceViewModelConstructor; + + interface SliceViewModelProperties { + /** + * Add layers to this collection to exclude them from the slice. Layers that are draped on the ground surface are not affected by this property and can be excluded from the slice using [excludeGroundSurface](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludeGroundSurface). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludedLayers) + */ + excludedLayers?: CollectionProperties; + /** + * Indicates whether the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) and layers that are draped on the ground surface are excluded from the slice. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludeGroundSurface) + */ + excludeGroundSurface?: boolean; + } + interface GeolocationPositioning { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions: any; /** * Indicates whether to navigate the view to the position and scale of the geolocated result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled: boolean; /** * The graphic used to show the user's location on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#graphic) */ graphic: Graphic; /** * The scale to set on the view when navigating to the position of the geolocated result. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#scale) - * + * * @default null */ scale: number; /** * The view associated with the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#view) */ view: MapView | SceneView; } interface GeolocationPositioningConstructor { - - - new(): GeolocationPositioning; + new (): GeolocationPositioning; } export const GeolocationPositioning: GeolocationPositioningConstructor; @@ -55895,37 +59778,37 @@ declare namespace __esri { interface GeolocationPositioningProperties { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions?: any; /** * Indicates whether to navigate the view to the position and scale of the geolocated result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled?: boolean; /** * The graphic used to show the user's location on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#graphic) */ graphic?: GraphicProperties; /** * The scale to set on the view when navigating to the position of the geolocated result. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#scale) - * + * * @default null */ scale?: number; /** * The view associated with the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -55934,16 +59817,14 @@ declare namespace __esri { interface GoTo { /** * This function provides the ability to override either the [MapView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GoTo.html#goToOverride) */ goToOverride: GoToOverride; } interface GoToConstructor { - - - new(): GoTo; + new (): GoTo; } export const GoTo: GoToConstructor; @@ -55951,77 +59832,84 @@ declare namespace __esri { interface GoToProperties { /** * This function provides the ability to override either the [MapView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GoTo.html#goToOverride) */ goToOverride?: GoToOverride; } - interface widget { /** * This convenience decorator is used to help simplify accessibility within the widget keyboard events. For example, it can be used to execute a method when the `space` or `enter` keys are pressed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#accessibleHandler) - * - * + * + * */ accessibleHandler(): Function; /** * Utility method used for creating CSS animation/transition functions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#cssTransition) - * + * * @param type The animation/transition type. **Possible Values:** enter | exit * @param className The animation/transition class name. - * + * */ cssTransition(type: string, className: string): Function; + /** + * Utility method used to determine if the directionality of the text of the document is right-to-left. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#isRTL) + * + * + */ + isRTL(): boolean; /** * Utility method used for joining CSS classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#join) - * + * * @param classNames The class names to join. - * + * */ join(...classNames: string[]): string; /** * This convenience decorator marks a property for automatic rendering. It is useful when you want rendering to be scheduled whenever the decorated property changes. Many times this decorator is used in conjunction with the [@property](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html) decorator. Rendering on deep properties is also supported by providing a path to a property deeper in the instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#renderable) - * + * * @param propertyName Names of nested renderable properties. - * + * */ renderable(propertyName?: string | string[]): Function; /** * This convenience method is used to assign an [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) DOM node reference to a variable. It does this by taking a [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) passed from either the [afterUpdate](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) or [afterCreate](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) callbacks. In order to use this, the element must have a set [data-node-ref](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) attribute. In addition, it must also be bound to the widget instance, e.g. `bind={this}`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#storeNode) - * + * * @param node The referenced DOM node. - * + * */ storeNode(node: HTMLElement): void; /** * This convenience method is used to render the JSX in the [widget.render()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#render) method. It is required to import `tsx` even though it is not explicitly called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#tsx) - * + * * @param selector The element to create. * @param properties The element's properties. * @param children The element's children. - * + * */ tsx(selector: string, properties?: any, children?: any): any; /** * This convenience decorator helps dispatch view model events on the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#vmEvent) - * + * * @param eventNames The event names to re-dispatch. - * + * */ vmEvent(eventNames: string | string[]): Function; } @@ -56032,19 +59920,19 @@ declare namespace __esri { /** * The following parameters passed to either the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) functions. For additional information on what can be passed to its `target` or `options`, please refer to documentation for either the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) functions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) */ export interface GoToParameters extends Object { /** * The target location/viewpoint to animate to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) */ target: any; /** * Animation options. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) */ options?: any; @@ -56053,97 +59941,97 @@ declare namespace __esri { interface Track 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions: any; /** * Indicates whether the widget will automatically navigate the view to the user's position when a geolocation result is found. Set to `false` to disable this behavior, leaving full control to the developer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled: boolean; /** * The graphic used to show the user's location in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#graphic) */ graphic: Graphic; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#label) */ readonly label: string; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#scale) - * + * * @default null */ scale: number; /** * Indicates whether the widget is watching for new positions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#tracking) - * + * * @default false */ readonly tracking: boolean; /** * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#useHeadingEnabled) - * + * * @default true */ useHeadingEnabled: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#view) */ view: MapView | SceneView; /** * 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 [TrackViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#viewModel) */ viewModel: TrackViewModel; /** * *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-Track.html#render) - * - * + * + * */ render(): any; /** * When executed, the widget will start [tracking](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#tracking) the user's location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#start) - * - * + * + * */ start(): void; /** * Stops tracking the user's location when executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#stop) - * - * + * + * */ stop(): void; } @@ -56151,11 +60039,11 @@ declare namespace __esri { interface TrackConstructor { /** * Provides a simple button that animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's location when clicked. The view rotates according to the direction where the tracked device is heading towards. While tracking, the default button looks like the following: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html) */ - new(properties?: TrackProperties): Track; + new (properties?: TrackProperties): Track; } export const Track: TrackConstructor; @@ -56163,51 +60051,51 @@ declare namespace __esri { interface TrackProperties extends WidgetProperties, GoToProperties { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions?: any; /** * Indicates whether the widget will automatically navigate the view to the user's position when a geolocation result is found. Set to `false` to disable this behavior, leaving full control to the developer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled?: boolean; /** * The graphic used to show the user's location in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#graphic) */ graphic?: GraphicProperties; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#scale) - * + * * @default null */ scale?: number; /** * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#useHeadingEnabled) - * + * * @default true */ useHeadingEnabled?: boolean; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [TrackViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#viewModel) */ viewModel?: TrackViewModelProperties; @@ -56216,35 +60104,35 @@ declare namespace __esri { interface TrackViewModel extends Accessor, Evented, GeolocationPositioning, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | tracking | waiting - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * Indicates whether new positions are being watched. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking) - * + * * @default false */ readonly tracking: boolean; /** * When executed, [tracking](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking) starts at the user's location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#start) - * - * + * + * */ start(): void; /** * Stops tracking the user's location when executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#stop) - * - * + * + * */ stop(): void; } @@ -56252,113 +60140,111 @@ declare namespace __esri { interface TrackViewModelConstructor { /** * Provides the logic for the [Track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html) widget, which animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's location when clicked and tracks it as the location is updated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) */ - new(properties?: TrackViewModelProperties): TrackViewModel; + new (properties?: TrackViewModelProperties): TrackViewModel; } export const TrackViewModel: TrackViewModelConstructor; - interface TrackViewModelProperties extends GeolocationPositioningProperties, GoToProperties { - - } + interface TrackViewModelProperties extends GeolocationPositioningProperties, GoToProperties {} interface UnivariateColorSizeSlider extends Accessor, Widgette { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#handlesVisible) - * + * * @default true */ handlesVisible: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) */ histogram: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramVisible) - * + * * @default true */ histogramVisible: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The size in points or pixels with which features will be represented at or above the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxSize) */ readonly maxSize: number; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) */ maxValue: number; /** * The size in points or pixels with which features will be represented at or below the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minSize) */ readonly minSize: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) */ minValue: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ statistics: UnivariateColorSizeSliderStatistics; /** * Indicates whether to show the average of the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible: boolean; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#ticksVisible) - * + * * @default true */ ticksVisible: boolean; /** * Represents the data values corresponding to the handles on the slider. It is an array of numbers indicating the `minDataValue` and the `maxDataValue` of the visual variables represented by the slider. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) */ readonly values: number[]; /** * The size and color visual variables represented by the slider. Since this slider represents univariate visualizations, both color and size visual variables must represent data from the same field or expression and be conicident. In other words, the lower stop or bound of the color visual variable must match the lower bound (or `minDataValue`) of the size visual variable. The same is true of the upper bounds of both visual variables. These must be set initially on the slider for it to render in the view. Both visual variables may be created manually (see snippet below) or generated from the [univariateColorSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) helper methods. New coincident color and size visual variables are created each time the user slides the handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) */ visualVariables: any[]; @@ -56367,11 +60253,11 @@ declare namespace __esri { interface UnivariateColorSizeSliderConstructor { /** * The UnivariateColorSizeSlider is a widget intended for authoring and exploring data-driven univariate visualizations 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) using color and size. To display properly, this slider requires [color and size visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) and a [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) object. Other optional properties may be used including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html) */ - new(properties?: UnivariateColorSizeSliderProperties): UnivariateColorSizeSlider; + new (properties?: UnivariateColorSizeSliderProperties): UnivariateColorSizeSlider; } export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; @@ -56379,107 +60265,106 @@ declare namespace __esri { interface UnivariateColorSizeSliderProperties extends WidgetteProperties { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#handlesVisible) - * + * * @default true */ handlesVisible?: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) */ histogram?: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramVisible) - * + * * @default true */ histogramVisible?: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth?: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) */ maxValue?: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) */ minValue?: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ statistics?: UnivariateColorSizeSliderStatistics; /** * Indicates whether to show the average of the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible?: boolean; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#ticksVisible) - * + * * @default true */ ticksVisible?: boolean; /** * The size and color visual variables represented by the slider. Since this slider represents univariate visualizations, both color and size visual variables must represent data from the same field or expression and be conicident. In other words, the lower stop or bound of the color visual variable must match the lower bound (or `minDataValue`) of the size visual variable. The same is true of the upper bounds of both visual variables. These must be set initially on the slider for it to render in the view. Both visual variables may be created manually (see snippet below) or generated from the [univariateColorSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) helper methods. New coincident color and size visual variables are created each time the user slides the handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) */ visualVariables?: any[]; } - export interface UnivariateColorSizeSliderStatistics extends Object { /** * The average of all data values represented in the size and color visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ avg: number; /** * The maximum of all data values represented in the size and color visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ max: number; /** * The minimum of all data values represented in the size and color visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ min: number; /** * The standard deviation calculated from all data values represented in the size and color visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ stddev: number; @@ -56488,98 +60373,90 @@ declare namespace __esri { interface Widget extends Accessor, Evented { /** * The ID or node representing the DOM element containing the widget. This property can only be set once. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#container) */ container: string | HTMLElement; /** * When `true`, this property indicates whether the widget has been destroyed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroyed) */ destroyed: boolean; /** * The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the container ID, or if that is not present then it will be automatically generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id) */ id: string; /** - * A utility method used for building the value for a widget's `class` property. This aids in simplifying CSS class setup. + * 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 dependent upon variables, such as whether the classes were: * * a single static class, * * multiple static classes, or * * dynamic classes. - * - * + * + * * This helper method takes all of these approaches into account and simplifies it to use one single pattern to accommodate these multiple approaches. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#classes) - * + * * @param classNames The class names. - * + * */ classes(...classNames: (string | string[] | any)[]): string; /** * Destroys the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroy) - * - * + * + * */ destroy(): void; /** * Widget teardown helper. Any handles added to it will be automatically removed when the widget is destroyed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#own) - * + * * @param handles Handles marked for removal once the widget is destroyed. - * + * */ own(handles: WatchHandle | WatchHandle[]): void; /** * *This method is primarily used by developers when implementing custom widgets.* Executes after widget is ready for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#postInitialize) - * - * + * + * */ postInitialize(): void; /** * Renders widget to the DOM immediately. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#renderNow) - * - * + * + * */ renderNow(): void; /** * *This method is primarily used by developers when implementing custom widgets.* Schedules widget rendering. This method is useful for changes affecting the UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#scheduleRender) - * - * + * + * */ scheduleRender(): void; - /** - * **Deprecated.** Finalizes the creation of the widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#startup) - * - * - */ - startup(): void; } interface WidgetConstructor { /** * The base class for widgets. Each widget's presentation is separate from its properties, methods, and data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) */ - new(properties?: WidgetProperties): Widget; + new (properties?: WidgetProperties): Widget; } export const Widget: WidgetConstructor; @@ -56587,19 +60464,19 @@ declare namespace __esri { interface WidgetProperties { /** * The ID or node representing the DOM element containing the widget. This property can only be set once. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#container) */ container?: string | HTMLElement; /** * When `true`, this property indicates whether the widget has been destroyed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroyed) */ destroyed?: boolean; /** * The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the container ID, or if that is not present then it will be automatically generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id) */ id?: string; @@ -56608,43 +60485,41 @@ declare namespace __esri { interface Widgette { /** * The ID or node representing the DOM element containing the widget. Note that once set, this property cannot be modified afterwards. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#container) */ container: string | HTMLElement; /** * Indicates whether the widget is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#visible) - * + * * @default true */ visible: boolean; /** * Destroys the widget instance. Call this method when the widget is no longer needed by the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#destroy) - * - * + * + * */ destroy(): void; /** * Registers an event handler on the widget instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#events-summary) for a list of supported events. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#on) - * + * * @param type The name of the event. * @param listener The function to call when the event is fired. - * + * */ on(type: string, listener: Function): any; } interface WidgetteConstructor { - - - new(): Widgette; + new (): Widgette; } export const Widgette: WidgetteConstructor; @@ -56652,15 +60527,15 @@ declare namespace __esri { interface WidgetteProperties { /** * The ID or node representing the DOM element containing the widget. Note that once set, this property cannot be modified afterwards. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#container) */ container?: string | HTMLElement; /** * Indicates whether the widget is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#visible) - * + * * @default true */ visible?: boolean; @@ -56669,59 +60544,59 @@ declare namespace __esri { interface Zoom extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#label) */ readonly label: string; /** * Determines the layout/orientation of the Zoom widget. **Possible Values:** vertical | horizontal - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#layout) - * + * * @default vertical */ layout: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#view) */ view: MapView | SceneView; /** * 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 [ZoomViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#viewModel) */ viewModel: ZoomViewModel; /** * *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-Zoom.html#render) - * - * + * + * */ render(): any; /** * Zooms the view in by an LOD factor of 0.5. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#zoomIn) - * - * + * + * */ zoomIn(): void; /** * Zooms the view out by an LOD factor of 2. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#zoomOut) - * - * + * + * */ zoomOut(): void; } @@ -56729,11 +60604,11 @@ declare namespace __esri { interface ZoomConstructor { /** * The Zoom widget allows users to zoom in/out within a view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html) */ - new(properties?: ZoomProperties): Zoom; + new (properties?: ZoomProperties): Zoom; } export const Zoom: ZoomConstructor; @@ -56741,21 +60616,21 @@ declare namespace __esri { interface ZoomProperties extends WidgetProperties { /** * Determines the layout/orientation of the Zoom widget. **Possible Values:** vertical | horizontal - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#layout) - * + * * @default vertical */ layout?: string; /** * 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. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * 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 [ZoomViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#viewModel) */ viewModel?: ZoomViewModelProperties; @@ -56764,53 +60639,51 @@ declare namespace __esri { interface ZoomViewModel extends Accessor { /** * Indicates if the view can zoom in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomIn) */ canZoomIn: boolean; /** * Indicates if the view can zoom out. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomOut) */ canZoomOut: boolean; /** * The current state of the widget. **Possible Values:** disabled | ready - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which to operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#view) */ view: MapView | SceneView; /** * Zooms the view in by an LOD factor of 0.5. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#zoomIn) - * - * + * + * */ zoomIn(): void; /** * Zooms the view out by an LOD factor of 2. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#zoomOut) - * - * + * + * */ zoomOut(): void; } interface ZoomViewModelConstructor { - - - new(properties?: ZoomViewModelProperties): ZoomViewModel; + new (properties?: ZoomViewModelProperties): ZoomViewModel; } export const ZoomViewModel: ZoomViewModelConstructor; @@ -56818,19 +60691,19 @@ declare namespace __esri { interface ZoomViewModelProperties { /** * Indicates if the view can zoom in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomIn) */ canZoomIn?: boolean; /** * Indicates if the view can zoom out. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomOut) */ canZoomOut?: boolean; /** * The view from which to operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -57093,11 +60966,6 @@ declare module "esri/identity/Credential" { export = Credential; } -declare module "esri/identity/IdentityManagerBase" { - import IdentityManagerBase = __esri.IdentityManagerBase; - export = IdentityManagerBase; -} - declare module "esri/identity/IdentityManager" { const IdentityManager: __esri.IdentityManager; export = IdentityManager; @@ -57118,6 +60986,11 @@ declare module "esri/layers/BaseElevationLayer" { export = BaseElevationLayer; } +declare module "esri/layers/BuildingSceneLayer" { + import BuildingSceneLayer = __esri.BuildingSceneLayer; + export = BuildingSceneLayer; +} + declare module "esri/layers/BingMapsLayer" { import BingMapsLayer = __esri.BingMapsLayer; export = BingMapsLayer; @@ -57248,6 +61121,41 @@ declare module "esri/layers/BaseTileLayer" { export = BaseTileLayer; } +declare module "esri/layers/buildingSublayers/BuildingComponentSublayer" { + import BuildingComponentSublayer = __esri.BuildingComponentSublayer; + export = BuildingComponentSublayer; +} + +declare module "esri/layers/buildingSublayers/BuildingGroupSublayer" { + import BuildingGroupSublayer = __esri.BuildingGroupSublayer; + export = BuildingGroupSublayer; +} + +declare module "esri/layers/buildingSublayers/BuildingSublayer" { + import BuildingSublayer = __esri.BuildingSublayer; + export = BuildingSublayer; +} + +declare module "esri/layers/pointCloudFilters/PointCloudFilter" { + import PointCloudFilter = __esri.PointCloudFilter; + export = PointCloudFilter; +} + +declare module "esri/layers/pointCloudFilters/PointCloudValueFilter" { + import PointCloudValueFilter = __esri.PointCloudValueFilter; + export = PointCloudValueFilter; +} + +declare module "esri/layers/pointCloudFilters/PointCloudReturnFilter" { + import PointCloudReturnFilter = __esri.PointCloudReturnFilter; + export = PointCloudReturnFilter; +} + +declare module "esri/layers/support/AttachmentInfo" { + import AttachmentInfo = __esri.AttachmentInfo; + export = AttachmentInfo; +} + declare module "esri/layers/support/CodedValueDomain" { import CodedValueDomain = __esri.CodedValueDomain; export = CodedValueDomain; @@ -57473,6 +61381,46 @@ declare module "esri/renderers/support/HeatmapColorStop" { export = HeatmapColorStop; } +declare module "esri/renderers/visualVariables/ColorVariable" { + import ColorVariable = __esri.ColorVariable; + export = ColorVariable; +} + +declare module "esri/renderers/visualVariables/OpacityVariable" { + import OpacityVariable = __esri.OpacityVariable; + export = OpacityVariable; +} + +declare module "esri/renderers/visualVariables/RotationVariable" { + import RotationVariable = __esri.RotationVariable; + export = RotationVariable; +} + +declare module "esri/renderers/visualVariables/SizeVariable" { + import SizeVariable = __esri.SizeVariable; + export = SizeVariable; +} + +declare module "esri/renderers/visualVariables/VisualVariable" { + import VisualVariable = __esri.VisualVariable; + export = VisualVariable; +} + +declare module "esri/renderers/visualVariables/support/ColorStop" { + import ColorStop = __esri.ColorStop; + export = ColorStop; +} + +declare module "esri/renderers/visualVariables/support/OpacityStop" { + import OpacityStop = __esri.OpacityStop; + export = OpacityStop; +} + +declare module "esri/renderers/visualVariables/support/SizeStop" { + import SizeStop = __esri.SizeStop; + export = SizeStop; +} + declare module "esri/support/actions/ActionButton" { import ActionButton = __esri.ActionButton; export = ActionButton; @@ -57483,6 +61431,111 @@ declare module "esri/support/actions/ActionToggle" { export = ActionToggle; } +declare module "esri/support/ExpressionInfo" { + import ExpressionInfo = __esri.ExpressionInfo; + export = ExpressionInfo; +} + +declare module "esri/support/FieldInfo" { + import FieldInfo = __esri.FieldInfo; + export = FieldInfo; +} + +declare module "esri/support/LayerOptions" { + import LayerOptions = __esri.LayerOptions; + export = LayerOptions; +} + +declare module "esri/support/RelatedRecordsInfo" { + import RelatedRecordsInfo = __esri.RelatedRecordsInfo; + export = RelatedRecordsInfo; +} + +declare module "esri/support/ContentElement/Attachments" { + import Attachments = __esri.Attachments; + export = Attachments; +} + +declare module "esri/support/ContentElement/ContentElement" { + import ContentElementContentElement = __esri.ContentElementContentElement; + export = ContentElementContentElement; +} + +declare module "esri/support/ContentElement/Fields" { + import Fields = __esri.Fields; + export = Fields; +} + +declare module "esri/support/ContentElement/Media" { + import Media = __esri.Media; + export = Media; +} + +declare module "esri/support/ContentElement/Text" { + import Text = __esri.Text; + export = Text; +} + +declare module "esri/support/ContentElement/Media/BarChart" { + import BarChart = __esri.BarChart; + export = BarChart; +} + +declare module "esri/support/ContentElement/Media/Chart" { + import Chart = __esri.Chart; + export = Chart; +} + +declare module "esri/support/ContentElement/Media/ColumnChart" { + import ColumnChart = __esri.ColumnChart; + export = ColumnChart; +} + +declare module "esri/support/ContentElement/Media/LineChart" { + import LineChart = __esri.LineChart; + export = LineChart; +} + +declare module "esri/support/ContentElement/Media/Media" { + import MediaMedia = __esri.MediaMedia; + export = MediaMedia; +} + +declare module "esri/support/ContentElement/Media/PieChart" { + import PieChart = __esri.PieChart; + export = PieChart; +} + +declare module "esri/support/ContentElement/Media/Chart/Series" { + import Series = __esri.Series; + export = Series; +} + +declare module "esri/support/ContentElement/Media/Chart/Value" { + import Value = __esri.Value; + export = Value; +} + +declare module "esri/support/ContentElement/Media/Image" { + import Image = __esri.Image; + export = Image; +} + +declare module "esri/support/ContentElement/Media/Image/Value" { + import ImageValue = __esri.ImageValue; + export = ImageValue; +} + +declare module "esri/support/FieldInfo/Format" { + import FieldInfoFormat = __esri.FieldInfoFormat; + export = FieldInfoFormat; +} + +declare module "esri/support/RelatedRecordsInfo/FieldOrder" { + import FieldOrder = __esri.FieldOrder; + export = FieldOrder; +} + declare module "esri/symbols/ExtrudeSymbol3DLayer" { import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; export = ExtrudeSymbol3DLayer; @@ -58073,11 +62126,6 @@ declare module "esri/views/2d/draw/SegmentDrawAction" { export = SegmentDrawAction; } -declare module "esri/views/2d/layers/BaseLayerView2D" { - import BaseLayerView2D = __esri.BaseLayerView2D; - export = BaseLayerView2D; -} - declare module "esri/webmap/Bookmark" { import Bookmark = __esri.Bookmark; export = Bookmark; @@ -58148,6 +62196,11 @@ declare module "esri/webscene/background/ColorBackground" { export = ColorBackground; } +declare module "esri/widgets/AreaMeasurement2D" { + import AreaMeasurement2D = __esri.AreaMeasurement2D; + export = AreaMeasurement2D; +} + declare module "esri/widgets/AreaMeasurement3D" { import AreaMeasurement3D = __esri.AreaMeasurement3D; export = AreaMeasurement3D; @@ -58198,6 +62251,11 @@ declare module "esri/widgets/DirectLineMeasurement3D" { export = DirectLineMeasurement3D; } +declare module "esri/widgets/DistanceMeasurement2D" { + import DistanceMeasurement2D = __esri.DistanceMeasurement2D; + export = DistanceMeasurement2D; +} + declare module "esri/widgets/Expand" { import Expand = __esri.Expand; export = Expand; @@ -58213,6 +62271,11 @@ declare module "esri/widgets/FeatureForm" { export = FeatureForm; } +declare module "esri/widgets/FeatureTemplates" { + import FeatureTemplates = __esri.FeatureTemplates; + export = FeatureTemplates; +} + declare module "esri/widgets/Fullscreen" { import Fullscreen = __esri.Fullscreen; export = Fullscreen; @@ -58263,11 +62326,21 @@ declare module "esri/widgets/Search" { export = widgetsSearch; } +declare module "esri/widgets/Sketch" { + import Sketch = __esri.Sketch; + export = Sketch; +} + declare module "esri/widgets/SizeSlider" { import SizeSlider = __esri.SizeSlider; export = SizeSlider; } +declare module "esri/widgets/Slice" { + import Slice = __esri.Slice; + export = Slice; +} + declare module "esri/widgets/Track" { import Track = __esri.Track; export = Track; @@ -58288,6 +62361,11 @@ declare module "esri/widgets/Zoom" { export = Zoom; } +declare module "esri/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel" { + import AreaMeasurement2DViewModel = __esri.AreaMeasurement2DViewModel; + export = AreaMeasurement2DViewModel; +} + declare module "esri/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel" { import AreaMeasurement3DViewModel = __esri.AreaMeasurement3DViewModel; export = AreaMeasurement3DViewModel; @@ -58348,6 +62426,11 @@ declare module "esri/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DView export = DirectLineMeasurement3DViewModel; } +declare module "esri/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel" { + import DistanceMeasurement2DViewModel = __esri.DistanceMeasurement2DViewModel; + export = DistanceMeasurement2DViewModel; +} + declare module "esri/widgets/Expand/ExpandViewModel" { import ExpandViewModel = __esri.ExpandViewModel; export = ExpandViewModel; @@ -58368,9 +62451,9 @@ declare module "esri/widgets/FeatureForm/FieldConfig" { export = FieldConfig; } -declare module "esri/widgets/FeatureForm/FieldOptions" { - import FieldOptions = __esri.FieldOptions; - export = FieldOptions; +declare module "esri/widgets/FeatureForm/FieldGroupConfig" { + import FieldGroupConfig = __esri.FieldGroupConfig; + export = FieldGroupConfig; } declare module "esri/widgets/FeatureForm/InputField" { @@ -58378,6 +62461,26 @@ declare module "esri/widgets/FeatureForm/InputField" { export = InputField; } +declare module "esri/widgets/FeatureForm/InputFieldGroup" { + import InputFieldGroup = __esri.InputFieldGroup; + export = InputFieldGroup; +} + +declare module "esri/widgets/FeatureTemplates/FeatureTemplatesViewModel" { + import FeatureTemplatesViewModel = __esri.FeatureTemplatesViewModel; + export = FeatureTemplatesViewModel; +} + +declare module "esri/widgets/FeatureTemplates/TemplateItem" { + import TemplateItem = __esri.TemplateItem; + export = TemplateItem; +} + +declare module "esri/widgets/FeatureTemplates/TemplateItemGroup" { + import TemplateItemGroup = __esri.TemplateItemGroup; + export = TemplateItemGroup; +} + declare module "esri/widgets/Fullscreen/FullscreenViewModel" { import FullscreenViewModel = __esri.FullscreenViewModel; export = FullscreenViewModel; @@ -58443,6 +62546,11 @@ declare module "esri/widgets/Search/LocatorSearchSource" { export = LocatorSearchSource; } +declare module "esri/widgets/Search/SearchResultRenderer" { + import SearchResultRenderer = __esri.SearchResultRenderer; + export = SearchResultRenderer; +} + declare module "esri/widgets/Search/SearchSource" { import SearchSource = __esri.SearchSource; export = SearchSource; @@ -58453,6 +62561,11 @@ declare module "esri/widgets/Search/SearchViewModel" { export = SearchViewModel; } +declare module "esri/widgets/Slice/SliceViewModel" { + import SliceViewModel = __esri.SliceViewModel; + export = SliceViewModel; +} + declare module "esri/widgets/Track/TrackViewModel" { import TrackViewModel = __esri.TrackViewModel; export = TrackViewModel; @@ -58498,11 +62611,6 @@ declare module "esri/layers/mixins/ArcGISCachedService" { export = ArcGISCachedService; } -declare module "esri/layers/mixins/ArcGISDynamicMapService" { - import ArcGISDynamicMapService = __esri.ArcGISDynamicMapService; - export = ArcGISDynamicMapService; -} - declare module "esri/layers/mixins/ArcGISImageService" { import ArcGISImageService = __esri.ArcGISImageService; export = ArcGISImageService; @@ -58538,9 +62646,9 @@ declare module "esri/layers/mixins/SublayersOwner" { export = SublayersOwner; } -declare module "esri/renderers/VisualVariablesMixin" { - import VisualVariablesMixin = __esri.VisualVariablesMixin; - export = VisualVariablesMixin; +declare module "esri/renderers/mixins/VisualVariablesRenderer" { + import VisualVariablesRenderer = __esri.VisualVariablesRenderer; + export = VisualVariablesRenderer; } declare module "esri/support/actions/ActionBase" { @@ -58583,16 +62691,36 @@ declare module "esri/config" { export = config; } +declare module "esri/geometry" { + import geometry = __esri.geometry; + export = geometry; +} + declare module "esri/kernel" { import kernel = __esri.kernel; export = kernel; } +declare module "esri/pointCloudRenderers" { + import pointCloudRenderers = __esri.pointCloudRenderers; + export = pointCloudRenderers; +} + +declare module "esri/renderers" { + import renderers = __esri.renderers; + export = renderers; +} + declare module "esri/request" { import request = __esri.request; export = request; } +declare module "esri/symbols" { + import symbols = __esri.symbols; + export = symbols; +} + declare module "esri/core/Error" { import Error = __esri.Error; export = Error; @@ -58773,6 +62901,11 @@ declare module "esri/renderers/support/jsonUtils" { export = supportJsonUtils; } +declare module "esri/support/ContentElement" { + import ContentElement = __esri.ContentElement; + export = ContentElement; +} + declare module "esri/symbols/support/jsonUtils" { import symbolsSupportJsonUtils = __esri.symbolsSupportJsonUtils; export = symbolsSupportJsonUtils; @@ -58783,6 +62916,11 @@ declare module "esri/symbols/support/symbolPreview" { export = symbolPreview; } +declare module "esri/views/2d/layers/BaseLayerView2D" { + import BaseLayerView2D = __esri.BaseLayerView2D; + export = BaseLayerView2D; +} + declare module "esri/views/3d/externalRenderers" { import externalRenderers = __esri.externalRenderers; export = externalRenderers; @@ -58802,98 +62940,3 @@ declare module "esri/widgets/CoordinateConversion/support/Conversion" { import Conversion = __esri.Conversion; export = Conversion; } - - -declare module "esri/geometry" { - export import Extent = __esri.Extent; - export import Multipoint = __esri.Multipoint; - export import Point = __esri.Point; - export import Polygon = __esri.Polygon; - export import Polyline = __esri.Polyline; - export import SpatialReference = __esri.SpatialReference; - export import ScreenPoint = __esri.ScreenPoint; - export import Mesh = __esri.Mesh; - - export type Geometry = Extent | Multipoint | Point | Polygon | Polyline | Mesh; -} - - - -declare module "esri/pointCloudRenderers" { - export import PointCloudClassBreaksRenderer = __esri.PointCloudClassBreaksRenderer; - export import PointCloudRGBRenderer = __esri.PointCloudRGBRenderer; - export import PointCloudStretchRenderer = __esri.PointCloudStretchRenderer; - export import PointCloudUniqueValueRenderer = __esri.PointCloudUniqueValueRenderer; - - export type PointCloudRenderer = PointCloudClassBreaksRenderer | PointCloudRGBRenderer | PointCloudStretchRenderer | PointCloudUniqueValueRenderer; -} - - - - - -declare module "esri/renderers" { - export import ClassBreaksRenderer = __esri.ClassBreaksRenderer; - export import HeatmapRenderer = __esri.HeatmapRenderer; - export import SimpleRenderer = __esri.SimpleRenderer; - export import UniqueValueRenderer = __esri.UniqueValueRenderer; - - export type Renderer = ClassBreaksRenderer | HeatmapRenderer | SimpleRenderer | UniqueValueRenderer; -} - - - -declare module "esri/symbols" { - export import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; - export import FillSymbol3DLayer = __esri.FillSymbol3DLayer; - export import Font = __esri.Font; - export import IconSymbol3DLayer = __esri.IconSymbol3DLayer; - export import LabelSymbol3D = __esri.LabelSymbol3D; - export import LineSymbol3D = __esri.LineSymbol3D; - export import LineSymbol3DLayer = __esri.LineSymbol3DLayer; - export import MeshSymbol3D = __esri.MeshSymbol3D; - export import ObjectSymbol3DLayer = __esri.ObjectSymbol3DLayer; - export import PathSymbol3DLayer = __esri.PathSymbol3DLayer; - export import PictureFillSymbol = __esri.PictureFillSymbol; - export import PictureMarkerSymbol = __esri.PictureMarkerSymbol; - export import PointSymbol3D = __esri.PointSymbol3D; - export import PolygonSymbol3D = __esri.PolygonSymbol3D; - export import SimpleFillSymbol = __esri.SimpleFillSymbol; - export import SimpleLineSymbol = __esri.SimpleLineSymbol; - export import SimpleMarkerSymbol = __esri.SimpleMarkerSymbol; - export import TextSymbol = __esri.TextSymbol; - export import TextSymbol3DLayer = __esri.TextSymbol3DLayer; - export import WebStyleSymbol = __esri.WebStyleSymbol; - - export type FillSymbol = PictureFillSymbol | SimpleFillSymbol; - export type MarkerSymbol = PictureMarkerSymbol | SimpleMarkerSymbol; - - export type Symbol2D = ( - PictureFillSymbol | - PictureMarkerSymbol | - SimpleFillSymbol | - SimpleLineSymbol | - SimpleMarkerSymbol | - TextSymbol - ); - - export type Symbol3D = ( - LabelSymbol3D | - LineSymbol3D | - MeshSymbol3D | - PointSymbol3D | - PolygonSymbol3D - ); - - export type Symbol3DLayer = ( - ExtrudeSymbol3DLayer | - FillSymbol3DLayer | - IconSymbol3DLayer | - LineSymbol3DLayer | - ObjectSymbol3DLayer | - PathSymbol3DLayer | - TextSymbol3DLayer - ); - - export type Symbol = Symbol2D | Symbol3D | WebStyleSymbol; -} diff --git a/types/arcgis-js-api/v3/index.d.ts b/types/arcgis-js-api/v3/index.d.ts index a42c651068..e38c5c0356 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.26 +// Type definitions for ArcGIS API for JavaScript 3.27 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Bjorn Svensson @@ -560,7 +560,7 @@ declare module "esri" { /** An array of driving time break values. */ breakValues?: number[]; /** The point feature layer around which drive-time areas will be drawn. */ - inputLayer: FeatureLayer; + inputLayers: FeatureLayer[]; /** The geometry type of the input layer. */ inputType?: string; /** Reference to the map object. */ @@ -1351,6 +1351,8 @@ declare module "esri" { clip?: number; /** If the widget is enabled and layers can be swiped. */ enabled?: boolean; + /** Indicates whether layer placement should be inverted (switched). */ + invertPlacement?: boolean; /** The layers to be swiped. */ layers: Layer[]; /** The number of pixels to place the tool from the left of the map. */ @@ -2532,7 +2534,7 @@ declare module "esri/Credential" { class Credential { /** Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. */ expires: number; - /** Indicates whether this credential belongs to a user with admin privileges. */ + /** Indicates that this credential was created to access the ArcGIS REST Admin service */ isAdmin: boolean; /** The Identity Manager's setOAuthRedirectionHandler returns an object that contains a "state" parameter. */ oAuthState: any; @@ -2600,6 +2602,12 @@ declare module "esri/IdentityManagerBase" { tokenValidity: number; /** If your application is on the same domain as *.arcgis.com or ArcGIS Enterprise Server, the IdentityManager will redirect the user to its sign-in page. */ useSignInPage: boolean; + /** + * Returns a Credential object if the user has already signed in to access the given resource and is allowed to do so when using the given application id. + * @param resUrl The resource URL. + * @param appId The registered OAuth application id. + */ + checkAppAccess(resUrl: string, appId: string): any; /** * Returns the credential (via Deferred) if the user has already signed in to access the given resource. * @param resUrl The resource URL. @@ -2891,7 +2899,7 @@ declare module "esri/SnappingManager" { } declare module "esri/SpatialReference" { - /** The spatial reference of a map, layer, or inputs to and outputs from a task. */ + /** Defines the spatial reference of a map, layer, or task parameters. */ class SpatialReference { /** The well-known ID of a spatial reference. */ wkid: number; @@ -2953,6 +2961,54 @@ declare module "esri/TimeExtent" { export = TimeExtent; } +declare module "esri/arcadeProfiles/fieldCalculateProfile" { + /** Module that implements the Arcade field calculate profile in web apps that calculate field values using Arcade expressions. */ + var fieldCalculateProfile: { + /** + * Initializes the field calculate profile for the given Arcade expressions. + * @param expressions An array of Arcade expressions intended for use in the calculate profile. + */ + initialize(expressions: string[]): any; + }; + export = fieldCalculateProfile; +} + +declare module "esri/arcadeProfiles/labelingProfile" { + /** Module that implements the Arcade labeling profile in web apps that label features using Arcade expressions. */ + var labelingProfile: { + /** + * Initializes the labeling profile for the given Arcade expressions. + * @param expressions An array of Arcade expressions intended for use in a label class. + */ + initialize(expressions: string[]): any; + }; + export = labelingProfile; +} + +declare module "esri/arcadeProfiles/popupProfile" { + /** Module that implements the Arcade popup profile for web apps that contain popups that reference Arcade expressions. */ + var popupProfile: { + /** + * Initializes the popup profile for the given Arcade expressions. + * @param expressions An array of Arcade expressions intended for use in a popup template. + */ + initialize(expressions: string[]): any; + }; + export = popupProfile; +} + +declare module "esri/arcadeProfiles/visualizationProfile" { + /** Module that implements the Arcade visualization profile in web apps that render features using Arcade expressions. */ + var visualizationProfile: { + /** + * Initializes the visualization profile for the given Arcade expressions. + * @param expressions An array of Arcade expressions intended for use in a renderer. + */ + initialize(expressions: string[]): any; + }; + export = visualizationProfile; +} + declare module "esri/arcgis/OAuthInfo" { import esri = require("esri"); @@ -4827,6 +4883,8 @@ declare module "esri/dijit/LayerSwipe" { clip: number; /** If the widget is enabled and layers can be swiped. */ enabled: boolean; + /** Indicates whether layer placement should be inverted (switched). */ + invertPlacement: boolean; /** The layers to be swiped. */ layers: Layer[]; /** The number of pixels to place the tool from the left of the map. */ @@ -6285,7 +6343,7 @@ declare module "esri/dijit/analysis/CreateDriveTimeAreas" { /** An array of driving time break values. */ breakValues: number[]; /** The point feature layer around which drive-time areas will be drawn. */ - inputLayer: FeatureLayer; + inputLayers: FeatureLayer[]; /** The geometry type of the input layer. */ inputType: string; /** Reference to the map object. */ @@ -9073,6 +9131,8 @@ declare module "esri/graphic" { getNode(): any; /** Returns one or more DOM nodes used to draw the graphic. */ getNodes(): any; + /** Applicable to label graphics. */ + getParentGraphic(): Graphic; /** Returns the dojox/gfx/shape.Shape of the Esri graphic. */ getShape(): any; /** Returns one or more dojox/gfx/shape.Shape used to draw the graphic. */ @@ -10314,6 +10374,8 @@ declare module "esri/layers/FeatureLayer" { on(type: "query-limit-exceeded", listener: (event: { target: FeatureLayer }) => void): esri.Handle; /** Fires when queryRelatedFeatures() is complete. */ on(type: "query-related-features-complete", listener: (event: { relatedFeatures: any; target: FeatureLayer }) => void): esri.Handle; + /** Fires right before the actual refresh kicks in for the layer, and only fires when the refresh is triggered by the refreshInterval. */ + on(type: "refresh-tick", listener: (event: { target: FeatureLayer }) => void): esri.Handle; /** Fires when a layer resumes drawing. */ on(type: "resume", listener: (event: { target: FeatureLayer }) => void): esri.Handle; /** Fires when a layer's minScale and/or maxScale is changed. */ @@ -12419,7 +12481,7 @@ declare module "esri/map" { getMinScale(): number; /** Returns the minimum zoom level of the map. */ getMinZoom(): number; - /** Returns the current map scale. */ + /** Returns the map scale at the center of the view. */ getScale(): number; /** Returns the current zoom level of the map. */ getZoom(): number; diff --git a/types/arr-diff/arr-diff-tests.ts b/types/arr-diff/arr-diff-tests.ts new file mode 100644 index 0000000000..509b2f43cc --- /dev/null +++ b/types/arr-diff/arr-diff-tests.ts @@ -0,0 +1,8 @@ +import diff = require('arr-diff'); + +const a = ['a', 'b', 'c', 'd']; +const b = [1, 2]; + +diff(['a']); // $ExpectType string[] +diff(['a'], [1]); // $ExpectType string[] +diff([1], ['a']); // $ExpectType number[] diff --git a/types/arr-diff/index.d.ts b/types/arr-diff/index.d.ts new file mode 100644 index 0000000000..3c9c5037cc --- /dev/null +++ b/types/arr-diff/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for arr-diff 4.0 +// Project: https://github.com/jonschlinkert/arr-diff +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = arrDiff; + +declare function arrDiff(first: T[], ...args: any[][]): T[]; diff --git a/types/arr-diff/tsconfig.json b/types/arr-diff/tsconfig.json new file mode 100644 index 0000000000..6ea302e0ba --- /dev/null +++ b/types/arr-diff/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", + "arr-diff-tests.ts" + ] +} diff --git a/types/arr-diff/tslint.json b/types/arr-diff/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/arr-diff/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/array-move/array-move-tests.ts b/types/array-move/array-move-tests.ts new file mode 100644 index 0000000000..0bf720b751 --- /dev/null +++ b/types/array-move/array-move-tests.ts @@ -0,0 +1,8 @@ +import arrayMove = require('array-move'); + +const input = ['a', 'b', 'c']; +const input2 = [1, 2, 3]; + +arrayMove(input, 1, 2); // $ExpectType string[] +arrayMove(input2, 1, 2); // $ExpectType number[] +arrayMove.mut(input, 1, 2); // $ExpectType void diff --git a/types/array-move/index.d.ts b/types/array-move/index.d.ts new file mode 100644 index 0000000000..9b9aae938a --- /dev/null +++ b/types/array-move/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for array-move 1.0 +// Project: https://github.com/sindresorhus/array-move +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = arrayMove; + +/** + * Move an array item to a different position. + * + * @param from Index of item to move. If negative, it will begin that many elements from the end. + * @param to Index of where to move the item. If negative, it will begin that many elements from the end. + * @returns A new array with the item moved to the new position. + */ +declare function arrayMove(input: T, from: number, to: number): T; + +declare namespace arrayMove { + /** + * Moves the item to the new position in the input array. + * + * Useful for huge arrays where absolute performance is needed. + * + * @param from Index of item to move. If negative, it will begin that many elements from the end. + * @param to Index of where to move the item. If negative, it will begin that many elements from the end. + */ + function mut(input: any[], from: number, to: number): void; +} diff --git a/types/array-move/tsconfig.json b/types/array-move/tsconfig.json new file mode 100644 index 0000000000..6b4a5d5bb0 --- /dev/null +++ b/types/array-move/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", + "array-move-tests.ts" + ] +} diff --git a/types/array-move/tslint.json b/types/array-move/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/array-move/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/array.prototype.flatmap/tslint.json b/types/array.prototype.flatmap/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/array.prototype.flatmap/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.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/asn1/asn1-tests.ts b/types/asn1/asn1-tests.ts new file mode 100644 index 0000000000..f37541b03e --- /dev/null +++ b/types/asn1/asn1-tests.ts @@ -0,0 +1,88 @@ +import { Ber, BerReader, BerWriter } from 'asn1'; + +let buf: Buffer = Buffer.alloc(0); +let bool = false; +let str = ''; +let num = 0; +let numOrNull: number | null = 0; +const roStrArray: ReadonlyArray = [str]; + +const reader = new BerReader(buf); +numOrNull = reader.peek(); +bool = reader.readBoolean(); +numOrNull = reader.readByte(bool); +num = reader.readEnumeration(); +num = reader.readInt(); +num = reader.readLength(); +num = reader.readLength(num); +str = reader.readOID(); +str = reader.readOID(num); +numOrNull = reader.readSequence(); +numOrNull = reader.readSequence(num); +str = reader.readString(); +str = reader.readString(num); +buf = reader.readString(num, bool); +num = reader._readTag(); +num = reader._readTag(num); + +let writer = new BerWriter(); +writer = new BerWriter({ + size: num, + growthFactor: num, +}); + +buf = writer.buffer; +buf = writer._buf; +num = writer._size; +num = writer._offset; + +writer.endSequence(); +writer.startSequence(); +writer.startSequence(num); +writer.writeBoolean(bool); +writer.writeBoolean(bool, num); +writer.writeBuffer(buf, num); +writer.writeByte(num); +writer.writeEnumeration(num); +writer.writeEnumeration(num, num); +writer.writeInt(num); +writer.writeInt(num, num); +writer.writeLength(num); +writer.writeNull(); +writer.writeOID(str, num); +writer.writeString(str); +writer.writeString(str, num); +writer.writeStringArray(roStrArray); +writer._ensure(num); + +num = Ber.BMPString; +num = Ber.BitString; +num = Ber.Boolean; +num = Ber.CharacterString; +num = Ber.Constructor; +num = Ber.Context; +num = Ber.EOC; +num = Ber.Enumeration; +num = Ber.External; +num = Ber.GeneralString; +num = Ber.GeneralizedTime; +num = Ber.GraphicString; +num = Ber.IA5String; +num = Ber.Integer; +num = Ber.Null; +num = Ber.NumericString; +num = Ber.OID; +num = Ber.ObjectDescriptor; +num = Ber.OctetString; +num = Ber.PDV; +num = Ber.PrintableString; +num = Ber.Real; +num = Ber.RelativeOID; +num = Ber.Sequence; +num = Ber.Set; +num = Ber.T61String; +num = Ber.UTCTime; +num = Ber.UniversalString; +num = Ber.Utf8String; +num = Ber.VideotexString; +num = Ber.VisibleString; diff --git a/types/asn1/index.d.ts b/types/asn1/index.d.ts new file mode 100644 index 0000000000..3f7de44af8 --- /dev/null +++ b/types/asn1/index.d.ts @@ -0,0 +1,126 @@ +// Type definitions for asn1 0.2 +// Project: https://github.com/joyent/node-asn1 +// Definitions by: Jim Geurts +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 +/// + +export class BerReader { + readonly buffer: Buffer; + readonly offset: number; + readonly length: number; + readonly remain: number; + readonly _buf: Buffer; + _size: number; + _offset: number; + + constructor(data: Buffer); + + peek(): number | null; + readBoolean(): boolean; + readByte(peek: boolean): number | null; + readEnumeration(): number; + readInt(): number; + readLength(offset?: number): number; + readOID(tag?: number): string; + readSequence(tag?: number): number | null; + readString(tag?: number): string; + readString(tag: number, retbuf: boolean): Buffer; + _readTag(tag?: number): number; +} + +export class BerWriter { + readonly buffer: Buffer; + readonly _buf: Buffer; + readonly _size: number; + _offset: number; + + constructor(options?: { + size: number; + growthFactor: number; + }); + + endSequence(): void; + startSequence(tag?: number): void; + writeBoolean(b: boolean, tag?: number): void; + writeBuffer(buf: Buffer, tag: number): void; + writeByte(b: number): void; + writeEnumeration(i: number, tag?: number): void; + writeInt(i: number, tag?: number): void; + writeLength(len: number): void; + writeNull(): void; + writeOID(s: string, tag: number): void; + writeString(s: string, tag?: number): void; + writeStringArray(strings: ReadonlyArray): void; + _ensure(length: number): void; +} + +export namespace Ber { + const BMPString: number; + const BitString: number; + const Boolean: number; + const CharacterString: number; + const Constructor: number; + const Context: number; + const EOC: number; + const Enumeration: number; + const External: number; + const GeneralString: number; + const GeneralizedTime: number; + const GraphicString: number; + const IA5String: number; + const Integer: number; + const Null: number; + const NumericString: number; + const OID: number; + const ObjectDescriptor: number; + const OctetString: number; + const PDV: number; + const PrintableString: number; + const Real: number; + const RelativeOID: number; + const Sequence: number; + const Set: number; + const T61String: number; + const UTCTime: number; + const UniversalString: number; + const Utf8String: number; + const VideotexString: number; + const VisibleString: number; +} +/* +declare enum BerType { + EOC = 0, + Boolean = 1, + Integer = 2, + BitString = 3, + OctetString = 4, + Null = 5, + OID = 6, + ObjectDescriptor = 7, + External = 8, + Real = 9, // float + Enumeration = 10, + PDV = 11, + Utf8String = 12, + RelativeOID = 13, + Sequence = 16, + Set = 17, + NumericString = 18, + PrintableString = 19, + T61String = 20, + VideotexString = 21, + IA5String = 22, + UTCTime = 23, + GeneralizedTime = 24, + GraphicString = 25, + VisibleString = 26, + GeneralString = 28, + UniversalString = 29, + CharacterString = 30, + BMPString = 31, + Constructor = 32, + Context = 128, +} + +*/ diff --git a/types/asn1/tsconfig.json b/types/asn1/tsconfig.json new file mode 100644 index 0000000000..fd1bdc45d9 --- /dev/null +++ b/types/asn1/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noUnusedParameters": true, + + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "asn1-tests.ts" + ] +} \ No newline at end of file diff --git a/types/asn1/tslint.json b/types/asn1/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/asn1/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/assert/assert-tests.ts b/types/assert/assert-tests.ts index 22248c18bd..3f795f0552 100644 --- a/types/assert/assert-tests.ts +++ b/types/assert/assert-tests.ts @@ -5,6 +5,7 @@ assert(true, "it's working"); assert.ok(true, "inner functions work as well"); assert.throws(() => {}); +assert.throws(() => {}, /Regex test/); 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 index d79805f5af..f04158bbd3 100644 --- a/types/assert/index.d.ts +++ b/types/assert/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for commonjs-assert 1.4 // Project: https://github.com/browserify/commonjs-assert // Definitions by: Nico Gallinal +// Linus Unnebäck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare function assert(value: any, message?: string): void; @@ -23,10 +24,10 @@ declare namespace assert { 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 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 doesNotThrow(block: () => void, error: (() => void) | ((err: any) => boolean) | RegExp, message?: string): void; function ifError(value: any): void; 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-busboy/async-busboy-tests.ts b/types/async-busboy/async-busboy-tests.ts new file mode 100644 index 0000000000..ee81ca8a8c --- /dev/null +++ b/types/async-busboy/async-busboy-tests.ts @@ -0,0 +1,16 @@ +import Koa = require('koa'); +import asyncBusboy = require('async-busboy'); + +async function middleware(ctx: Koa.Context, next: () => Promise) { + const {files, fields} = await asyncBusboy(ctx.req); +} + +async function middleware2(ctx: Koa.Context, next: () => Promise) { + const {fields} = await asyncBusboy(ctx.req, { + limits: { + fileSize: 2 * 1024 * 1024, + }, + onFile: (fieldname: string, file: NodeJS.ReadableStream, filename: string, encoding: string, mimetype: string) => { + } + }); +} diff --git a/types/async-busboy/index.d.ts b/types/async-busboy/index.d.ts new file mode 100644 index 0000000000..ed92d2717a --- /dev/null +++ b/types/async-busboy/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for async-busboy 0.7 +// Project: https://github.com/m4nuC/async-busboy#readme +// Definitions by: Hiroshi Ioka +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as fs from 'fs'; +import * as http from 'http'; + +import busboy = require('busboy'); + +interface Options extends busboy.BusboyConfig { + onFile: ( + fieldname: string, + file: NodeJS.ReadableStream, + filename: string, + encoding: string, + mimetype: string) => void; +} + +type AsyncBusboy = ( + req: http.IncomingMessage, + options?: Options +) => Promise<{fields: {[key: string]: any}; files?: fs.ReadStream[]}>; + +declare const asyncBusboy: AsyncBusboy; + +export = asyncBusboy; diff --git a/types/async-busboy/tsconfig.json b/types/async-busboy/tsconfig.json new file mode 100644 index 0000000000..6dbcd063c5 --- /dev/null +++ b/types/async-busboy/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", + "async-busboy-tests.ts" + ] +} diff --git a/types/async-busboy/tslint.json b/types/async-busboy/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/async-busboy/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 961dd73ebb..05d99e5968 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -1,35 +1,52 @@ -// Type definitions for Async 2.0.1 +// Type definitions for Async 2.4 // Project: https://github.com/caolan/async -// Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman , Angus Fenying , Pascal Martin +// Definitions by: Boris Yankov +// Arseniy Maximov +// Joe Herman +// Angus Fenying +// Pascal Martin +// Dmitri Trofimov // 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 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 type AsyncAutoTasks, E> = { [K in keyof R]: AsyncAutoTask }; +export type AsyncAutoTask, E> = AsyncAutoTaskFunctionWithoutDependencies | Array>; +export interface AsyncAutoTaskFunctionWithoutDependencies { (cb: AsyncResultCallback | ErrorCallback): void; } +export interface AsyncAutoTaskFunction, E = Error> { (results: R, cb: AsyncResultCallback | ErrorCallback): void; } + +export interface DataContainer { + data: T; +} + +export interface CallbackContainer { + callback: Function; +} + +export interface PriorityContainer { + priority: number; +} export interface AsyncQueue { length(): number; @@ -37,20 +54,17 @@ 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; + remove(filter: (node: DataContainer) => boolean): void; saturated: () => any; empty: () => any; drain: () => any; paused: boolean; - pause(): void + pause(): void; resume(): void; kill(): void; - workersList(): { - data: T, - callback: Function - }[]; + workersList, CallbackContainer>(): TWorker[]; error(error: Error, data: any): void; unsaturated(): void; buffer: number; @@ -61,7 +75,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; @@ -70,11 +84,7 @@ export interface AsyncPriorityQueue { pause(): void; resume(): void; kill(): void; - workersList(): { - data: T, - priority: number, - callback: Function - }[]; + workersList, CallbackContainer, PriorityContainer>(): TWorker[]; error(error: Error, data: any): void; unsaturated(): void; buffer: number; @@ -83,7 +93,7 @@ export interface AsyncPriorityQueue { export interface AsyncCargo { length(): number; payload?: number; - push(task: any, callback? : Function): void; + push(task: any, callback?: Function): void; saturated(): void; empty(): void; drain(): void; @@ -94,112 +104,137 @@ 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 | 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: Array>, 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 | { + 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: Array>): Array<(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 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 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 race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : 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: Array>, callback: AsyncResultCallback): void; // Utils export function memoize(fn: Function, hasher?: Function): Function; diff --git a/types/async/test/es6-generators.ts b/types/async/test/es6-generators.ts index b67e7daad7..e0008d7d5e 100644 --- a/types/async/test/es6-generators.ts +++ b/types/async/test/es6-generators.ts @@ -10,45 +10,45 @@ function eachOfIterator(item: T, key: K, callback: (err: Error) => void function concatIterator(item: T, callback: (err: E, res: R[]) => void) { } -async.map(collectionGenerator(), funcMapIterator, funcMapComplete) -async.mapSeries(collectionGenerator(), funcMapIterator, funcMapComplete) -async.mapLimit(collectionGenerator(), 2, funcMapIterator, funcMapComplete) +async.map(collectionGenerator(), funcMapIterator, funcMapComplete); +async.mapSeries(collectionGenerator(), funcMapIterator, funcMapComplete); +async.mapLimit(collectionGenerator(), 2, funcMapIterator, funcMapComplete); -async.filter(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.filterSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.filterLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) -async.select(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.selectSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.selectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) +async.filter(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.filterSeries(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.filterLimit(collectionGenerator(), 2, booleanIterator, (err: Error, results: any[]) => { }); +async.select(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.selectSeries(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.selectLimit(collectionGenerator(), 2, booleanIterator, (err: Error, results: any[]) => { }); -async.reject(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.rejectSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.rejectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) +async.reject(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.rejectSeries(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.rejectLimit(collectionGenerator(), 2, booleanIterator, (err: Error, results: any[]) => { }); -async.each(collectionGenerator(), eachIterator, function (err: Error) { }) -async.eachLimit(collectionGenerator(), 2, eachIterator, function (err: Error) { }) -async.eachSeries(collectionGenerator(), eachIterator, function (err: Error) { }) -async.eachOf(collectionGenerator(), eachOfIterator, function (err: Error) { }) -async.eachOfLimit(collectionGenerator(), 2, eachOfIterator, function (err: Error) { }) -async.eachOfSeries(collectionGenerator(), eachOfIterator, function (err: Error) { }) -async.forEach(collectionGenerator(), eachIterator, function (err: Error) { }) -async.forEachLimit(collectionGenerator(), 2, eachIterator, function (err: Error) { }) -async.forEachSeries(collectionGenerator(), eachIterator, function (err: Error) { }) -async.forEachOf(collectionGenerator(), eachOfIterator, function (err: Error) { }) -async.forEachOfLimit(collectionGenerator(), 2, eachOfIterator, function (err: Error) { }) -async.forEachOfSeries(collectionGenerator(), eachOfIterator, function (err: Error) { }) +async.each(collectionGenerator(), eachIterator, (err: Error) => { }); +async.eachLimit(collectionGenerator(), 2, eachIterator, (err: Error) => { }); +async.eachSeries(collectionGenerator(), eachIterator, (err: Error) => { }); +async.eachOf(collectionGenerator(), eachOfIterator, (err: Error) => { }); +async.eachOfLimit(collectionGenerator(), 2, eachOfIterator, (err: Error) => { }); +async.eachOfSeries(collectionGenerator(), eachOfIterator, (err: Error) => { }); +async.forEach(collectionGenerator(), eachIterator, (err: Error) => { }); +async.forEachLimit(collectionGenerator(), 2, eachIterator, (err: Error) => { }); +async.forEachSeries(collectionGenerator(), eachIterator, (err: Error) => { }); +async.forEachOf(collectionGenerator(), eachOfIterator, (err: Error) => { }); +async.forEachOfLimit(collectionGenerator(), 2, eachOfIterator, (err: Error) => { }); +async.forEachOfSeries(collectionGenerator(), eachOfIterator, (err: Error) => { }); -async.every(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) -async.everyLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) -async.everySeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.every(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); +async.everyLimit(collectionGenerator(), 2, booleanIterator, (err: Error, res: boolean) => { }); +async.everySeries(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); -async.some(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) -async.someLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) -async.someSeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.some(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); +async.someLimit(collectionGenerator(), 2, booleanIterator, (err: Error, res: boolean) => { }); +async.someSeries(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); -async.detect(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) -async.detectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) -async.detectSeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.detect(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); +async.detectLimit(collectionGenerator(), 2, booleanIterator, (err: Error, res: boolean) => { }); +async.detectSeries(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); -async.concat(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }) -async.concatSeries(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }) +async.concat(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }); +async.concatSeries(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }); diff --git a/types/async/test/explicit.ts b/types/async/test/explicit.ts index 0c0e1a44ee..ae97888531 100644 --- a/types/async/test/explicit.ts +++ b/types/async/test/explicit.ts @@ -1,74 +1,58 @@ - - interface StringCallback { (err?: Error, result?: string): void; } interface AsyncStringGetter { (callback: StringCallback): void; } -var taskArray: AsyncStringGetter[] = [ - function (callback) { - setTimeout(function () { - callback(undefined, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(undefined, 'two'); - }, 100); - }, +const taskArray: AsyncStringGetter[] = [ + callback => { setTimeout(() => { callback(undefined, 'one'); }, 200); }, + callback => { setTimeout(() => { callback(undefined, 'two'); }, 100); } ]; -async.series(taskArray, function (err, results) { +async.series(taskArray, (err, results) => { if (results) { - let first = results[0]; + const first = results[0]; if (first) { - console.log(first.match(/o/)) - } - } -}); -async.parallel(taskArray, function (err, results) { - if (results) { - let first = results[0]; - if (first) { - console.log(first.match(/o/)) - } - } -}); -async.parallelLimit(taskArray, 3, function (err, results) { - if (results) { - let first = results[0]; - if (first) { - console.log(first.match(/o/)) + console.log(first.match(/o/)); } } }); +async.parallel(taskArray, (err, results) => { + if (results) { + const first = results[0]; + if (first) { + console.log(first.match(/o/)); + } + } +}); + +async.parallelLimit(taskArray, 3, (err, results) => { + if (results) { + const first = results[0]; + if (first) { + console.log(first.match(/o/)); + } + } +}); interface Lookup { [key: string]: T; } interface NumberCallback { (err?: Error, result?: number): void; } interface AsyncNumberGetter { (callback: NumberCallback): void; } -var taskDict: Lookup = { - one: function(callback) { - setTimeout(function() { - callback(undefined, 1); - }, 200); - }, - two: function(callback) { - setTimeout(function() { - callback(undefined, 2); - }, 100); - } -} +const taskDict: Lookup = { + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } +}; -async.series(taskDict, function(err, results) { - let one = results['one']; - console.log(one && one.toFixed(1)) -}); -async.parallel(taskDict, function(err, results) { - let one = results['one']; - console.log(one && one.toFixed(1)) -}); -async.parallelLimit(taskDict, 3, function(err, results) { - let one = results['one']; - console.log(one && one.toFixed(1)) +async.series(taskDict, (err, results) => { + const one = results['one']; + console.log(one && one.toFixed(1)); }); +async.parallel(taskDict, (err, results) => { + const one = results['one']; + console.log(one && one.toFixed(1)); +}); + +async.parallelLimit(taskDict, 3, (err, results) => { + const one = results['one']; + console.log(one && one.toFixed(1)); +}); diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 3c6c2f5dfe..97e888870b 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -9,408 +9,303 @@ declare var path: { exists: (path: string, callback?: (err: Error, exists: boolean) => any) => void; }; -function funcStringCbErrBoolean(v:string, cb:(err:Error,res:boolean) => void) {} +function funcStringCbErrBoolean(v: string, cb: (err: Error, res: boolean) => void) {} function callback() { } -async.map(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); -async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); -async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, function (err:Error, results:Array) { }); +async.map(['file1', 'file2', 'file3'], fs.stat, (err: Error, results: fs.Stats[]) => { }); +async.mapSeries(['file1', 'file2', 'file3'], fs.stat, (err: Error, results: fs.Stats[]) => { }); +async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, (err: Error, results: fs.Stats[]) => { }); -async.filter(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.filterSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.filterLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.select(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.selectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.selectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.filter(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.filterSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.filterLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.select(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.selectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.selectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, results: string[]) => { }); -async.reject(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.rejectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.rejectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.reject(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.rejectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.rejectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, results: string[]) => { }); async.parallel([ - function () { }, - function () { } + () => { }, + () => { } ], callback); async.series([ - function () { }, - function () { } + () => { }, + () => { } ]); -var data: any[] = []; +const data: any[] = []; function asyncProcess(item: any, callback: (err: Error, result: any) => void) { } -async.map(data, asyncProcess, function (err, results) { - console.log(results); -}); +async.map(data, asyncProcess, (err, results) => { console.log(results); }); -var openFiles = ['file1', 'file2']; -var openFilesObj = { +const openFiles = ['file1', 'file2']; +const openFilesObj = { file1: "fileOne", file2: "fileTwo" -} +}; -var saveFile = function (file:string,cb:(err:Error)=>void) { } -async.each(openFiles, saveFile, function (err:Error) { }); -async.eachSeries(openFiles, saveFile, function (err:Error) { }); +const saveFile = (file: string, cb: (err: Error) => void) => { }; +async.each(openFiles, saveFile, (err: Error) => { }); +async.eachSeries(openFiles, saveFile, (err: Error) => { }); -var documents: any, requestApi: any; -async.eachLimit(documents, 20, requestApi, function (err) { }); +const documents: any[] = []; +const requestApi: async.AsyncIterator = () => { }; +async.eachLimit(documents, 20, requestApi, err => { }); // forEachOf* functions. May accept array or object. function forEachOfIterator(item: string, key: string, forEachOfIteratorCallback: any) { - console.log("ForEach: item=" + item + ", key=" + key); + console.log(`ForEach: item=${item}, key=${key}`); forEachOfIteratorCallback(); } -async.forEachOf(openFiles, forEachOfIterator, function (err) { }); -async.forEachOf(openFilesObj, forEachOfIterator, function (err) { }); -async.forEachOfSeries(openFiles, forEachOfIterator, function (err) { }); -async.forEachOfSeries(openFilesObj, forEachOfIterator, function (err) { }); -async.forEachOfLimit(openFiles, 2, forEachOfIterator, function (err) { }); -async.forEachOfLimit(openFilesObj, 2, forEachOfIterator, function (err) { }); +async.forEachOf(openFiles, forEachOfIterator, err => { }); +async.forEachOf(openFilesObj, forEachOfIterator, err => { }); +async.forEachOfSeries(openFiles, forEachOfIterator, err => { }); +async.forEachOfSeries(openFilesObj, forEachOfIterator, err => { }); +async.forEachOfLimit(openFiles, 2, forEachOfIterator, err => { }); +async.forEachOfLimit(openFilesObj, 2, forEachOfIterator, err => { }); -var numArray = [1, 2, 3]; +const numArray = [1, 2, 3]; function reducer(memo: any, item: any, callback: any) { - process.nextTick(function () { - callback(null, memo + item) - }); + process.nextTick(() => { callback(null, memo + item); }); } -async.reduce(numArray, 0, reducer, function (err, result) { }); -async.inject(numArray, 0, reducer, function (err, result) { }); -async.foldl(numArray, 0, reducer, function (err, result) { }); -async.reduceRight(numArray, 0, reducer, function (err, result) { }); -async.foldr(numArray, 0, reducer, function (err, result) { }); -async.detect(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err: Error,result:string) { }); -async.detectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err,result) { }); -async.detectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err,result) { }); +async.reduce(numArray, 0, reducer, (err, result) => { }); +async.inject(numArray, 0, reducer, (err, result) => { }); +async.foldl(numArray, 0, reducer, (err, result) => { }); +async.reduceRight(numArray, 0, reducer, (err, result) => { }); +async.foldr(numArray, 0, reducer, (err, result) => { }); -async.sortBy(['file1', 'file2', 'file3'], function (file, callback) { - fs.stat(file, function (err, stats) { - callback(err, stats.mtime); - }); -}, function (err, results) { }); +async.detect(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: string) => { }); +async.detectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err, result) => { }); +async.detectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err, result) => { }); -async.some(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.someLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.any(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); +async.sortBy(['file1', 'file2', 'file3'], (file, callback) => { + fs.stat(file, (err, stats) => { callback(err, stats.mtime); }); +}, (err, results) => { }); -async.every(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.everyLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.all(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); +async.some(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.someLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.any(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: boolean) => { }); -async.concat(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { }); -async.concatSeries(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { }); +async.every(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.everyLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.all(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.concat(['dir1', 'dir2', 'dir3'], fs.readdir, (err, files) => { }); +async.concatSeries(['dir1', 'dir2', 'dir3'], fs.readdir, (err, files) => { }); // Control Flow // -async.series([ - function (callback) { - callback(undefined, 'one'); - }, - function (callback) { - callback(undefined, 'two'); - }, -], -function (err, results) { }); - -async.series([ - function (callback) { - callback(undefined, 'one'); - }, - function (callback) { - callback(undefined, 'two'); - }, -], -function (err, results) { }); +async.series([callback => { callback(undefined, 'one'); }, callback => { callback(undefined, 'two'); }], (err, results) => { }); +async.series([callback => { callback(undefined, 'one'); }, callback => { callback(undefined, 'two'); }], (err, results) => { }); async.series({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); + (err, results) => { }); -async.series({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); +async.series({ + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); + (err, results) => { }); -async.times(5, function(n, next) { - next(undefined as any, n) -}, function(err, results) { - console.log(results) -}) +async.times(5, (n, next) => { next(undefined as any, n); }, (err, results) => { console.log(results); }); -async.timesSeries(5, function(n, next) { - next(undefined as any, n) -}, function(err, results) { - console.log(results) -}) +async.timesSeries(5, (n, next) => { next(undefined as any, n); }, (err, results) => { console.log(results); }); async.parallel([ - function (callback) { - setTimeout(function () { - callback(undefined, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(undefined, 'two'); - }, 100); - }, -], -function (err, results) { }); - -async.parallel([ - function (callback) { - setTimeout(function () { - callback(undefined, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(undefined, 'two'); - }, 100); - }, -], -function (err, results) { }); + callback => { setTimeout(() => { callback(undefined, 'one'); }, 200); }, + callback => { setTimeout(() => { callback(undefined, 'two'); }, 100); } + ], + (err, results) => { }); +async.parallel([ + callback => { setTimeout(() => { callback(undefined, 'one'); }, 200); }, + callback => { setTimeout(() => { callback(undefined, 'two'); }, 100); } + ], + (err, results) => { }); async.parallel({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); + (err, results) => { }); -async.parallel({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); +async.parallel({ + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, - function (err, results) { }); + (err, results) => { }); async.parallelLimit({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, 2, - function (err, results) { } + (err, results) => { } ); - function whileFn(callback: any) { setTimeout(() => callback(null, ++count), 1000); } function whileTest() { return count < 5; } function doWhileTest(count: number) { return count < 5; } -var count = 0; -async.whilst(whileTest, whileFn, function (err) { }); -async.until(whileTest, whileFn, function (err) { }); -async.doWhilst(whileFn, doWhileTest, function (err) { }); -async.doUntil(whileFn, doWhileTest, function (err) { }); -async.during(function (testCallback) { testCallback(new Error(), false); }, function (callback) { callback() }, function (error) { console.log(error) }); -async.doDuring(function (callback) { callback() }, function (testCallback) { testCallback(new Error(), false); }, function (error) { console.log(error) }); -async.forever(function (errBack) { - errBack(new Error("Not going on forever.")); -}, - function (error) { - console.log(error); - } -); +let count = 0; +async.whilst(whileTest, whileFn, err => { }); +async.until(whileTest, whileFn, err => { }); +async.doWhilst(whileFn, doWhileTest, err => { }); +async.doUntil(whileFn, doWhileTest, err => { }); + +async.during(testCallback => { testCallback(new Error(), false); }, callback => { callback(); }, error => { console.log(error); }); +async.doDuring(callback => { callback(); }, testCallback => { testCallback(new Error(), false); }, error => { console.log(error); }); +async.forever(errBack => { errBack(new Error("Not going on forever.")); }, error => { console.log(error); }); async.waterfall([ - function (callback: any) { - callback(null, 'one', 'two'); - }, - function (arg1: any, arg2: any, callback: any) { - callback(null, 'three'); - }, - function (arg1: any, callback: any) { - callback(null, 'done'); - } -], function (err, result) { }); + (callback: any) => { callback(null, 'one', 'two'); }, + (arg1: any, arg2: any, callback: any) => { callback(null, 'three'); }, + (arg1: any, callback: any) => { callback(null, 'done'); } + ], + (err, result) => { }); - -var q = async.queue(function (task: any, callback: (err?:Error,msg?:string) => void) { +const q = async.queue((task: any, callback: (err?: Error, msg?: string) => void) => { console.log('hello ' + task.name); - callback(undefined,'a message.'); + callback(undefined, 'a message.'); }, 2); - -q.drain = function () { - console.log('all items have been processed'); -} +q.drain = () => { console.log('all items have been processed'); }; q.push({ name: 'foo' }); - -q.push({ name: 'bar' }, function (err) { - console.log('finished processing bar'); -}); - -q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { - console.log('finished processing bar'); -}); - -q.push({name: 'foo'}, function (err,msg) { - console.log('foo finished with a message "'+ msg! + '"'); -}); +q.push({ name: 'bar' }, err => { console.log('finished processing bar'); }); +q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], err => { console.log('finished processing bar'); }); +q.push({name: 'foo'}, (err, msg) => { console.log(`foo finished with a message "${msg!}"`); }); q.unshift({ name: 'foo' }); +q.unshift({ name: 'bar' }, err => { console.log('finished processing bar'); }); +q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], err => { console.log('finished processing bar'); }); -q.unshift({ name: 'bar' }, function (err) { - console.log('finished processing bar'); -}); +const qLength: number = q.length(); +const qStarted: boolean = q.started; +const qPaused: boolean = q.paused; +const qProcessingCount: number = q.running(); +const qIsIdle: boolean = q.idle(); -q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { - console.log('finished processing bar'); -}); +q.saturated = () => { console.log('queue is saturated.'); }; -var qLength : number = q.length(); -var qStarted : boolean = q.started; -var qPaused : boolean = q.paused; -var qProcessingCount : number = q.running(); -var qIsIdle : boolean = q.idle(); +q.empty = () => { console.log('queue is empty.'); }; -q.saturated = function() { - console.log('queue is saturated.'); -} - -q.empty = function() { - console.log('queue is empty.'); -} - -q.drain = function() { - console.log('queue was drained.'); -} +q.drain = () => { console.log('queue was drained.'); }; q.pause(); q.resume(); q.kill(); // tests for strongly typed tasks -var q2 = async.queue(function (task: string, callback: () => void) { +const q2 = async.queue((task: string, callback: () => void) => { console.log('Task: ' + task); callback(); }, 1); q2.push('task1'); - -q2.push('task2', function (error) { - console.log('Finished tasks'); -}); - -q2.push(['task3', 'task4', 'task5'], function (error) { - console.log('Finished tasks'); -}); +q2.push('task2', error => { console.log('Finished tasks'); }); +q2.push(['task3', 'task4', 'task5'], error => { console.log('Finished tasks'); }); q2.unshift('task1'); +q2.unshift('task2', error => { console.log('Finished tasks'); }); +q2.unshift(['task3', 'task4', 'task5'], error => { console.log('Finished tasks'); }); -q2.unshift('task2', function (error) { - console.log('Finished tasks'); -}); +const q2Length = q2.length(); +q2.push('testRemovalTask'); +q2.remove(x => x.data === 'testTaskRemoval'); +if (q2Length !== q2.length()) { + throw new Error('Failed to remove a task from queue.'); +} -q2.unshift(['task3', 'task4', 'task5'], function (error) { - console.log('Finished tasks'); -}); - - -var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { +const aq = async.queue((level: number, callback: (error?: Error, newLevel?: number) => void) => { console.log('hello ' + level); - callback(undefined, level+1); + callback(undefined, level + 1); }); -aq.push(1, function (err : Error, newLevel : number) { +aq.push(1, (err: Error, newLevel: number) => { console.log('finished processing bar' + newLevel); }); // create a cargo object with payload 2 -var cargo = async.cargo(function (tasks, callback) { - for (var i = 0; i < tasks.length; i++) { - console.log('hello ' + tasks[i].name); +const cargo = async.cargo((tasks, callback) => { + for (const task of tasks) { + console.log('hello ' + task.name); } callback(); }, 2); - // add some items -cargo.push({ name: 'foo' }, function (err: Error) { - console.log('finished processing foo'); -}); -cargo.push({ name: 'bar' }, function (err: Error) { - console.log('finished processing bar'); -}); -cargo.push({ name: 'baz' }, function (err: Error) { - console.log('finished processing baz'); -}); +cargo.push({ name: 'foo' }, (err: Error) => { console.log('finished processing foo'); }); +cargo.push({ name: 'bar' }, (err: Error) => { console.log('finished processing bar'); }); +cargo.push({ name: 'baz' }, (err: Error) => { console.log('finished processing baz'); }); -var filename = ''; +const filename = ''; async.auto({ - get_data: function (callback: any) { }, - make_folder: function (callback: any) { }, - //arrays with different types are not accepted by TypeScript. - write_file: ['get_data', 'make_folder', function (callback: any) { + get_data: (callback: AsyncResultCallback) => { }, + make_folder: (callback: AsyncResultCallback) => { }, + + // arrays with different types are not accepted by TypeScript. + write_file: ['get_data', 'make_folder', ((callback: AsyncResultCallback) => { callback(null, filename); - }], - //arrays with different types are not accepted by TypeScript. - email_link: ['write_file', function (callback: any, results: any) { }] + }) as any], + + // arrays with different types are not accepted by TypeScript. + email_link: ['write_file', ((callback: AsyncResultCallback, results: any) => { }) as any] }); -async.retry(3, function (callback, results) { }, function (err, result) { }); -async.retry({ times: 3, interval: 200 }, function (callback, results) { }, function (err, result) { }); -async.retry({ times: 3, interval: (retryCount) => { return 200 * retryCount; } }, function (callback, results) { }, function (err, result) { }); +async.auto({ + get_data: (callback: AsyncResultCallback) => { }, + make_folder: (callback: AsyncResultCallback) => { }, + // arrays with different types are not accepted by TypeScript. + write_file: ['get_data', 'make_folder', ((callback: AsyncResultCallback) => { callback(null, filename); }) as any], + + // arrays with different types are not accepted by TypeScript. + email_link: ['write_file', ((callback: AsyncResultCallback, results: any) => { }) as any] + }, + (err, results) => { console.log('finished auto'); } +); + +interface A { + get_data: any; + make_folder: any; + write_file: any; + email_link: any; +} + +async.auto({ + get_data: (callback: AsyncResultCallback) => { }, + make_folder: (callback: AsyncResultCallback) => { }, + + // arrays with different types are not accepted by TypeScript. + write_file: ['get_data', 'make_folder', ((callback: AsyncResultCallback) => { callback(null, filename); }) as any], + + // arrays with different types are not accepted by TypeScript. + email_link: ['write_file', ((callback: AsyncResultCallback, results: any) => { }) as any] + }, + 1, + (err, results) => { console.log('finished auto'); } +); + +async.retry(3, (callback, results) => { }, (err, result) => { }); +async.retry({ times: 3, interval: 200 }, (callback, results) => { }, (err, result) => { }); +async.retry({ times: 3, interval: (retryCount) => 200 * retryCount }, (callback, results) => { }, (err, result) => { }); async.parallel([ - function (callback: ( err:Error, val:string ) => void ) { }, - function (callback) { } -], -function (err:Error,results:Array) { - async.series([ - function (callback) { }, - function email_link(callback) { } - ]); + (callback: (err: Error, val: string) => void) => { }, + callback => { } + ], + (err: Error, results: string[]) => { async.series([callback => { }, function email_link(callback) { }]); }); async.parallel([ @@ -418,428 +313,281 @@ async.parallel([ async.apply(fs.writeFile, 'testfile2', 'test2'), ]); - async.parallel([ - function (callback) { - fs.writeFile('testfile1', 'test1', callback); - }, - function (callback) { - fs.writeFile('testfile2', 'test2', callback); - }, + callback => { fs.writeFile('testfile1', 'test1', callback); }, + callback => { fs.writeFile('testfile2', 'test2', callback); } ]); -var call_order: string[] = []; -async.nextTick(function () { - call_order.push('two'); -}); +const call_order: string[] = []; +async.nextTick(() => { call_order.push('two'); }); call_order.push('one'); -var slow_fn = function (name: string, callback: any) { - callback(null, 123); -}; -var fn = async.memoize(slow_fn); -fn('some name', function () {}); +const slow_fn = (name: string, callback: any) => { callback(null, 123); }; +const fn = async.memoize(slow_fn); + +fn('some name', () => { }); async.unmemoize(fn); -async.ensureAsync(function () { }); +async.ensureAsync(() => { }); async.constant(42); -async.asyncify(function () { }); +async.asyncify(() => { }); -async.log(function (name: any, callback: any) { - setTimeout(function () { - callback(null, 'hello ' + name); - }, 0); -}, "world" - ); +async.log( + (name: any, callback: any) => { setTimeout(() => { callback(null, 'hello ' + name); }, 0); }, + "world"); -async.dir(function (name: string, callback: any) { - setTimeout(function () { - callback(null, { hello: name }); - }, 1000); -}, "world"); +async.dir((name: string, callback: any) => { setTimeout(() => { callback(null, { hello: name }); }, 1000); }, "world"); // each -async.each({ - "a": 1, - "b": 2 -}, function(val: number, next: ErrorCallback): void { +async.each( + { a: 1, b: 2 }, + (val: number, next: ErrorCallback) => { + setTimeout(() => { + console.log(`async.each: ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.each: done."); } +); - setTimeout(function(): void { +async.eachSeries( + { a: 1, b: 2 }, + (val: number, next: ErrorCallback) => { + setTimeout( + () => { + console.log(`async.eachSeries: ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.eachSeries: done."); } +); - console.log(`async.each: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.each: done."); - -}); - -async.eachSeries({ - "a": 1, - "b": 2 -}, function(val: number, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.eachSeries: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.eachSeries: done."); - -}); - -async.eachLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.eachLimit: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.eachLimit: done."); - -}); +async.eachLimit( + { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }, + 2, + (val: number, next: ErrorCallback) => { + setTimeout(() => { + console.log(`async.eachLimit: ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.eachLimit: done."); } +); // forEachOf/eachOf -async.eachOf({ - "a": 1, - "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { +async.eachOf( + { a: 1, b: 2 }, + (val: number, key: string, next: ErrorCallback) => { + setTimeout( + () => { + console.log(`async.forEachOf/eachOf: ${key} = ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.forEachOf/eachOf: done."); } +); - setTimeout(function(): void { +async.forEachOfSeries( + { a: 1, b: 2 }, + (val: number, key: string, next: ErrorCallback) => { + setTimeout( + () => { + console.log(`async.forEachOfSeries: ${key} = ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.forEachOfSeries: done."); } +); - console.log(`async.forEachOf/eachOf: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOf/eachOf: done."); - -}); - -async.forEachOfSeries({ - "a": 1, - "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.forEachOfSeries: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOfSeries: done."); - -}); - -async.forEachOfLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, key: string, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.forEachOfLimit: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOfLimit: done."); - -}); +async.forEachOfLimit( + { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }, + 2, + (val: number, key: string, next: ErrorCallback) => { + setTimeout( + () => { + console.log(`async.forEachOfLimit: ${key} = ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.forEachOfLimit: done."); } +); // map -async.map({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncResultCallback): void { +async.map( + { a: 1, b: 2, c: 3 }, + (val: number, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.map: ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: string[]) => { console.log("async.map: done with results", results); } +); - setTimeout(function(): void { +async.mapSeries( + { a: 1, b: 2, c: 3 }, + (val: number, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.mapSeries: ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: string[]) => { console.log("async.mapSeries: done with results", results); } +); - console.log(`async.map: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.map: done with results", results); - -}); - -async.mapSeries({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapSeries: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.mapSeries: done with results", results); - -}); - -async.mapLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapLimit: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.mapLimit: done with results", results); - -}); +async.mapLimit( + { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }, + 2, + (val: number, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.mapLimit: ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: string[]) => { console.log("async.mapLimit: done with results", results); } +); // mapValues -async.mapValues({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { +async.mapValues( + { a: 1, b: 2, c: 3 }, + (val: number, key: string, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.mapValues: ${key} = ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: Dictionary) => { console.log("async.mapValues: done with results", results); } +); - setTimeout(function(): void { - - console.log(`async.mapValues: ${key} = ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: Dictionary): void { - - console.log("async.mapValues: done with results", results); - -}); - -async.mapValuesSeries({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapValuesSeries: ${key} = ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: Dictionary): void { - - console.log("async.mapValuesSeries: done with results", results); - -}); +async.mapValuesSeries( + { a: 1, b: 2, c: 3 }, + (val: number, key: string, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.mapValuesSeries: ${key} = ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: Dictionary) => { console.log("async.mapValuesSeries: done with results", results); } +); // filter/select/reject -async.filter({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { +async.filter( + { a: 1, b: 2, c: 3 }, + (val: number, next: AsyncBooleanResultCallback) => { + setTimeout( + () => { + console.log(`async.filter/select: ${val}`); + next(undefined as any, val % 2 === 0); + }, + 500); + }, + (err: Error, results: number[]) => { console.log("async.filter/select: done with results", results); } +); - setTimeout(function(): void { - - console.log(`async.filter/select: ${val}`); - - next(undefined as any, val % 2 === 0); - - }, 500); - -}, function(err: Error, results: number[]): void { - - console.log("async.filter/select: done with results", results); - -}); - -async.reject({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.reject: ${val}`); - - next(undefined as any, val % 2 === 0); - - }, 500); - -}, function(err: Error, results: number[]): void { - - console.log("async.reject: done with results", results); - -}); +async.reject( + { a: 1, b: 2, c: 3 }, + (val: number, next: AsyncBooleanResultCallback) => { + setTimeout( + () => { + console.log(`async.reject: ${val}`); + next(undefined as any, val % 2 === 0); + }, + 500); + }, + (err: Error, results: number[]) => { console.log("async.reject: done with results", results); } +); // concat -async.concat({ - "a": "1", - "b": "2", - "c": "3" -}, function(item: string, next: AsyncResultCallback): void { - - console.log(`async.concat: ${item}`); - - next(undefined as any, [item, item, item]); - -}, function(err: Error, results: string[]) { - - console.log("async.concat: done with results", results); - -}); +async.concat( + { a: "1", b: "2", c: "3" }, + (item: string, next: AsyncResultCallback) => { + console.log(`async.concat: ${item}`); + next(undefined as any, [item, item, item]); + }, + (err: Error, results: string[]) => { console.log("async.concat: done with results", results); } +); // detect/find -async.detect({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.detect/find: ${item}`); - - next(undefined as any, item > 1); - -}, function(err: Error, result: number) { - - if (err) { - - console.log(err); - - } else { - - console.log("async.detect/find: done with result", result); +async.detect( + { a: 1, b: 2, c: 3 }, + (item: number, next: AsyncBooleanResultCallback) => { + console.log(`async.detect/find: ${item}`); + next(undefined as any, item > 1); + }, + (err: Error, result: number) => { + if (err) { + console.log(err); + } else { + console.log("async.detect/find: done with result", result); + } } - -}); +); // every/all -async.every({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.every/all: ${item}`); - - next(undefined as any, item > 0); - -}, function(err: Error, result: boolean) { - - console.log("async.every/all: done with result", result); - -}); +async.every( + { a: 1, b: 2, c: 3 }, + (item: number, next: AsyncBooleanResultCallback) => { + console.log(`async.every/all: ${item}`); + next(undefined as any, item > 0); + }, + (err: Error, result: boolean) => { console.log("async.every/all: done with result", result); } +); // some/any -async.some({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.some/any: ${item}`); - - next(undefined as any, item > 2); - -}, function(err: Error, result: boolean) { - - console.log("async.some/any: done with result", result); - -}); +async.some( + { a: 1, b: 2, c: 3 }, + (item: number, next: AsyncBooleanResultCallback) => { + console.log(`async.some/any: ${item}`); + next(undefined as any, item > 2); + }, + (err: Error, result: boolean) => { console.log("async.some/any: done with result", result); } +); // timeout -function myFunction1(foo : any, callback: (err?: Error, result?: any) => void ) : void { +function myFunction1(foo: any, callback: (err?: Error, result?: any) => void): void { console.log(`async.timeout 1 ${foo}`); - return callback(undefined, foo); + callback(undefined, foo); } -var wrapped1 = async.timeout(myFunction1, 1000); -wrapped1({ bar: 'bar' }, function(err : Error, data : any) { - console.log(`async.timeout 1 end ${data}`); -}); +const wrapped1 = async.timeout(myFunction1, 1000); +wrapped1({ bar: 'bar' }, (err: Error, data: any) => { console.log(`async.timeout 1 end ${data}`); }); - -function myFunction2(callback: (err?: Error, result?: any) => void ) : void { +function myFunction2(callback: (err?: Error, result?: any) => void): void { console.log(`async.timeout 2`); - return callback(undefined, { bar: 'bar' }); + callback(undefined, { bar: 'bar' }); } -var wrapped2 = async.timeout(myFunction2, 1000); -wrapped2( function(err : Error, data : any) { - console.log(`async.timeout 2 end ${data}`); -}); +const wrapped2 = async.timeout(myFunction2, 1000); +wrapped2((err: Error, data: any) => { console.log(`async.timeout 2 end ${data}`); }); -function myFunction3(callback: (err?: Error, result?: any) => void ) : void { +function myFunction3(callback: (err?: Error, result?: any) => void): void { console.log(`async.timeout 3`); - return callback(undefined, { bar: 'bar' }); + callback(undefined, { bar: 'bar' }); } -var wrapped3 = async.timeout(myFunction3, 1000, { bar: 'bar' }); -wrapped3( function(err : Error, data : any) { - console.log(`async.timeout 3 end ${data}`); -}); - +const wrapped3 = async.timeout(myFunction3, 1000, { bar: 'bar' }); +wrapped3((err: Error, data: any) => { console.log(`async.timeout 3 end ${data}`); }); diff --git a/types/async/tslint.json b/types/async/tslint.json index 9380375afa..5612ed6657 100644 --- a/types/async/tslint.json +++ b/types/async/tslint.json @@ -1,34 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - // TODOs - "arrow-return-shorthand": false, - "array-type": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "max-line-length": false, - "no-consecutive-blank-lines": false, - "no-padding": false, - "no-unnecessary-generics": false, - "no-var-keyword": false, - "no-void-expression": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-const": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "trim-file": false, - "typedef-whitespace": false, - "unified-signatures": false, - "whitespace": false + "ban-types": true, // PRODUCES ERRORS WHEN REMOVED + "callable-types": false, // HAS ISSUES + "no-unnecessary-generics": false // HAS ISSUES } } 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/atlaskit__tree/atlaskit__tree-tests.tsx b/types/atlaskit__tree/atlaskit__tree-tests.tsx new file mode 100644 index 0000000000..b99647a7c6 --- /dev/null +++ b/types/atlaskit__tree/atlaskit__tree-tests.tsx @@ -0,0 +1,42 @@ +import Tree from "@atlaskit/tree"; + +import * as React from "react"; +import { render } from "react-dom"; + +declare const container: Element; + +render( +
} + onExpand={() => {}} + onCollapse={() => {}} + onDragStart={() => {}} + onDragEnd={() => {}} + offsetPerLevel={20} + isDragEnabled + isNestingEnabled + />, + container +); + +// Check that default props work too. +render(
} />, container); diff --git a/types/atlaskit__tree/index.d.ts b/types/atlaskit__tree/index.d.ts new file mode 100644 index 0000000000..4d6a952b76 --- /dev/null +++ b/types/atlaskit__tree/index.d.ts @@ -0,0 +1,153 @@ +// Type definitions for @atlaskit/tree 4.1 +// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/ +// Definitions by: Ben James +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +import { Component, ReactNode } from "react"; + +import { + DraggingStyle, + DraggableProvidedDragHandleProps, + DraggableStateSnapshot, + NotDraggingStyle +} from "react-beautiful-dnd"; + +export type ItemId = any; + +export type Path = number[]; + +export interface TreeData { + rootId: ItemId; + items: { [key: string]: TreeItem; [key: number]: TreeItem }; +} + +export type TreeItemData = any; + +export interface TreeItem { + id: ItemId; + children: ItemId[]; + hasChildren?: boolean; + isExpanded?: boolean; + isChildrenLoading?: boolean; + data?: TreeItemData; +} + +export interface TreeSourcePosition { + parentId: ItemId; + index: number; +} + +export interface TreeDestinationPosition { + parentId: ItemId; + index?: number; +} + +type Omit = Pick>; + +interface TreeDraggingStyle extends Omit { + paddingLeft: number; + transition: "none" | string; +} + +type TreeDraggableStyle = NotDraggingStyle | TreeDraggingStyle; + +interface TreeDraggableProps { + // Props that can be spread onto the element directly + // inline style + style?: TreeDraggableStyle; + // used for shared global styles + "data-react-beautiful-dnd-draggable": string; +} + +interface TreeDraggableProvided { + draggableProps: TreeDraggableProps; + // will be null if the draggable is disabled + dragHandleProps?: DraggableProvidedDragHandleProps; + // The following props will be removed once we move to react 16 + innerRef: (element?: HTMLElement) => void; +} + +export interface RenderItemParams { + item: TreeItem; + depth: number; + onExpand: (itemId: ItemId) => void; + onCollapse: (itemId: ItemId) => void; + provided: TreeDraggableProvided; + snapshot: DraggableStateSnapshot; +} + +interface TreeItemMutation { + id?: ItemId; + children?: ItemId[]; + hasChildren?: boolean; + isExpanded?: boolean; + isChildrenLoading?: boolean; + data?: TreeItemData; +} + +export function mutateTree( + tree: TreeData, + itemId: ItemId, + mutation: TreeItemMutation +): TreeData; + +export function moveItemOnTree( + tree: TreeData, + from: TreeSourcePosition, + to: TreeDestinationPosition +): TreeData; + +interface TreeProps { + /** The tree data structure. */ + tree: TreeData; + /** Function that will be called when a parent item needs to be expanded. */ + onExpand: (itemId: ItemId, path: Path) => void; + /** Function that will be called when a parent item needs to be collapsed. */ + onCollapse: (itemId: ItemId, path: Path) => void; + /** Function that will be called when the user starts dragging. */ + onDragStart: (itemId: ItemId) => void; + /** Function that will be called when the user finishes dragging. */ + onDragEnd: ( + sourcePosition: TreeSourcePosition, + destinationPosition: TreeDestinationPosition | undefined + ) => void; + /** Function that will be called to render a single item. */ + renderItem: (itemProps: RenderItemParams) => ReactNode; + /** Number of pixel is used to scaffold the tree by the consumer. */ + offsetPerLevel: number; + /** Boolean to turn on drag&drop re-ordering on the tree */ + isDragEnabled: boolean; + /** Boolean to turn on hovering while dragging */ + isNestingEnabled: boolean; +} + +interface FlattenedItem { + item: TreeItem; + path: Path; +} + +type FlattenedTree = FlattenedItem[]; + +interface TreeState { + /** The flattened tree data structure transformed from props.tree */ + flattenedTree: FlattenedTree; + // Id of the currently dragged item + draggedItemId: ItemId; +} + +declare class Tree extends Component { + static defaultProps: { + tree: { children: [] }; + onExpand: () => void; + onCollapse: () => void; + onDragStart: () => void; + onDragEnd: () => void; + renderItem: () => void; + offsetPerLevel: 35; + isDragEnabled: false; + isNestingEnabled: false; + }; +} + +export default Tree; diff --git a/types/atlaskit__tree/tsconfig.json b/types/atlaskit__tree/tsconfig.json new file mode 100644 index 0000000000..b6d581fa0d --- /dev/null +++ b/types/atlaskit__tree/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "paths": { + "@atlaskit/tree": ["atlaskit__tree"] + } + }, + "files": ["index.d.ts", "atlaskit__tree-tests.tsx"] +} diff --git a/types/atlaskit__tree/tslint.json b/types/atlaskit__tree/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/atlaskit__tree/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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..9a04b9c7b6 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -557,8 +557,8 @@ function testDesializerManager() { } function isStorableClass(o: object): o is StorableClass { - if (typeof o === "object" && ( o).name && - ( o).name === "test") { + if (typeof o === "object" && (o as StorableClass).name && + (o as StorableClass).name === "test") { return true; } else { return false; @@ -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/auth-header/tslint.json b/types/auth-header/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/auth-header/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index 6d21de4ed3..6353cc1e40 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -136,6 +136,12 @@ webAuth.passwordlessStart({ send: 'code' }, (err, data) => {}); +webAuth.passwordlessLogin({ + connection: 'the_connection', + phoneNumber: '123', + verificationCode: '456' +}, (err, data) => {}); + webAuth.signupAndAuthorize({ connection: 'the_connection', email: 'me@example.com', diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 3daca57647..7e43da1c89 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. @@ -269,6 +270,13 @@ export class WebAuth { */ passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback): void; + /** + * Logs in a user with the verification code sent to the user + * @param options + * @param callback + */ + passwordlessLogin(options: PasswordlessLoginOptions, callback: Auth0Callback): void; + /** * Renews an existing session on Auth0's servers using `response_mode=web_message` (i.e. Auth0's hosted login page) * @@ -482,7 +490,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,9 +530,46 @@ 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; + error: LibErrorCodes | SpecErrorCodes | string; + errorDescription: string; + // Need to include non-intuitive error fields that Auth0 uses code?: string; description?: string; name?: string; @@ -534,6 +579,10 @@ export interface Auth0Error { statusText?: string; } +export type Auth0ParseHashError = Auth0Error & { + state?: string; +}; + /** * The contents of the authResult object returned by {@link WebAuth#parseHash } */ @@ -581,6 +630,13 @@ export interface PasswordlessVerifyOptions { send?: string; } +export interface PasswordlessLoginOptions { + connection: string; + verificationCode: string; + phoneNumber?: string; + email?: string; +} + export interface Auth0UserProfile { name: string; nickname: string; @@ -764,6 +820,8 @@ export interface AuthorizeOptions { login_hint?: string; prompt?: string; mode?: "login" | "signUp"; + accessType?: string; + approvalPrompt?: string; } export interface CheckSessionOptions extends AuthorizeOptions { diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index 4b5c60e716..53c50dd98f 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -130,7 +130,8 @@ const otherOptions : Auth0LockConstructorOptions = { hashCleanup: false, leeway: 30, _enableImpersonation: true, - _enableIdPInitiatedLogin: false + _enableIdPInitiatedLogin: false, + defaultADUsernameFromEmailPrefix: false }; new Auth0Lock(CLIENT_ID, DOMAIN, otherOptions); @@ -140,12 +141,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..32a3228e56 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; @@ -126,9 +130,10 @@ interface Auth0LockConstructorOptions { closable?: boolean; configurationBaseUrl?: string; container?: string; - defaultADUsernameFromEmailPrefix?: string; + defaultADUsernameFromEmailPrefix?: boolean; 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..cca6bf8373 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -147,11 +147,21 @@ management management .updateUser({id: "user_id"}, {"email": "hi@me.co"}, (err: Error, users: auth0.User) => {}); - // Update user metadata management .updateUserMetadata({id: "user_id"}, {"key": "value"}); +// Update user metadata with JSON object +management + .updateUserMetadata({id: "user_id"}, { + key: "value", + numKey: 123, + objKey: { + foo: "bar", + another: "value" + } + }); + // Update user metadata using callback management .updateUserMetadata({id: "user_id"}, {"key": "value"}, (err: Error, users: auth0.User) => {}); @@ -203,3 +213,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..c2df7dee7c 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for auth0 2.9.2 +// Type definitions for auth0 2.9.3 // Project: https://github.com/auth0/node-auth0 -// Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach +// Definitions by: Seth Westphal +// Ian Howe +// Alex Bjørlig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import * as Promise from 'bluebird'; - export interface ManagementClientOptions { token?: string; domain: string; @@ -34,7 +34,7 @@ export interface RetryOptions { } export interface UserMetadata { - [propName: string]: string + [propName: string]: any } export interface AppMetadata { @@ -48,7 +48,10 @@ export interface UserData { verify_email?: boolean; password?: string; phone_number?: string; - phone_verified?: boolean, + phone_verified?: boolean; + given_name?: string; + family_name?: string; + name?: string; user_metadata?: UserMetadata; app_metadata?: AppMetadata; } @@ -588,7 +591,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 +676,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/autobahn-tests.ts b/types/autobahn/autobahn-tests.ts index d753e960fe..8f05c25141 100644 --- a/types/autobahn/autobahn-tests.ts +++ b/types/autobahn/autobahn-tests.ts @@ -43,5 +43,7 @@ function test_client() { }); }; - connection.open(); + if (!connection.isOpen && !connection.isRetrying && connection.session == null) { + connection.open(); + } } diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index 59bb2c404d..7a518e0fd4 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for AutobahnJS v0.9.7 +// Type definitions for AutobahnJS 0.9 // Project: http://autobahn.ws/js/ -// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier +// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -190,6 +190,10 @@ declare namespace autobahn { export class Connection { constructor(options?: IConnectionOptions); + isOpen: boolean; + isRetrying: boolean; + session?: Session; + open(): void; close(reason?: string, message?: string): void; diff --git a/types/autobahn/tslint.json b/types/autobahn/tslint.json index a41bf5d19a..a0357daa61 100644 --- a/types/autobahn/tslint.json +++ b/types/autobahn/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/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/await-timeout/await-timeout-tests.ts b/types/await-timeout/await-timeout-tests.ts new file mode 100644 index 0000000000..96dcdefdee --- /dev/null +++ b/types/await-timeout/await-timeout-tests.ts @@ -0,0 +1,131 @@ +import Timeout from "await-timeout"; + +/** + * This test is just a TS-friendly version of the await-timeout README: + * https://github.com/vitalets/await-timeout/blob/v0.3.0/README.md + * + * How to generate this file: + * 1. Paste the source code of README.md + * 2. Replace every code fence with async () => {} + * 3. Comment out all other lines + * 4. Add and remove import statements and repeated statements + * 5. Declare required globals + */ + +// -- Globals -- +declare const fetch: (url: string) => Promise; +declare const console: any; +declare const MyTimeoutError: any; + +// --- README --- + +// ## Usage +// 1. Just wait some time: +async () => { + // wait 1000 ms and resolve + await Timeout.set(1000); + + // wait 1000 ms and reject with 'Error' + await Timeout.set(1000, 'Error'); +}; + +// 2. Use `Timeout` instance inside `try...finally` block to make proper cleanup: +async () => { + const timer = new Timeout(); + try { + await Promise.race([ + fetch('https://example.com'), + timer.set(1000) + .then(() => Promise.reject('Timeout')) + ]); + } finally { + timer.clear(); + } +}; + +// ## API +// ### new Timeout() +// Constructs new timeout instance. It does not start timer but creates variable for timer manipulation. +async () => { + const timer = new Timeout(); +}; +// > Note : having separate variable is useful for clearing timeout in `finally` block + +// ### .set(ms, [message]) ⇒ `Promise` +// Starts new timer like `setTimeout()` and returns promise. The promise will be resolved after `ms` milliseconds: +async () => { + const timer = new Timeout(); + timer.set(1000) + .then(() => console.log('1000 ms passed.')); +}; + +// If you need to reject after timeout: +async () => { + const timer = new Timeout(); + timer.set(1000) + .then(() => {throw new Error('Timeout'); }); +}; + +// Or reject with custom error: +async () => { + const timer = new Timeout(); + timer.set(1000) + .then(() => {throw new MyTimeoutError(); }); +}; +// The second parameter `message` is just convenient way to reject with `new Error(message)`: +async () => { + const timer = new Timeout(); + timer.set(1000, 'Timeout'); + // is equivalent to + timer.set(1000).then(() => {throw new Error('Timeout'); }); +}; + +// If you need to just wait some time - use static version of `.set()` : +async () => { + Timeout.set(1000).then(/*...*/); +}; + +// ### .wrap(promise, ms, [message]) ⇒ `Promise` +// Wraps existing promise with timeout: +// * promise automatically rejected after timeout +// * timeout automatically cleared if promise fulfills first +async () => { + const promise = fetch('https://example.com'); + + const timeoutedPromise = Timeout.wrap(promise, 1000, 'Timeout'); +}; +// Actually it is a shortcut for : +async () => { + const promise = fetch('https://example.com'); + + const timer = new Timeout(); + try { + const timeoutedPromise = await Promise.race([ + promise, + timer.set(1000, 'Timeout') + ]); + } finally { + timer.clear(); + } +}; + +// ### .clear() +// Clears existing timeout like `clearTimeout()`. +async () => { + const timer = new Timeout(); + timer.set(1000) + .then(() => console.log('This will never be called, because timeout is cleared on the next line')); + timer.clear(); +}; + +// With [ES7 async / await ] `.clear()` can be used in `finally` block: +async () => { + async function foo() { + const timer = new Timeout(); + try { + // some async stuff + } finally { + timer.clear(); + } + } +}; diff --git a/types/await-timeout/index.d.ts b/types/await-timeout/index.d.ts new file mode 100644 index 0000000000..ce202c6024 --- /dev/null +++ b/types/await-timeout/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for await-timeout 0.3 +// Project: https://github.com/vitalets/await-timeout +// Definitions by: Sean Zhu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export default Timeout; + +declare class Timeout { + static set(delay: number): Promise; + static set(delay: number, message: string): Promise; + + static wrap(promise: Promise, delay: number, error?: string): Promise; + + set(delay: number): Promise; + set(delay: number, message: string): Promise; + clear(): void; +} diff --git a/types/await-timeout/tsconfig.json b/types/await-timeout/tsconfig.json new file mode 100644 index 0000000000..2ecb27e688 --- /dev/null +++ b/types/await-timeout/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", + "await-timeout-tests.ts" + ] +} diff --git a/types/await-timeout/tslint.json b/types/await-timeout/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/await-timeout/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 5fa225eafd..ba6ebdc5ac 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,18 @@ 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; +strOrUndefined = customAuthorizerEvt.resource; +strOrUndefined = customAuthorizerEvt.path; +strOrUndefined = customAuthorizerEvt.httpMethod; +str = customAuthorizerEvt.headers!["example"]; +str = customAuthorizerEvt.multiValueHeaders!["example"][0]; +str = customAuthorizerEvt.pathParameters!["example"]; +str = customAuthorizerEvt.queryStringParameters!["example"]; +str = customAuthorizerEvt.multiValueQueryStringParameters!["example"][0]; +str = customAuthorizerEvt.stageVariables!["example"]; +apiGwEvtReqCtxOpt = customAuthorizerEvt.requestContext; +strOrUndefined = customAuthorizerEvt.domainName; +strOrUndefined = customAuthorizerEvt.apiId; /* DynamoDB Stream Event */ const dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = { @@ -245,6 +256,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 +397,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 +420,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 +432,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) { @@ -580,6 +605,27 @@ const CodePipelineEvent: AWSLambda.CodePipelineEvent = { CodePipelineEvent["CodePipeline.job"].data.encryptionKey = { type: 'KMS', id: 'key' }; +/* CodePipeline CloudWatch Events + * see https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html + * Their documentation says that detail.version is a string, but it is actually an integer + */ +const CodePipelineCloudWatchEvent: AWSLambda.CodePipelineCloudWatchEvent = { + version: '0', + id: 'event_Id', + 'detail-type': 'CodePipeline Pipeline Execution State Change', + source: 'aws.codepipeline', + account: 'Pipeline_Account', + time: 'TimeStamp', + region: 'us-east-1', + resources: ['arn:aws:codepipeline:us-east-1:account_ID:myPipeline'], + detail: { + pipeline: 'myPipeline', + version: 1, + state: 'STARTED', + 'execution-id': 'execution_Id', + }, +}; + /* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ const CloudFrontRequestWithCustomOriginEvent: AWSLambda.CloudFrontRequestEvent = { Records: [ @@ -1010,3 +1056,113 @@ const firehoseEventHandler: AWSLambda.FirehoseTransformationHandler = ( ] }); }; + +declare let lexEvent: AWSLambda.LexEvent; +lexEvent = { + currentIntent: { + name: 'intent-name', + slots: { + slot1: null, + slot2: 'value2', + }, + slotDetails: { + slot1: { + resolutions: [ + { value: 'value1' }, + ], + originalValue: 'originalValue', + } + }, + confirmationStatus: 'None', + }, + bot: { + name: 'bot name', + alias: 'bot alias', + version: 'bot version', + }, + userId: 'User ID specified in the POST request to Amazon Lex.', + inputTranscript: 'Text used to process the request', + invocationSource: 'FulfillmentCodeHook', + outputDialogMode: 'Text', + messageVersion: '1.0', + sessionAttributes: { + key1: 'value1', + key2: 'value2', + }, + requestAttributes: { + key1: 'value1', + key2: 'value2', + } +}; + +declare let lexResult: AWSLambda.LexResult; +declare let lexDialogAction: AWSLambda.LexDialogAction; +declare let lexDialogActionBase: AWSLambda.LexDialogActionBase; +declare let lexDialogActionClose: AWSLambda.LexDialogActionClose; +declare let lexDialogActionConfirmIntent: AWSLambda.LexDialogActionConfirmIntent; +declare let lexDialogActionDelegate: AWSLambda.LexDialogActionDelegate; +declare let lexDialogActionElicitIntent: AWSLambda.LexDialogActionElicitIntent; +declare let lexDialogActionElicitSlot: AWSLambda.LexDialogActionElicitSlot; +declare let lexGenericAttachment: AWSLambda.LexGenericAttachment; + +lexResult = { + sessionAttributes: { + attrib1: 'Value One', + }, + dialogAction: { + type: 'Close', + fulfillmentState: 'Failed', + }, +}; + +str = lexGenericAttachment.title; +str = lexGenericAttachment.subTitle; +str = lexGenericAttachment.imageUrl; +str = lexGenericAttachment.attachmentLinkUrl; +str = lexGenericAttachment.buttons[0].text; +str = lexGenericAttachment.buttons[0].value; + +lexDialogAction.type === 'Close'; +lexDialogAction.type === 'ConfirmIntent'; +lexDialogAction.type === 'Delegate'; +lexDialogAction.type === 'ElicitIntent'; +lexDialogAction.type === 'ElicitSlot'; + +lexDialogActionBase.message!.contentType === 'CustomPayload'; +lexDialogActionBase.message!.contentType === 'PlainText'; +lexDialogActionBase.message!.contentType === 'SSML'; +str = lexDialogActionBase.message!.content; +num = lexDialogActionBase.responseCard!.version; +lexDialogActionBase.responseCard!.contentType === 'application/vnd.amazonaws.card.generic'; +// $ExpectType LexGenericAttachment +lexDialogActionBase.responseCard!.genericAttachments[0]; + +lexDialogActionClose.type === 'Close'; +lexDialogActionClose.fulfillmentState === 'Failed'; +lexDialogActionClose.fulfillmentState === 'Fulfilled'; + +lexDialogActionConfirmIntent.type === 'ConfirmIntent'; +str = lexDialogActionConfirmIntent.intentName; +strOrNull = lexDialogActionConfirmIntent.slots['example']; + +lexDialogActionDelegate.type === 'Delegate'; +strOrNull = lexDialogActionDelegate.slots['example']; + +lexDialogActionElicitIntent.type === 'ElicitIntent'; +lexDialogActionElicitSlot.type === 'ElicitSlot'; +strOrNull = lexDialogActionElicitSlot.slots['example']; +str = lexDialogActionElicitSlot.slotToElicit; +str = lexDialogActionElicitSlot.intentName; + +const lexEventHandler: AWSLambda.LexHandler = async ( + event: AWSLambda.LexEvent, + context: AWSLambda.Context, +) => { + // $ExpectType LexEvent + event; + + // $ExpectType Context + context; + str = context.functionName; + return lexResult; +}; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index cce721e68c..52314529bc 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -22,6 +22,9 @@ // Louis Larry // Daniel Papukchiev // Oliver Hookins +// Trevor Leach +// James Gregory +// Erik Dalén // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -58,11 +61,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; @@ -74,10 +79,18 @@ export interface CustomAuthorizerEvent { type: string; methodArn: string; authorizationToken?: string; + resource?: string; + path?: string; + httpMethod?: string; headers?: { [name: string]: string }; + multiValueHeaders?: { [name: string]: string[] }; pathParameters?: { [name: string]: string } | null; queryStringParameters?: { [name: string]: string } | null; + multiValueQueryStringParameters?: { [name: string]: string[] } | null; + stageVariables?: { [name: string]: string }; requestContext?: APIGatewayEventRequestContext; + domainName?: string; + apiId?: string; } // Context @@ -234,7 +247,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 +271,7 @@ export interface CognitoUserPoolTriggerEvent { challengeName?: string; privateChallengeParameters?: { [key: string]: string }; challengeAnswer?: string; + password?: string; }; response: { autoConfirmUser?: boolean; @@ -269,6 +285,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 +454,9 @@ export interface APIGatewayProxyResult { headers?: { [header: string]: boolean | number | string; }; + multiValueHeaders?: { + [header: string]: Array; + }; body: string; isBase64Encoded?: boolean; } @@ -559,6 +583,109 @@ export interface CodePipelineEvent { }; } +/** + * CodePipeline CloudWatch Events + * https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html + * + * The above CodePipelineEvent is when a lambda is invoked by a CodePipeline. + * These events are when you subsribe to CodePipeline events in CloudWatch. + * + * Their documentation says that detail.version is a string, but it is actually an integer + */ +export type CodePipelineState = + | 'STARTED' + | 'SUCCEEDED' + | 'RESUMED' + | 'FAILED' + | 'CANCELED' + | 'SUPERSEDED'; + +export type CodePipelineStageState = + | 'STARTED' + | 'SUCCEEDED' + | 'RESUMED' + | 'FAILED' + | 'CANCELED'; + +export type CodePipelineActionState = + | 'STARTED' + | 'SUCCEEDED' + | 'FAILED' + | 'CANCELED'; + +export interface CodePipelineCloudWatchPipelineEvent { + version: string; + id: string; + 'detail-type': 'CodePipeline Pipeline Execution State Change'; + source: 'aws.codepipeline'; + account: string; + time: string; + region: string; + resources: string[]; + detail: { + pipeline: string; + version: number; + state: CodePipelineState; + 'execution-id': string; + }; +} + +export interface CodePipelineCloudWatchStageEvent { + version: string; + id: string; + 'detail-type': 'CodePipeline Stage Execution State Change'; + source: 'aws.codepipeline'; + account: string; + time: string; + region: string; + resources: string[]; + detail: { + pipeline: string; + version: number; + 'execution-id': string; + stage: string; + state: CodePipelineStageState; + }; +} + +export type CodePipelineActionCategory = + | 'Approval' + | 'Build' + | 'Deploy' + | 'Invoke' + | 'Source' + | 'Test'; + +export interface CodePipelineCloudWatchActionEvent { + version: string; + id: string; + 'detail-type': 'CodePipeline Action Execution State Change'; + source: 'aws.codepipeline'; + account: string; + time: string; + region: string; + resources: string[]; + detail: { + pipeline: string; + version: number; + 'execution-id': string; + stage: string; + action: string; + state: CodePipelineActionState; + type: { + owner: 'AWS' | 'Custom' | 'ThirdParty'; + category: CodePipelineActionCategory; + provider: string; + version: number; + }; + }; +} + +export type CodePipelineCloudWatchEvent = + | CodePipelineCloudWatchPipelineEvent + | CodePipelineCloudWatchStageEvent + | CodePipelineCloudWatchActionEvent; + /** * CloudFront events * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html @@ -749,6 +876,100 @@ export interface SQSMessageAttributes { [name: string]: SQSMessageAttribute; } +// Lex +// https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-lex +export interface LexEvent { + currentIntent: { + name: string; + slots: { [name: string]: string | null }; + slotDetails: LexSlotDetails; + confirmationStatus: 'None' | 'Confirmed' | 'Denied'; + }; + bot: { + name: string; + alias: string; + version: string; + }; + userId: string; + inputTranscript: string; + invocationSource: 'DialogCodeHook' | 'FulfillmentCodeHook'; + outputDialogMode: 'Text' | 'Voice'; + messageVersion: '1.0'; + sessionAttributes: { [key: string]: string }; + requestAttributes: { [key: string]: string } | null; +} + +export interface LexSlotResolution { + value: string; +} + +export interface LexSlotDetails { + [name: string]: { + // The following line only works in TypeScript Version: 3.0, The array should have at least 1 and no more than 5 items + // resolutions: [LexSlotResolution, LexSlotResolution?, LexSlotResolution?, LexSlotResolution?, LexSlotResolution?]; + resolutions: LexSlotResolution[] + originalValue: string; + }; +} + +export interface LexGenericAttachment { + title: string; + subTitle: string; + imageUrl: string; + attachmentLinkUrl: string; + buttons: Array<{ + text: string; + value: string; + }>; +} + +export interface LexDialogActionBase { + type: 'Close' | 'ElicitIntent' | 'ElicitSlot' | 'ConfirmIntent'; + message?: { + contentType: 'PlainText' | 'SSML' | 'CustomPayload'; + content: string; + }; + responseCard?: { + version: number; + contentType: 'application/vnd.amazonaws.card.generic'; + genericAttachments: LexGenericAttachment[]; + }; +} + +export interface LexDialogActionClose extends LexDialogActionBase { + type: 'Close'; + fulfillmentState: 'Fulfilled' | 'Failed'; +} + +export interface LexDialogActionElicitIntent extends LexDialogActionBase { + type: 'ElicitIntent'; +} + +export interface LexDialogActionElicitSlot extends LexDialogActionBase { + type: 'ElicitSlot'; + intentName: string; + slots: { [name: string]: string | null }; + slotToElicit: string; +} + +export interface LexDialogActionConfirmIntent extends LexDialogActionBase { + type: 'ConfirmIntent'; + intentName: string; + slots: { [name: string]: string | null }; +} + +export interface LexDialogActionDelegate { + type: 'Delegate'; + slots: { [name: string]: string | null }; +} + +export type LexDialogAction = LexDialogActionClose | LexDialogActionElicitIntent | LexDialogActionElicitSlot | LexDialogActionConfirmIntent | LexDialogActionDelegate; + +export interface LexResult { + sessionAttributes?: { [key: string]: string }; + dialogAction: LexDialogAction; +} + /** * AWS Lambda handler function. * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html @@ -811,6 +1032,9 @@ export type ScheduledHandler = Handler; // TODO: Alexa +export type LexHandler = Handler; +export type LexCallback = Callback; + export type APIGatewayProxyHandler = Handler; export type APIGatewayProxyCallback = Callback; export type ProxyHandler = APIGatewayProxyHandler; // Old name @@ -820,6 +1044,11 @@ export type ProxyCallback = APIGatewayProxyCallback; // Old name export type CodePipelineHandler = Handler; +export type CodePipelineCloudWatchHandler = Handler; +export type CodePipelineCloudWatchPipelineHandler = Handler; +export type CodePipelineCloudWatchStageHandler = Handler; +export type CodePipelineCloudWatchActionHandler = Handler; + export type CloudFrontRequestHandler = Handler; export type CloudFrontRequestCallback = Callback; 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-case-converter/axios-case-converter-tests.ts b/types/axios-case-converter/axios-case-converter-tests.ts new file mode 100644 index 0000000000..77fa927976 --- /dev/null +++ b/types/axios-case-converter/axios-case-converter-tests.ts @@ -0,0 +1,6 @@ +import axios from "axios"; +import applyConverters from "axios-case-converter"; + +applyConverters(); // $ExpectError + +applyConverters(axios.create()); // $ExpectType AxiosInstance diff --git a/types/axios-case-converter/index.d.ts b/types/axios-case-converter/index.d.ts new file mode 100644 index 0000000000..2071ee4dbc --- /dev/null +++ b/types/axios-case-converter/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for axios-case-converter 0.3 +// Project: https://github.com/mpyw/axios-case-converter +// Definitions by: Derek Kniffin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import { AxiosInstance } from "axios"; + +export default function applyConverters(axios: AxiosInstance): AxiosInstance; diff --git a/types/http-proxy-middleware/package.json b/types/axios-case-converter/package.json similarity index 65% rename from types/http-proxy-middleware/package.json rename to types/axios-case-converter/package.json index 0aa4cf368f..ab98e74e0b 100644 --- a/types/http-proxy-middleware/package.json +++ b/types/axios-case-converter/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "winston": "^3.0.0" + "axios": "^0.16.1" } } diff --git a/types/axios-case-converter/tsconfig.json b/types/axios-case-converter/tsconfig.json new file mode 100644 index 0000000000..fb3102b6eb --- /dev/null +++ b/types/axios-case-converter/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", + "axios-case-converter-tests.ts" + ] +} diff --git a/types/axios-case-converter/tslint.json b/types/axios-case-converter/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/axios-case-converter/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/azure-sb-tests.ts b/types/azure-sb/azure-sb-tests.ts index 14d2ba9054..e1703c8086 100644 --- a/types/azure-sb/azure-sb-tests.ts +++ b/types/azure-sb/azure-sb-tests.ts @@ -80,3 +80,14 @@ nh.wns.send('tag', '', 'wns/toast', { headers: {} }, Response nh.wns.sendToastText01('tag', '', ResponseCallback); nh.wns.sendToastText01(['tag'], '', ResponseCallback); nh.wns.sendToastText01('tag', '', { headers: {} }, ResponseCallback); +nh.createOrUpdateInstallation({ + "installationId":"123-123-123-123", + "platform":"gcm", + "pushChannel":"aXhytc4zD=", +}, () => {}); +nh.createOrUpdateInstallation({ + installationId:"123-123-123-123", + platform:"gcm", + pushChannel:"aXhytc4zD=", + tags:["tag1","tag2"] +}, {}, () => {}); \ No newline at end of file diff --git a/types/azure-sb/index.d.ts b/types/azure-sb/index.d.ts index 9f9d07d3dc..acb0bed06a 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; } @@ -140,6 +140,32 @@ export namespace Azure.ServiceBus { WnsHeaders?: any; } + export interface NotificationHubInstallation { + installationId: string; + readonly lastActiveOn?: string; + readonly expirationTime?: string; + readonly lastUpdate?: string; + platform: "apns" | "wns" | "mpns" | "adm" | "gcm"; + pushChannel: string; + readonly expiredPushChannel?: string; + tags?: Array; + templates?: { + [name: string]: { + body: string; + headers?: any; + expiry?: string; + tags?: Array; + }; + }; + secondaryTile?: { + [titleId: string]: { + pushChannel: string; + tags?: Array; + templates?: any; + }; + }; + } + export interface Response { body: Dictionary; headers: Dictionary; diff --git a/types/azure-sb/lib/notificationhubservice.d.ts b/types/azure-sb/lib/notificationhubservice.d.ts index d56b53d9d5..ab2cf0f3ee 100644 --- a/types/azure-sb/lib/notificationhubservice.d.ts +++ b/types/azure-sb/lib/notificationhubservice.d.ts @@ -2,6 +2,7 @@ import { Azure } from 'azure-sb'; import Callback = Azure.ServiceBus.ResponseCallback; import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration; import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; +import NotificationHubInstallation = Azure.ServiceBus.NotificationHubInstallation; import ApnsService = require('./apnsservice'); import GcmService = require('./gcmservice'); @@ -29,10 +30,10 @@ declare class NotificationHubService { options: { headers: object }, callback: Callback): void; - public createOrUpdateInstallation(installation: string, + public createOrUpdateInstallation(installation: NotificationHubInstallation, callback: Callback): void; - public createOrUpdateInstallation(installation: string, + public createOrUpdateInstallation(installation: NotificationHubInstallation, options: any, callback: Callback): void; diff --git a/types/babel__core/babel__core-tests.ts b/types/babel__core/babel__core-tests.ts index a873c3392f..ba51ac21be 100644 --- a/types/babel__core/babel__core-tests.ts +++ b/types/babel__core/babel__core-tests.ts @@ -7,15 +7,18 @@ const options: babel.TransformOptions = { babel.transform("code();", options, (err, result) => { const { code, map, ast } = result!; + const { body } = ast!.program; }); const transformSyncResult = babel.transformSync("code();", options); if (transformSyncResult) { const { code, map, ast } = transformSyncResult; + const { body } = ast!.program; } babel.transformFile("filename.js", options, (err, result) => { const { code, map, ast } = result!; + const { body } = ast!.program; }); babel.transformFileSync("filename.js", options)!.code; @@ -25,7 +28,14 @@ const parsedAst = babel.parse(sourceCode, options); babel.transformFromAst(parsedAst!, sourceCode, options, (err, result) => { const { code, map, ast } = result!; + const { body } = ast!.program; }); const transformFromAstSyncResult = babel.transformFromAstSync(parsedAst!, sourceCode, options); const { code, map, ast } = transformFromAstSyncResult!; +const { body } = ast!.program; + +babel.transformFromAstAsync(parsedAst!, sourceCode, options).then(transformFromAstAsyncResult => { + const { code, map, ast } = transformFromAstAsyncResult!; + const { body } = ast!.program; +}); diff --git a/types/babel__core/index.d.ts b/types/babel__core/index.d.ts index 277228341b..eb39d90a58 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 @@ -349,7 +349,7 @@ export function transformFromAstSync(ast: Node, code?: string, opts?: TransformO /** * Given an AST, transform it. */ -export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): Promise; +export function transformFromAstAsync(ast: Node, code?: string, opts?: TransformOptions): Promise; // A babel plugin is a simple function which must return an object matching // the following interface. Babel will throw if it finds unknown properties. @@ -365,7 +365,7 @@ export interface PluginObj { } export interface BabelFileResult { - ast?: Node | null; + ast?: t.File | null; code?: string | null; ignored?: boolean; map?: { 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..98a0338021 100644 --- a/types/babel__traverse/babel__traverse-tests.ts +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -1,14 +1,17 @@ -import { parse } from "@babel/parser"; import traverse, { Visitor } from "@babel/traverse"; import * as t from "@babel/types"; // Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md const MyVisitor: Visitor = { Identifier: { - enter() { + enter(path) { + // $ExpectType NodePath + path; console.log("Entered!"); }, - exit() { + exit(path) { + // $ExpectType NodePath + path; console.log("Exited!"); } } @@ -21,11 +24,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) { @@ -94,7 +93,8 @@ const v1: Visitor = { const id = path.scope.generateUidIdentifierBasedOnNode(path.node.id!); path.remove(); - path.scope.parent.push({ id, init: path.node }); + path.scope.parent.push({ id }); + path.scope.parent.push({ id, init: t.stringLiteral('foo'), kind: "const" }); path.scope.rename("n", "x"); path.scope.rename("n"); @@ -109,7 +109,49 @@ const BindingKindTest: Visitor = { kind === 'const'; kind === 'let'; kind === 'var'; - // The following should fail when uncommented - // kind === 'anythingElse'; + // $ExpectError + kind === 'anythingElse'; }, }; + +interface SomeVisitorState { someState: string; } + +const VisitorStateTest: Visitor = { + enter(path, state) { + // $ExpectType SomeVisitorState + state; + // $ExpectType SomeVisitorState + this; + }, + exit(path, state) { + // $ExpectType SomeVisitorState + state; + // $ExpectType SomeVisitorState + this; + }, + Identifier(path, state) { + // $ExpectType SomeVisitorState + state; + // $ExpectType SomeVisitorState + this; + }, + FunctionDeclaration: { + enter(path, state) { + // $ExpectType SomeVisitorState + state; + // $ExpectType SomeVisitorState + this; + }, + exit(path, state) { + // $ExpectType SomeVisitorState + state; + // $ExpectType SomeVisitorState + this; + } + } +}; + +const VisitorAliasTest: Visitor = { + Function() {}, + Expression() {}, +}; diff --git a/types/babel__traverse/index.d.ts b/types/babel__traverse/index.d.ts index 475ca9fb14..fe817d5daf 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"; @@ -90,11 +90,16 @@ export class Scope { removeData(key: string): void; - push(opts: any): void; + push(opts: { + id: t.LVal, + init?: t.Expression, + unique?: boolean, + kind?: "var" | "let" | "const", + }): void; getProgramParent(): Scope; - getFunctionParent(): Scope; + getFunctionParent(): Scope | null; getBlockParent(): Scope; @@ -138,17 +143,19 @@ export class Binding { constantViolations: NodePath[]; } -export type Visitor = VisitNodeObject & { - [P in Node["type"]]?: VisitNode>; +export type Visitor = VisitNodeObject & { + [Type in Node["type"]]?: VisitNode>; +} & { + [K in keyof t.Aliases]?: VisitNode }; -export type VisitNode = VisitNodeFunction | VisitNodeObject; +export type VisitNode = VisitNodeFunction | VisitNodeObject; -export type VisitNodeFunction = (this: T, path: NodePath

, state: any) => void; +export type VisitNodeFunction = (this: S, path: NodePath

, state: S) => void; -export interface VisitNodeObject { - enter?(path: NodePath, state: any): void; - exit?(path: NodePath, state: any): void; +export interface VisitNodeObject { + enter?: VisitNodeFunction; + exit?: VisitNodeFunction; } export class NodePath { diff --git a/types/babel__traverse/package.json b/types/babel__traverse/package.json index c2ca8a8f9b..47a2d3dc48 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.3.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-fetch-cache/backbone-fetch-cache-tests.ts b/types/backbone-fetch-cache/backbone-fetch-cache-tests.ts index 072e3c29ce..6c2d852961 100644 --- a/types/backbone-fetch-cache/backbone-fetch-cache-tests.ts +++ b/types/backbone-fetch-cache/backbone-fetch-cache-tests.ts @@ -64,7 +64,7 @@ const modelOpts: Backbone.ModelFetchWithCacheOptions = { context: {}, }; -const hoge = new Backbone.Model; +const hoge = new Backbone.Model() as Backbone.ModelWithCache; hoge.fetch(modelOpts); const collectionOpts: Backbone.CollectionFetchWithCacheOptions = { @@ -76,5 +76,5 @@ const collectionOpts: Backbone.CollectionFetchWithCacheOptions = { prefillSuccess: (self: any) => { }, }; -const fuga = new Backbone.Collection; +const fuga = new Backbone.Collection() as Backbone.CollectionWithCache; fuga.fetch(collectionOpts); diff --git a/types/backbone-relational/backbone-relational-tests.ts b/types/backbone-relational/backbone-relational-tests.ts index 90433cd153..6e0135fcd9 100644 --- a/types/backbone-relational/backbone-relational-tests.ts +++ b/types/backbone-relational/backbone-relational-tests.ts @@ -74,6 +74,7 @@ paul.get('livesIn'); // === ourHouse // You can control which relations get serialized to JSON, using the 'includeInJSON' // property on a Relation. Also, each object will only get serialized once to prevent loops. alert(JSON.stringify(paul.get('user').toJSON(), null, '\t')); +alert(JSON.stringify(paul.get('user').toJSON({ option1: 'value1' }), null, '\t')); // Load occupants 'person-2' and 'person-5', which don't exist yet, from the server ourHouse.fetchRelated('occupants'); diff --git a/types/backbone-relational/index.d.ts b/types/backbone-relational/index.d.ts index a1c8c3eefb..84406fb60a 100644 --- a/types/backbone-relational/index.d.ts +++ b/types/backbone-relational/index.d.ts @@ -34,7 +34,7 @@ declare module 'backbone' { fetchRelated(key:string, options?:any, update?:boolean):any; - toJSON():any; + toJSON(options?: any):any; static setup(); @@ -122,7 +122,19 @@ declare module 'backbone' { } - export class Store extends Events { + export class Store implements Events { + on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; + on(eventMap: EventsHash): any; + on(eventName: any, callback?: any, context?: any): any; + off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + trigger(eventName: string, ...args: any[]): any; + bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; + unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + once(events: string, callback: (...args: any[]) => void, context?: any): any; + listenTo(object: any, events: string, callback: (...args: any[]) => void): any; + listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; + stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; + initializeRelation(model, relation, options); addModelScope(scope:any):void; 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..4edaba87b7 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[][]; } /** @@ -280,9 +407,21 @@ export interface ObjectOptions extends RadioMixinOptions { * A base class which other classes can extend from. Object incorporates many * backbone conventions and utilities like initialize and Backbone.Events. */ -export class Object extends Backbone.Events implements CommonMixin, RadioMixin { +export class Object implements CommonMixin, RadioMixin, Backbone.Events { constructor(options?: ObjectOptions); + on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; + on(eventMap: EventsHash): any; + on(eventName: any, callback?: any, context?: any): any; + off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + trigger(eventName: string, ...args: any[]): any; + bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; + unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + once(events: string, callback: (...args: any[]) => void, context?: any): any; + listenTo(object: any, events: string, callback: (...args: any[]) => void): any; + listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; + stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; + /** * Receives a hash of event names and functions and/or function names, * and returns the same hash with the function names replaced with the @@ -1154,7 +1293,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.paginator/backbone.paginator-tests.ts b/types/backbone.paginator/backbone.paginator-tests.ts index f24e2855f5..0c1b0cf9a8 100644 --- a/types/backbone.paginator/backbone.paginator-tests.ts +++ b/types/backbone.paginator/backbone.paginator-tests.ts @@ -70,8 +70,8 @@ namespace InitializingWithOptions { }); var testCollection6 = new TestCollection([ - {}, - {}, + {} as TestModel, + {} as TestModel, ]); } diff --git a/types/backbone.radio/index.d.ts b/types/backbone.radio/index.d.ts index 12fc6d384f..ac953aa00b 100644 --- a/types/backbone.radio/index.d.ts +++ b/types/backbone.radio/index.d.ts @@ -71,7 +71,18 @@ declare module "backbone" { stopReplying(commandName?: string, callback?: (...args: any[]) => any, context?: any): Requests; } - class Channel extends Backbone.Events implements Commands, Requests { + class Channel implements Commands, Requests, Backbone.Events { + on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; + on(eventMap: EventsHash): any; + on(eventName: any, callback?: any, context?: any): any; + off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + trigger(eventName: string, ...args: any[]): any; + bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; + unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + once(events: string, callback: (...args: any[]) => void, context?: any): any; + listenTo(object: any, events: string, callback: (...args: any[]) => void): any; + listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; + stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; channelName: string; reset(): Channel; diff --git a/types/backbone/backbone-tests.ts b/types/backbone/backbone-tests.ts index 65a1463978..563c21634c 100644 --- a/types/backbone/backbone-tests.ts +++ b/types/backbone/backbone-tests.ts @@ -1,6 +1,6 @@ function test_events() { - var object = new Backbone.Events(); + var object = Backbone.Events; object.on("alert", (eventName: string) => alert("Triggered " + eventName)); object.trigger("alert", "an event"); diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index 81bce43606..a881284c8f 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Boris Yankov // Natan Vivo // kenjiru +// jjoekoullas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -91,24 +92,37 @@ declare namespace Backbone { } interface EventsHash { - [selector: string]: string | {(eventObject: JQueryEventObject): void}; + [selector: string]: string | {(eventObject: JQuery.TriggeredEvent): void}; } - class Events { + export const Events: Events; + interface Events { + on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; + on(eventMap: EventsHash): any; + off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + trigger(eventName: string, ...args: any[]): any; + bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; + unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + + once(events: string, callback: (...args: any[]) => void, context?: any): any; + listenTo(object: any, events: string, callback: (...args: any[]) => void): any; + listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; + stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; + } + + class ModelBase implements Events { on(eventName: string, callback?: Function, context?: any): any; on(eventMap: EventsHash): any; - off(eventName?: string, callback?: Function, context?: any): any; - trigger(eventName: string, ...args: any[]): any; - bind(eventName: string, callback: Function, context?: any): any; - unbind(eventName?: string, callback?: Function, context?: any): any; + on(eventName: any, callback?: any, context?: any): any + off(eventName?: string, callback?: Function, context?: any): any + trigger(eventName: string, ...args: any[]): any + bind(eventName: string, callback: Function, context?: any): any + unbind(eventName?: string, callback?: Function, context?: any): any + once(events: string, callback: Function, context?: any): any + listenTo(object: any, events: string, callback: Function):any + listenToOnce(object: any, events: string, callback: Function): any + stopListening(object?: any, events?: string, callback?: Function): any - once(events: string, callback: Function, context?: any): any; - listenTo(object: any, events: string, callback: Function): any; - listenToOnce(object: any, events: string, callback: Function): any; - stopListening(object?: any, events?: string, callback?: Function): any; - } - - class ModelBase extends Events { parse(response: any, options?: any): any; toJSON(options?: any): any; sync(...arg: any[]): JQueryXHR; @@ -353,7 +367,7 @@ declare namespace Backbone { without(...values: TModel[]): TModel[]; } - class Router extends Events { + class Router extends EventSignatures { /** * Do not use, prefer TypeScript's extend functionality. @@ -382,7 +396,7 @@ declare namespace Backbone { var history: History; - class History extends Events { + class History extends EventSignatures { handlers: any[]; interval: number; @@ -419,7 +433,7 @@ declare namespace Backbone { attributes?: {[id: string]: any}; } - class View extends Events { + class View extends EventSignatures { /** * Do not use, prefer TypeScript's extend functionality. @@ -471,3 +485,21 @@ declare namespace Backbone { function noConflict(): typeof Backbone; var $: JQueryStatic; } + +/** + * This is not for external use and is only here as a convenient way to + * specify signatures for internal implementers of Backbone.Events + */ +declare abstract class EventSignatures implements Backbone.Events { + on(eventName: string, callback?: (...args: any[]) => void, context?: any): any; + on(eventMap: Backbone.EventsHash): any; + off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + trigger(eventName: string, ...args: any[]): any; + bind(eventName: string, callback: (...args: any[]) => void, context?: any): any; + unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any; + + once(events: string, callback: (...args: any[]) => void, context?: any): any; + listenTo(object: any, events: string, callback: (...args: any[]) => void): any; + listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any; + stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any; +} \ No newline at end of file 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/baconjs/baconjs-tests.ts b/types/baconjs/baconjs-tests.ts index 2755bec595..b7d6db4c0f 100644 --- a/types/baconjs/baconjs-tests.ts +++ b/types/baconjs/baconjs-tests.ts @@ -120,7 +120,7 @@ function CommonMethodsInEventStreamsAndProperties() { Bacon.fromArray([1, 2, 3]).withStateMachine(0, (sum, event) => { if (event.hasValue()) { // had to cast to `number` because event:Bacon.Next|Bacon.Error<{}> - return [sum + event.value(), []]; + return [sum + (event.value() as number), []]; } else if (event.isEnd()) { return [undefined, [new Bacon.Next(sum), event]]; @@ -140,8 +140,8 @@ function CommonMethodsInEventStreamsAndProperties() { { // This is handy for keeping track whether we are currently awaiting an AJAX response: - var ajaxRequest = >{}, - ajaxResponse = >{}, + var ajaxRequest = {} as Bacon.Observable, + ajaxResponse = {} as Bacon.Observable, showAjaxIndicator = ajaxRequest.awaiting(ajaxResponse); } diff --git a/types/badgen/badgen-tests.ts b/types/badgen/badgen-tests.ts new file mode 100644 index 0000000000..1b795b3d72 --- /dev/null +++ b/types/badgen/badgen-tests.ts @@ -0,0 +1,24 @@ +import badgen from 'badgen'; + +// $ExpectType string +badgen({ + subject: 'SUBJECT', + status: 'STATUS' +}); + +// $ExpectType string +badgen({ + subject: 'SUBJECT', + status: 'STATUS', + color: 'green' +}); + +// $ExpectType string +badgen({ + subject: 'SUBJECT', + status: 'STATUS', + color: '#FF0000', + style: 'flat', + icon: 'data:image/svg+xml;base64,...', + iconWidth: 20 +}); diff --git a/types/badgen/index.d.ts b/types/badgen/index.d.ts new file mode 100644 index 0000000000..cc6aa1fe54 --- /dev/null +++ b/types/badgen/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for badgen 2.6 +// Project: https://github.com/amio/badgen +// Definitions by: m5d215 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +type ColorPresets = + | 'green' + | 'blue' + | 'red' + | 'yellow' + | 'orange' + | 'purple' + | 'pink' + | 'grey' + | 'gray' + | 'cyan' + | 'black'; + +interface BadgeCreationParams { + /** + * Text representing the subject. + */ + subject: string; + + /** + * Text representing the status. + */ + status: string; + + /** + * Color RGB or Color Name, optional. + */ + color?: ColorPresets | string; + + /** + * 'flat' or undefined, optional. + */ + style?: 'flat'; + + /** + * Use icon, optional. + */ + icon?: string; + + /** + * Use this if icon is not square. + * @default 13 + */ + iconWidth?: number; +} + +declare function badgen(params: BadgeCreationParams): string; + +export = badgen; diff --git a/types/badgen/tsconfig.json b/types/badgen/tsconfig.json new file mode 100644 index 0000000000..8e915b8aac --- /dev/null +++ b/types/badgen/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, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "badgen-tests.ts" + ] +} diff --git a/types/badgen/tslint.json b/types/badgen/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/badgen/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/baidu-app/baidu-app-tests.ts b/types/baidu-app/baidu-app-tests.ts new file mode 100644 index 0000000000..9987a650ee --- /dev/null +++ b/types/baidu-app/baidu-app-tests.ts @@ -0,0 +1,2007 @@ +(() => { + swan.request({ + url: 'https://smartprogram.baidu.com/xxx', // 仅为示例,并非真实的接口地址 + method: 'GET', + dataType: 'json', + data: { + key: 'value' + }, + header: { + 'content-type': 'application/json' // 默认值 + }, + success(res) { + console.log(res.data); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + + const requestTask = swan.request({ + url: 'test.php', // 仅为示例,并非真实的接口地址 + data: { + x: '', + y: '' + }, + header: { + 'content-type': 'application/json' + }, + success(res) { + console.log(res.data); + } + }); + // 取消请求任务 + requestTask.abort(); +})(); + +(() => { + swan.chooseImage({ + success(res) { + swan.uploadFile({ + url: 'https://smartprogram.baidu.com/xxx', // 仅为示例,并非真实的接口地址 + filePath: res.tempFilePaths[0], // 要上传文件资源的路径 + name: 'myfile', + success(res) { + console.log(res.statusCode); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + } + }); +})(); + +(() => { + const uploadTask = swan.uploadFile({ + url: 'https://smartprogram.baidu.com/xxx', // 开发者服务器 url + filePath: '', // res.tempFilePaths[0], // 要上传文件资源的路径 + name: 'myfile', + success(res) { + console.log(res.statusCode); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + + uploadTask.onProgressUpdate(res => { + console.log('上传进度', res.progress); + console.log('已经上传的数据长度', res.totalBytesSent); + console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend); + }); + + uploadTask.abort(); // 取消上传任务 +})(); + +(() => { + swan.downloadFile({ + url: 'https://smartprogram.baidu.com/xxx', // 仅为示例,并非真实的资源 + success(res) { + // 下载成功 + if (res.statusCode === 200) { + console.log("临时文件路径" + res.tempFilePath); + } + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); +})(); + +(() => { + const downloadTask = swan.downloadFile({ + url: 'https://smartprogram.baidu.com/xxx', // 仅为示例,并非真实的资源 + success(res) { + console.log(res.tempFilePath); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + + downloadTask.onProgressUpdate(res => { + console.log('下载进度', res.progress); + console.log('已经下载的数据长度', res.totalBytesWritten); + console.log('预期需要下载的数据总长度', res.totalBytesExpectedToWrite); + }); + + downloadTask.abort(); // 取消下载任务 +})(); + +(() => { + swan.connectSocket({ + url: 'wss://example.baidu.com' + }); +})(); + +(() => { + swan.connectSocket({ + url: 'wss://example.baidu.com' + }); + swan.onSocketOpen((res) => { + console.log('WebSocket连接已打开!', res.header); + }); +})(); + +(() => { + swan.connectSocket({ + url: 'wss://example.baidu.com' // 仅为示例,并非真实的服务地址 + }); + swan.onSocketError((res) => { + console.log('WebSocket连接打开失败,请检查!'); + }); +})(); + +(() => { + swan.connectSocket({ + url: 'wss://example.baidu.com' + }); + swan.onSocketOpen(() => { + swan.sendSocketMessage({ + data: 'baidu' + }); + }); +})(); + +(() => { + swan.connectSocket({ + url: 'wss://example.baidu.com' + }); + swan.onSocketOpen(() => { + swan.sendSocketMessage({ + data: 'baidu' + }); + }); + swan.onSocketMessage((res) => { + console.log('收到服务器内容:', res.data); + }); +})(); + +(() => { + swan.connectSocket({ + url: 'wss://example.baidu.com', + success(res) { + swan.closeSocket(); + } + }); +})(); + +(() => { + swan.connectSocket({ + url: 'wss://example.baidu.com' + }); + + swan.onSocketClose((res) => { + console.log('WebSocket 已关闭!'); + }); + + swan.onSocketOpen(() => { + swan.closeSocket(); + }); +})(); + +(() => { + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.ocrIdCard({ + image, + success(res) { + console.log(res.words_result); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.ocrBankCard({ + image, + success(res) { + console.log(res.result.bank_name); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.ocrDrivingLicense({ + image, + success(res) { + console.log(res.words_result); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.ocrVehicleLicense({ + image, + success(res) { + console.log(res.words_result); + } + }); + } + }); +})(); + +(() => { + swan.ai.textReview({ + content: '', + success(res) { + console.log(res.result.spam); // 0 表示审核通过 + } + }); +})(); + +(() => { + swan.ai.textToAudio({ + ctp: '1', + lan: 'zh', + tex: '这是一段测试文字', + success(res) { + console.log(res.filePath); + } + }); +})(); + +(() => { + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.imageAudit({ + image, + success(res) { + console.log(res.conclusionType); // 1 为合规 + } + }); + } + }); +})(); + +(() => { + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.advancedGeneralIdentify({ + image, + success(res) { + console.log(res.result); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.objectDetectIdentify({ + image, + success(res) { + console.log(res.result); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.carClassify({ + image, + success(res) { + console.log(res.result); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.dishClassify({ + image, + success(res) { + console.log(res.result); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.logoClassify({ + image, + success(res) { + console.log(res.result); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.animalClassify({ + image, + success(res) { + console.log(res.result); + } + }); + } + }); + swan.chooseImage({ + success(res) { + const image = res.tempFilePaths[0]; + swan.ai.plantClassify({ + image, + success(res) { + console.log(res.result); + } + }); + } + }); +})(); + +(() => { + const voiceRecognizer = swan.ai.getVoiceRecognizer(); + + voiceRecognizer.onStart(() => { + console.log('voice start'); + }); + voiceRecognizer.onRecognize(res => { + console.log('voice recognize', res); + }); + voiceRecognizer.onFinish(res => { + console.log('voice end', res); + }); + voiceRecognizer.onError(err => { + console.log('voice error', err); + }); + + const options = { + mode: 'dnn', + longSpeech: false + }; + + voiceRecognizer.start(options); +})(); + +(() => { + swan.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 + sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 + success(res) { + // 成功则返回图片的本地文件路径列表 tempFilePaths + console.log(res.tempFilePaths); + // 文件列表对象 + console.log(res.tempFiles); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); +})(); + +(() => { + swan.previewImage({ + current: '', // 当前显示图片的http链接 + urls: [], // 需要预览的图片http链接列表 + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + + swan.getImageInfo({ + src: '/xxx/xxx.jpg', + success(res) { + // 成功则返回图片高,宽,本地路径 + console.log(res.width); + console.log(res.height); + console.log(res.path); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + swan.saveImageToPhotosAlbum({ + filePath: '/xxx/xxx.jpg', + success(res) { + console.log(res); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); +})(); + +(() => { + const recorderManager = swan.getRecorderManager(); + + recorderManager.onStart(() => { + // 开始录音事件 + console.log('recorder start'); + }); + recorderManager.onPause(() => { + // 暂停录音事件 + console.log('recorder pause'); + }); + recorderManager.onStop((res) => { + // 停止录音事件 + console.log('recorder stop', res); + const { tempFilePath } = res; + }); + + const options = { + duration: 10000, + sampleRate: 44100, + numberOfChannels: 1, + encodeBitRate: 96000, + format: 'aac' + }; + + recorderManager.start(options); +})(); + +(() => { + const backgroundAudioManager = swan.getBackgroundAudioManager(); + + backgroundAudioManager.title = '此时此刻'; + backgroundAudioManager.epname = '此时此刻'; + backgroundAudioManager.singer = '许巍'; + backgroundAudioManager.coverImgUrl = 'xxx'; + backgroundAudioManager.src = 'xxx'; +})(); + +(() => { + const innerAudioContext = swan.createInnerAudioContext(); + innerAudioContext.src = 'xxx'; + innerAudioContext.autoplay = true; + innerAudioContext.seek({ + position: 10 + }); + innerAudioContext.onPlay((res) => { + console.log('开始播放'); + }); +})(); + +(() => { + Page({ + data: { + sourceType: ['album', 'camera'], + compressed: false, + maxDuration: 60, + src: '' + }, + + chooseVideo() { + const self = this; + swan.chooseVideo({ + sourceType: this.getData('sourceType'), + compressed: this.getData('compressed'), + maxDuration: this.getData('maxDuration'), + success(res) { + // 成功返回选定视频的临时文件路径 + self.setData('src', res.tempFilePath); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + } + }); + swan.saveVideoToPhotosAlbum({ + filePath: 'bdfile://xxx', + success(res) { + console.log(res); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); +})(); + +(() => { + const myVideo = swan.createVideoContext('myVideo'); + myVideo.play(); +})(); + +(() => { + swan.chooseImage({ + count: 1, + success(res) { + const tempFilePaths = res.tempFilePaths; + swan.saveFile({ + tempFilePath: tempFilePaths[0], + success(res) { + const savedFilePath = res.savedFilePath; + } + }); + } + }); + swan.getFileInfo({ + filePath: 'bdfile://somefile', + success(res) { + console.log(res.size); + console.log(res.digest); + } + }); + swan.getSavedFileList({ + success(res) { + const fileList = res.fileList; + } + }); + swan.getSavedFileInfo({ + filePath: 'bdfile://somefile', + success(res) { + console.log(res.size); + console.log(res.createTime); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); +})(); + +(() => { + swan.getSavedFileList({ + success(res) { + if (res.fileList.length > 0) { + swan.removeSavedFile({ + filePath: res.fileList[0].filePath, + success(res) { + console.log(res.filePath); + } + }); + } + } + }); +})(); + +(() => { + swan.downloadFile({ + url: 'https://smartprogram.baidu.com/xxx.pdf', + success(res) { + const filePath = res.tempFilePath; + swan.openDocument({ + filePath, + success(res) { + console.log('打开文档成功'); + } + }); + } + }); +})(); + +(() => { + swan.setStorage({ + key: 'key', + data: 'value' + }); +})(); + +(() => { + try { + swan.setStorageSync('key', 'value'); + } catch (e) { + } + swan.getStorage({ + key: 'key', + success(res) { + console.log(res.data); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + try { + const result = swan.getStorageSync('key'); + } catch (e) { + } + swan.getStorageInfo({ + success(res) { + console.log(res.keys); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + try { + const result = swan.getStorageInfoSync(); + console.log(result); + } catch (e) { + } +})(); + +(() => { + swan.removeStorage({ + key: 'key', + success(res) { + console.log(res); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + try { + swan.removeStorageSync('key'); + } catch (e) { + } + try { + swan.clearStorageSync(); + } catch (e) { + } +})(); + +(() => { + swan.getLocation({ + type: 'gcj02', + success(res) { + console.log('纬度:' + res.latitude); + console.log('经度:' + res.longitude); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); +})(); + +(() => { + swan.getLocation({ + type: 'gcj02', + success(res) { + swan.openLocation({ + latitude: res.latitude, + longitude: res.longitude, + scale: 18 + }); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); +})(); + +(() => { + let mapContext: swan.MapContext; + Page({ + data: { + latitude: '40.042500', + longitude: '116.274040', + }, + onReady() { + mapContext = swan.createMapContext('myMap'); + }, + getCenterLocation() { + mapContext.getCenterLocation({ + success(res) { + console.log("经度" + res.longitude); + console.log("纬度" + res.latitude); + } + }); + }, + moveToLocation() { + mapContext.moveToLocation(); + }, + translateMarker() { + mapContext.translateMarker({ + markerId: 0, + rotate: 90, + autoRotate: true, + duration: 1000, + destination: { + latitude: 23.10229, + longitude: 113.3345211, + }, + animationEnd() { + console.log('animation end'); + } + }); + }, + includePoints() { + mapContext.includePoints({ + padding: [10], + points: [{ + latitude: 23, + longitude: 113.33, + }, { + latitude: 23, + longitude: 113.3345211, + }] + }); + }, + getRegion() { + mapContext.getRegion({ + success(res) { + console.log("西南角的经纬度" + res.southwest); + console.log("东北角的经纬度" + res.northeast); + } + }); + } + }); +})(); + +(() => { + Page({ + onReady() { + const ctx = this.createCanvasContext('myCanvas'); + ctx.setFillStyle('#ff0000'); + ctx.arc(100, 100, 50, 0, 2 * Math.PI); + ctx.fill(); + ctx.draw(); + } + }); + Page({ + onReady() { + const ctx = this.createCanvasContext('myCanvas'); + } + }); + const ctx = swan.createCanvasContext('myCanvas'); + ctx.setFillStyle('#ff0000'); + ctx.arc(100, 100, 50, 0, 2 * Math.PI); + ctx.fill(); + + ctx.draw(); + + swan.canvasGetImageData({ + canvasId: 'myCanvas', + x: 0, + y: 0, + width: 100, + height: 100, + success(res) { + console.log(res); + } + }); + const data = new Uint8ClampedArray([255, 0, 0, 1]); + swan.canvasPutImageData({ + canvasId: 'myCanvas', + data, + x: 0, + y: 0, + width: 1, + height: 2, + success(res) { + console.log('success'); + } + }); + swan.canvasToTempFilePath({ + x: 100, + y: 200, + width: 50, + height: 50, + destWidth: 100, + destHeight: 100, + canvasId: 'myCanvas', + success(res) { + console.log(res.tempFilePath); + } + }); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.setFillStyle('blue'); + ctx.fillRect(30, 30, 150, 75); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.setFillStyle('blue'); + ctx.setShadow(10, 50, 50, 'red'); + ctx.fillRect(30, 30, 150, 75); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + // Create linear gradient + const grd = ctx.createLinearGradient(0, 0, 200, 0); + grd.addColorStop(0, 'blue'); + grd.addColorStop(1, 'red'); + + // Fill with gradient + ctx.setFillStyle(grd); + ctx.fillRect(30, 30, 150, 80); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + // Create circular gradient + const grd = ctx.createCircularGradient(75, 50, 50); + grd.addColorStop(0, 'red'); + grd.addColorStop(1, 'blue'); + + // Fill with gradient + ctx.setFillStyle(grd); + ctx.fillRect(30, 30, 150, 80); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + // Create circular gradient + const grd = ctx.createLinearGradient(30, 10, 120, 10); + grd.addColorStop(0, 'red'); + grd.addColorStop(0.16, 'orange'); + grd.addColorStop(0.33, 'yellow'); + grd.addColorStop(0.5, 'green'); + grd.addColorStop(0.66, 'cyan'); + grd.addColorStop(0.83, 'blue'); + grd.addColorStop(1, 'purple'); + + // Fill with gradient + ctx.setFillStyle(grd); + ctx.fillRect(30, 30, 150, 80); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.beginPath(); + ctx.moveTo(30, 10); + ctx.lineTo(200, 10); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(5); + ctx.moveTo(50, 30); + ctx.lineTo(200, 30); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(10); + ctx.moveTo(70, 50); + ctx.lineTo(200, 50); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(15); + ctx.moveTo(90, 70); + ctx.lineTo(200, 70); + ctx.stroke(); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.beginPath(); + ctx.moveTo(30, 10); + ctx.lineTo(200, 10); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('butt'); + ctx.setLineWidth(10); + ctx.moveTo(50, 30); + ctx.lineTo(200, 30); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('round'); + ctx.setLineWidth(10); + ctx.moveTo(70, 50); + ctx.lineTo(200, 50); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineCap('square'); + ctx.setLineWidth(10); + ctx.moveTo(90, 70); + ctx.lineTo(200, 70); + ctx.stroke(); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.beginPath(); + ctx.moveTo(10, 10); + ctx.lineTo(100, 50); + ctx.lineTo(10, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('bevel'); + ctx.setLineWidth(10); + ctx.moveTo(50, 10); + ctx.lineTo(140, 50); + ctx.lineTo(50, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('round'); + ctx.setLineWidth(10); + ctx.moveTo(90, 10); + ctx.lineTo(180, 50); + ctx.lineTo(90, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineJoin('miter'); + ctx.setLineWidth(10); + ctx.moveTo(130, 10); + ctx.lineTo(220, 50); + ctx.lineTo(130, 90); + ctx.stroke(); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.setLineDash([10, 20], 5); + ctx.beginPath(); + ctx.moveTo(0, 100); + ctx.lineTo(400, 100); + ctx.stroke(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.beginPath(); + ctx.setLineWidth(10); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(1); + ctx.moveTo(10, 10); + ctx.lineTo(100, 50); + ctx.lineTo(10, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(10); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(2); + ctx.moveTo(50, 10); + ctx.lineTo(140, 50); + ctx.lineTo(50, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(10); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(3); + ctx.moveTo(90, 10); + ctx.lineTo(180, 50); + ctx.lineTo(90, 90); + ctx.stroke(); + + ctx.beginPath(); + ctx.setLineWidth(10); + ctx.setLineJoin('miter'); + ctx.setMiterLimit(4); + ctx.moveTo(130, 10); + ctx.lineTo(220, 50); + ctx.lineTo(130, 90); + ctx.stroke(); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.rect(30, 30, 150, 75); + ctx.setFillStyle('blue'); + ctx.fill(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.setFillStyle('blue'); + ctx.fillRect(30, 30, 150, 75); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.setStrokeStyle('blue'); + ctx.strokeRect(30, 30, 150, 75); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.setFillStyle('red'); + ctx.fillRect(0, 0, 150, 200); + ctx.setFillStyle('blue'); + ctx.fillRect(150, 0, 150, 200); + ctx.clearRect(30, 30, 150, 75); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.moveTo(100, 100); + ctx.lineTo(10, 100); + ctx.lineTo(10, 10); + ctx.fill(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.moveTo(100, 100); + ctx.lineTo(10, 100); + ctx.lineTo(10, 10); + ctx.stroke(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.rect(10, 10, 100, 30); + ctx.setFillStyle('red'); + ctx.fill(); + ctx.beginPath(); + ctx.rect(10, 40, 100, 30); + ctx.setFillStyle('blue'); + ctx.fillRect(10, 70, 100, 30); + ctx.rect(10, 100, 100, 30); + ctx.setFillStyle('green'); + ctx.fill(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.moveTo(100, 100); + ctx.lineTo(10, 100); + ctx.lineTo(10, 10); + ctx.closePath(); + ctx.stroke(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.moveTo(10, 10); + ctx.lineTo(100, 10); + ctx.moveTo(10, 100); + ctx.lineTo(100, 100); + ctx.stroke(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.moveTo(10, 10); + ctx.rect(10, 10, 100, 50); + ctx.lineTo(110, 60); + ctx.stroke(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.arc(100, 75, 50, 0, 2 * Math.PI); + ctx.setFillStyle('blue'); + ctx.fill(); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + ctx.strokeRect(10, 10, 25, 15); + ctx.scale(2, 2); + ctx.strokeRect(10, 10, 25, 15); + ctx.scale(2, 2); + ctx.strokeRect(10, 10, 25, 15); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + ctx.strokeRect(100, 10, 150, 100); + ctx.rotate(20 * Math.PI / 180); + ctx.strokeRect(100, 10, 150, 100); + ctx.rotate(20 * Math.PI / 180); + ctx.strokeRect(100, 10, 150, 100); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + ctx.strokeRect(10, 10, 150, 100); + ctx.translate(20, 20); + ctx.strokeRect(10, 10, 150, 100); + ctx.translate(20, 20); + ctx.strokeRect(10, 10, 150, 100); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + swan.downloadFile({ + url: 'https://b.bdstatic.com/searchbox/icms/searchbox/img/LOGO300x300.jpg', + success(res) { + ctx.save(); + ctx.beginPath(); + ctx.arc(50, 50, 25, 0, 2 * Math.PI); + ctx.clip(); + ctx.drawImage(res.tempFilePath, 25, 25); + ctx.restore(); + ctx.draw(); + } + }); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + ctx.setFontSize(20); + ctx.fillText('20', 20, 20); + ctx.setFontSize(30); + ctx.fillText('30', 40, 40); + ctx.setFontSize(40); + ctx.fillText('40', 60, 60); + ctx.setFontSize(50); + ctx.fillText('50', 90, 90); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + ctx.setFontSize(20); + ctx.fillText('Hello', 20, 20); + ctx.fillText('World', 100, 100); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + ctx.setStrokeStyle('red'); + ctx.moveTo(150, 20); + ctx.lineTo(150, 170); + ctx.stroke(); + + ctx.setFontSize(15); + ctx.setTextAlign('left'); + ctx.fillText('textAlign=left', 150, 60); + + ctx.setTextAlign('center'); + ctx.fillText('textAlign=center', 150, 80); + + ctx.setTextAlign('right'); + ctx.fillText('textAlign=right', 150, 100); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + ctx.setStrokeStyle('red'); + ctx.moveTo(5, 75); + ctx.lineTo(295, 75); + ctx.stroke(); + + ctx.setFontSize(20); + + ctx.setTextBaseline('top'); + ctx.fillText('top', 5, 75); + + ctx.setTextBaseline('middle'); + ctx.fillText('middle', 50, 75); + + ctx.setTextBaseline('bottom'); + ctx.fillText('bottom', 120, 75); + + ctx.setTextBaseline('normal'); + ctx.fillText('normal', 200, 75); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + swan.chooseImage({ + success(res) { + ctx.drawImage(res.tempFilePaths[0], 0, 0, 150, 100); + ctx.draw(); + } + }); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + + ctx.setFillStyle('red'); + ctx.fillRect(10, 10, 150, 100); + ctx.setGlobalAlpha(0.2); + ctx.setFillStyle('blue'); + ctx.fillRect(50, 50, 150, 100); + ctx.setFillStyle('yellow'); + ctx.fillRect(100, 100, 150, 100); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.font = 'italic bold 20px cursive'; + const metrics = ctx.measureText('Hello World'); + console.log(metrics.width); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + const pattern = ctx.createPattern('/path/to/image', 'repeat-x'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 300, 150); + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + // Draw quadratic curve + ctx.beginPath(); + ctx.moveTo(20, 20); + ctx.bezierCurveTo(20, 100, 200, 100, 200, 20); + ctx.setStrokeStyle('black'); + ctx.stroke(); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + // Draw quadratic curve + ctx.beginPath(); + ctx.moveTo(20, 20); + ctx.quadraticCurveTo(20, 100, 200, 20); + ctx.setStrokeStyle('blue'); + ctx.stroke(); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + // save the default fill style + ctx.save(); + ctx.setFillStyle('blue'); + ctx.fillRect(10, 10, 150, 100); + + // restore to the previous saved state + ctx.restore(); + ctx.fillRect(50, 50, 150, 100); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + // save the default fill style + ctx.save(); + ctx.setFillStyle('blue'); + ctx.fillRect(10, 10, 150, 100); + + // restore to the previous saved state + ctx.restore(); + ctx.fillRect(50, 50, 150, 100); + + ctx.draw(); +})(); + +(() => { + const ctx = swan.createCanvasContext('myCanvas'); + ctx.setFillStyle('blue'); + ctx.fillRect(10, 10, 150, 100); + ctx.draw(); + ctx.fillRect(30, 30, 150, 100); + ctx.draw(); +})(); + +(() => { + swan.showToast({ + title: '我是标题', + icon: 'loading', + duration: 1000, + }); + swan.showLoading({ + title: '加载中', + mask: 'true' + }); + + setTimeout(() => { + swan.hideLoading(); + }, 2000); + + swan.showModal({ + title: '提示', + content: '这是一个模态弹窗', + cancelColor: '#999999', + confirmColor: '#0099cc', + success(res) { + if (res.confirm) { + console.log('用户点击了确定'); + } else if (res.cancel) { + console.log('用户点击了取消'); + } + } + }); + swan.showActionSheet({ + itemList: ['同意', '一般', '不同意'], + success(res) { + console.log(`用户点击了第${(res.tapIndex + 1)}个按钮`); + } + }); +})(); + +(() => { + swan.setNavigationBarTitle({ + title: '我是页面标题' + }); + swan.setNavigationBarColor({ + frontColor: '#ffffff', + backgroundColor: '#ff0000', + animation: { + duration: 500, + timingFunc: 'linear' + } + }); +})(); + +(() => { + swan.setTabBarBadge({ + index: 0, + text: '文本' + }); + swan.removeTabBarBadge({ + index: 0 + }); + swan.showTabBarRedDot({ + index: 0 + }); + swan.hideTabBarRedDot({ + index: 0 + }); + swan.setTabBarStyle({ + color: '#FFFFBD', + selectedColor: '#FFFFBD', + backgroundColor: '#FFFFBD', + borderStyle: 'white' + }); + swan.setTabBarItem({ + index: 0, + text: '文本', + // 图片路径 + iconPath: '/images/component_normal.png', + // 选中图片路径 + selectedIconPath: '/images/component_selected.png', + }); + swan.showTabBar({ + success(res) { + console.log(res); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); + swan.hideTabBar({ + success(res) { + console.log(res); + }, + fail(err) { + console.log('错误码:' + err.errCode); + console.log('错误信息:' + err.errMsg); + } + }); +})(); + +(() => { + swan.navigateTo({ + // 此路径为相对路径;如需写为绝对地址,则可写为‘/example/xxx?key=valu’。 + url: 'example/xxx?key=value' + }); + swan.redirectTo({ + // 此路径为相对路径;如需写为绝对地址,则可写为‘/example/xxx?key=valu’。 + url: 'example/xxx?key=value' + }); + swan.switchTab({ + url: '/list', + }); + // 注意:调用 navigateTo 跳转时,调用页面会被加入堆栈,而 redirectTo 方法则不会。见下方示例代码 + + // 当前是首页 + swan.navigateTo({ + url: 'list?key=value' + }); + + // 当前是列表页 + swan.navigateTo({ + url: 'detail?key=value' + }); + + // 在详情页内 navigateBack,将返回首页 + swan.navigateBack({ + delta: 2 + }); + swan.reLaunch({ + // 此路径为相对路径;如需写为绝对地址,则可写为‘/example/xxx?key=valu’。 + url: 'example/xxx?key=value' + }); +})(); + +(() => { + const animation = swan.createAnimation({ + transformOrigin: "50% 50%", + duration: 1000, + timingFunction: "ease", + delay: 0 + }); + Page({ + data: { + animationData: {} + }, + starttoanimate() { + const animation = swan.createAnimation(); + animation.rotate(90).translateY(10).step(); + animation.rotate(-90).translateY(-10).step(); + this.setData({ + animationData: animation.export() + }); + } + }); +})(); + +(() => { + swan.pageScrollTo({ + scrollTop: 0, + duration: 300 + }); +})(); + +(() => { + Page({ + onPullDownRefresh() { + // do something + } + }); + swan.startPullDownRefresh(); + swan.stopPullDownRefresh(); +})(); + +(() => { + swan.createIntersectionObserver({} as any, { + selectAll: true + }).relativeTo('.container') + .observe('.ball', res => { + console.log(res.intersectionRect); // 相交区域 + console.log(res.intersectionRect.left); // 相交区域的左边界坐标 + console.log(res.intersectionRect.top); // 相交区域的上边界坐标 + console.log(res.intersectionRect.width); // 相交区域的宽度 + console.log(res.intersectionRect.height); // 相交区域的高度 + }); + Page({ + queryMultipleNodes() { + const query = swan.createSelectorQuery(); + query.select('#the-id').boundingClientRect(); + query.selectViewport().scrollOffset(); + query.exec((res) => { + // res[0].top, // #the-id节点的上边界坐标 + // res[1].scrollTop // 显示区域的竖直滚动位置 + }); + } + }); + Component({ + // queryMultipleNodes() { + // const query = swan.createSelectorQuery().in(this); + // query.select('#the-id').boundingClientRect((res) => { + // // res.top // 这个组件内 #the-id 节点的上边界坐标 + // }).exec(); + // } + }); + Page({ + getRect() { + swan.createSelectorQuery().select('#the-id').boundingClientRect((res) => { + const rect = res as swan.NodesRefRect; + rect.id; // 节点的ID + rect.dataset; // 节点的dataset + rect.left; // 节点的左边界坐标 + rect.right; // 节点的右边界坐标 + rect.top; // 节点的上边界坐标 + rect.bottom; // 节点的下边界坐标 + rect.width; // 节点的宽度 + rect.height; // 节点的高度 + }).exec(); + }, + getAllRects() { + swan.createSelectorQuery().selectAll('.a-class').boundingClientRect((rects) => { + (rects as swan.NodesRefRect[]).forEach((rect) => { + rect.id; // 节点的ID + rect.dataset; // 节点的dataset + rect.left; // 节点的左边界坐标 + rect.right; // 节点的右边界坐标 + rect.top; // 节点的上边界坐标 + rect.bottom; // 节点的下边界坐标 + rect.width; // 节点的宽度 + rect.height; // 节点的高度 + }); + }).exec(); + } + }); + Page({ + getScrollOffset() { + swan.createSelectorQuery().selectViewport().scrollOffset((res) => { + res.id; // 节点的ID + res.dataset; // 节点的dataset + res.scrollLeft; // 节点的水平滚动位置 + res.scrollTop; // 节点的竖直滚动位置 + }).exec(); + } + }); + Page({ + getFields() { + swan.createSelectorQuery().select('#the-id').fields({ + dataset: true, + size: true, + scrollOffset: true, + properties: ['scrollX', 'scrollY'], + computedStyle: ['margin', 'backgroundColor'] + }, (res) => { + res.dataset; // 节点的dataset + res.width; // 节点的宽度 + res.height; // 节点的高度 + res.scrollLeft; // 节点的水平滚动位置 + res.scrollTop; // 节点的竖直滚动位置 + res.scrollX; // 节点 scroll-x 属性的当前值 + res.scrollY; // 节点 scroll-y 属性的当前值 + // 此处返回指定要返回的样式名 + res.margin; + res.backgroundColor; + }).exec(); + } + }); +})(); + +(() => { + swan.getSystemInfo({ + success(res) { + console.log(res.model); + console.log(res.pixelRatio); + console.log(res.windowWidth); + console.log(res.windowHeight); + console.log(res.language); + console.log(res.version); + console.log(res.platform); + } + }); + try { + const res = swan.getSystemInfoSync(); + console.log(res.model); + console.log(res.pixelRatio); + console.log(res.windowWidth); + console.log(res.windowHeight); + console.log(res.language); + console.log(res.version); + console.log(res.platform); + } catch (e) { + // Do something when catch error + } + try { + const res = swan.getEnvInfoSync(); + console.log(res.appKey); + console.log(res.appName); + console.log(res.lastAppURL); + console.log(res.sdkVersion); + console.log(res.scheme); + } catch (e) { + // Do something when catch error + } + swan.canIUse('view.hover-class'); + swan.canIUse('scroll-view.scroll-x'); + swan.canIUse('cover-view'); + swan.canIUse('button.size.default'); + swan.canIUse('button.size.default'); + swan.canIUse('request.object.success.data'); + swan.canIUse('getSavedFileList'); + swan.canIUse('getSavedFileList.object'); + swan.canIUse('getSavedFileList.object.success'); +})(); + +(() => { + swan.onMemoryWarning((res) => { + console.log('onMemoryWarningReceive'); + }); +})(); + +(() => { + swan.getNetworkType({ + success(res) { + console.log(res.networkType); + } + }); + swan.onNetworkStatusChange((res) => { + console.log(res.isConnected); + console.log(res.networkType); + }); +})(); + +(() => { + swan.onAccelerometerChange((res) => { + console.log(res.x); + console.log(res.y); + console.log(res.z); + }); + swan.startAccelerometer({ + interval: 'ui' + }); + swan.stopAccelerometer(); +})(); + +(() => { + swan.onCompassChange((res) => { + console.log(res.direction); + }); + swan.startCompass(); + swan.stopCompass(); +})(); + +(() => { + swan.scanCode({ + success(res) { + console.log(res.result); + console.log(res.scanType); + } + }); +})(); + +(() => { + swan.onUserCaptureScreen(() => { + console.log('用户截屏了'); + }); +})(); + +(() => { + swan.makePhoneCall({ + phoneNumber: '000000' // 仅为示例,并非真实的电话号码 + }); +})(); + +(() => { + swan.setClipboardData({ + data: 'baidu', + success(res) { + swan.getClipboardData({ + success(res) { + console.log(res.data); // baidu + } + }); + } + }); + swan.getClipboardData({ + success(res) { + console.log(res.data); + } + }); +})(); + +(() => { + swan.getExtConfig({ + success(res) { + console.log(res.extConfig); + } + }); + const data = swan.getExtConfigSync(); + console.log(data.extConfig); +})(); + +(() => { + swan.login({ + success(res) { + swan.request({ + url: 'https://xxx/xxx', // 开发者服务器地址 + data: { + code: res.code + } + }); + }, + fail(err) { + console.log('login fail', err); + } + }); + swan.checkSession({ + success(res) { + console.log('登录态有效'); + swan.getUserInfo({ + success(res) { + console.log('用户名', res.userInfo.nickName); + swan.request({ + url: "https://xxx/decrypt_user_data", // 开发者服务器地址,对 data 进行解密 + data: { + data: res.data, + iv: res.iv + } + }); + } + }); + }, + fail(err) { + console.log('登录态无效'); + swan.login({ + success(res) { + swan.request({ + url: 'https://xxx/xxx', // 开发者服务器地址,用 code 换取 session_key + data: { + code: res.code + } + }); + }, + fail(err) { + console.log('登录失败', err); + } + }); + } + }); + + try { + const result = swan.isLoginSync(); + console.log('isLoginSync', result); + } catch (e) { + console.log('error', e); + } +})(); + +(() => { + swan.authorize({ + scope: 'scope.userLocation', + success(res) { + // 用户已经同意智能小程序使用定位功能 + swan.getLocation(); + } + }); +})(); + +(() => { + swan.getSwanId({ + success(res) { + console.log(res.data.swanid); + } + }); + swan.getUserInfo({ + success(res) { + console.log('用户名', res.userInfo.nickName); + } + }); +})(); + +(() => { + swan.openSetting({ + success(res) { + console.log(res.authSetting['scope.userInfo']); + console.log(res.authSetting['scope.userLocation']); + } + }); + swan.getSetting({ + success(res) { + console.log(res.authSetting['scope.userInfo']); + console.log(res.authSetting['scope.userLocation']); + } + }); +})(); + +(() => { + Page({ + onShareAppMessage() { + return { + title: '智能小程序示例', + content: '世界很复杂,百度更懂你', + path: '/pages/openShare/openShare?key=value' + }; + } + }); + swan.openShare({ + title: '智能小程序示例', + content: '世界很复杂,百度更懂你', + path: '/pages/openShare/openShare?key=value' + }); +})(); + +(() => { + swan.chooseAddress({ + success(res) { + console.log(res.userName); + console.log(res.postalCode); + console.log(res.provinceName); + console.log(res.cityName); + console.log(res.countyName); + console.log(res.detailInfo); + console.log(res.telNumber); + } + }); +})(); + +(() => { + swan.requestPolymerPayment({ + orderInfo: { + dealId: "470193086", + appKey: "MMMabc", + totalAmount: "1", + tpOrderId: "3028903626", + dealTitle: "智能小程序Demo支付测试", + signFieldsRange: 1, + rsaSign: '', + bizInfo: '' + }, + success(res) { + swan.showToast({ + title: '支付成功', + icon: 'success' + }); + }, + fail(err) { + swan.showToast({ + title: JSON.stringify(err) + }); + console.log('pay fail', err); + } + }); +})(); + +(() => { + swan.chooseInvoiceTitle({ + success(res) { + console.log(res.type); + console.log(res.title); + console.log(res.taxNumber); + console.log(res.companyAddress); + console.log(res.telephone); + console.log(res.bankName); + console.log(res.bankAccount); + } + }); +})(); + +(() => { + swan.navigateToSmartProgram({ + appKey: '4fecoAqgCIUtzIyA4FAPgoyrc4oUc25c', // 要打开的小程序 App Key + path: '', // 打开的页面路径,如果为空则打开首页 + extraData: { + foo: 'baidu' + }, + success(res) { + // 打开成功 + } + }); + swan.navigateBackSmartProgram({ + extraData: { + foo: 'baidu' + }, + success(res) { + // 返回成功 + } + }); +})(); + +(() => { + if (swan.setMetaDescription) { + swan.setMetaDescription({ + content: '当前小程序页面描述信息', + success(res) { + console.log('设置成功'); + }, + fail(res) { + console.log('设置失败'); + }, + complete(res) { + console.log('设置失败'); + } + }); + } + if (swan.setMetaKeywords) { + swan.setMetaKeywords({ + content: '小程序, 关键字', + success(res) { + console.log('设置成功'); + }, + fail(res) { + console.log('设置失败'); + }, + complete(res) { + console.log('设置失败'); + } + }); + } + if (swan.setDocumentTitle) { + swan.setDocumentTitle({ + title: '我是页面标题' + }); + } +})(); + +(() => { + swan.loadSubPackage({ + root: 'subpackage', + success(res) { + console.log('下载成功', res); + }, + fail(err) { + console.log('下载失败', err); + } + }); +})(); + +(() => { + const updateManager = swan.getUpdateManager(); + + updateManager.onCheckForUpdate((res) => { + // 请求完新版本信息的回调 + console.log(res.hasUpdate); + }); + + updateManager.onUpdateReady((res) => { + swan.showModal({ + title: '更新提示', + content: '新版本已经准备好,是否重启应用?', + success(res) { + if (res.confirm) { + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate(); + } + } + }); + }); + + updateManager.onUpdateFailed((res) => { + // 新的版本下载失败 + }); +})(); + +(() => { + // 打开调试 + swan.setEnableDebug({ + enableDebug: true + }); + + // 关闭调试 + swan.setEnableDebug({ + enableDebug: false + }); +})(); + +(() => { + swan.reportAnalytics('purchase', { + price: 120, + color: 'red' + }); +})(); diff --git a/types/baidu-app/index.d.ts b/types/baidu-app/index.d.ts new file mode 100644 index 0000000000..244e9dd473 --- /dev/null +++ b/types/baidu-app/index.d.ts @@ -0,0 +1,4758 @@ +// Type definitions for swan-app 2.2 +// Project: https://smartprogram.baidu.com/docs/develop/tutorial/codedir/ +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.8 + +declare namespace swan { + // #region 基本参数 + interface DataResponse { + /** 回调函数返回的内容 */ + data: string | ArrayBuffer; + statusCode: number; + header: any; + result: string; + } + interface ErrMsgResponse { + /** 成功:ok,错误:详细信息 */ + errMsg: "ok" | string; + } + interface TempFileResponse { + /** 文件的临时路径 */ + tempFilePath: string; + /** 开发者服务器返回的 HTTP 状态码 */ + statusCode: number; + } + interface BaseOptions { + /** 接口调用成功的回调函数 */ + success?(res: R): void; + /** 接口调用失败的回调函数 */ + fail?(res: E): void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?(res: any): void; + } + interface ErrCodeResponse { + errCode: number; + } + // #endregion + // #region 网络API列表 + // 发起请求 + interface RequestHeader { + [key: string]: string; + } + interface RequestOptions extends BaseOptions { + /** 开发者服务器接口地址 */ + url: string; + /** 请求的参数 */ + data?: string | object; + /** 设置请求的 header , header 中不能设置 Referer */ + header?: RequestHeader; + /** 默认为 GET,有效值:OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT */ + method?: + | "GET" + | "OPTIONS" + | "GET" + | "HEAD" + | "POST" + | "PUT" + | "DELETE"; + /** 如果设为json,会尝试对返回的数据做一次 JSON.parse 默认值为json */ + dataType?: string; + /** + * 设置响应的数据类型。合法值:text、arraybuffer 默认值为text + * @version 1.7.0 + */ + responseType?: string; + /** 收到开发者服务成功返回的回调函数,res = {data: '开发者服务器返回的内容'} */ + success?(res: DataResponse): void; + fail?(err: { errCode: number; errMsg: string; }): void; + } + /** + * swan.request发起的是https请求。一个微信小程序,同时只能有5个网络请求连接。 + */ + function request(options: RequestOptions): RequestTask; + + /** + * 返回一个 requestTask 对象,通过 requestTask,可中断请求任务。 + */ + interface RequestTask { + abort(): void; + } + + interface UploadTask { + /** + * 监听上传进度变化 + * @version 1.4.0 + */ + onProgressUpdate( + callback?: ( + res: { + /** 上传进度百分比 */ + progress: number; + /** 已经上传的数据长度,单位 Bytes */ + totalBytesSent: number; + /** 预期需要上传的数据总长度,单位 Bytes */ + totalBytesExpectedToSend: number; + } + ) => void + ): void; + /** + * 中断下载任务 + * @version 1.4.0 + */ + abort(): void; + } + // 上传下载 + interface UploadFileOptions extends BaseOptions { + /** 开发者服务器 url */ + url: string; + /** 要上传文件资源的路径 */ + filePath: string; + /** 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 */ + name: string; + /** HTTP 请求 Header , header 中不能设置 Referer */ + header?: RequestHeader; + /** HTTP 请求中其他额外的 form data */ + formData?: any; + } + interface UploadFileResponse { + data: string; // 开发者服务器返回的数据 + statusCode: number; // 开发者服务器返回的 HTTP 状态码 + } + /** + * 将本地资源上传到开发者服务器。 + * 如页面通过 swan.chooseImage 等接口获取到一个本地资源的临时文件路径后, + * 可通过此接口将本地资源上传到指定服务器。 + * 客户端发起一个 HTTPS POST 请求, + * 其中 Content-Type 为 multipart/form-data 。 + */ + function uploadFile(options: UploadFileOptions): UploadTask; + interface DownloadTask { + /** + * 监听下载进度变化 + * @version 1.4.0 + */ + onProgressUpdate( + callback?: ( + res: { + /** 下载进度百分比 */ + progress: number; + /** 已经下载的数据长度,单位 Bytes */ + totalBytesWritten: number; + /** 预期需要下载的数据总长度,单位 Bytes */ + totalBytesExpectedToWrite: number; + } + ) => void + ): void; + /** + * 中断下载任务 + * @version 1.4.0 + */ + abort(): void; + } + interface DownloadFileOptions extends BaseOptions { + /** 下载资源的 url */ + url: string; + /** HTTP 请求 Header */ + header?: RequestHeader; + /** 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} */ + success?(res: TempFileResponse): void; + } + /** + * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求, + * 把下载到的资源根据 type 进行处理,并返回文件的本地临时路径。 + */ + function downloadFile(options: DownloadFileOptions): DownloadTask; + // WebSocket + interface ConnectSocketOptions extends BaseOptions { + /** 开发者服务器接口地址,必须是 HTTPS 协议,且域名必须是后台配置的合法域名 */ + url: string; + /** HTTP Header , header 中不能设置 Referer */ + header?: RequestHeader; + /** 默认是GET,有效值为: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT */ + method?: string; + /** + * 子协议数组 + * @version 1.4.0 + */ + protocols?: string[]; + } + /** + * 创建一个 WebSocket 连接; + * 一个微信小程序同时只能有一个 WebSocket 连接, + * 如果当前已存在一个 WebSocket 连接, + * 会自动关闭该连接,并重新创建一个 WebSocket 连接。 + */ + function connectSocket(options: ConnectSocketOptions): void; + /** 监听WebSocket连接打开事件。 */ + function onSocketOpen(callback: (res: any) => void): void; + /** 监听WebSocket错误。 */ + function onSocketError(callback: (error: any) => void): void; + interface SendSocketMessageOptions extends BaseOptions { + /** 需要发送的内容 */ + data: string | ArrayBuffer; + } + /** + * 通过 WebSocket 连接发送数据,需要先 swan.connectSocket, + * 并在 swan.onSocketOpen 回调之后才能发送。 + */ + function sendSocketMessage(options: SendSocketMessageOptions): void; + /** + * 监听WebSocket接受到服务器的消息事件。 + */ + function onSocketMessage(callback: (res: DataResponse) => void): void; + /** + * 关闭WebSocket连接。 + */ + interface CloseSocketOptions extends BaseOptions { + code?: number; // 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) 1.4.0 + reason?: string; // 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) + } + + /** + * 关闭WebSocket连接。 + */ + function closeSocket(options?: CloseSocketOptions): void; + /** 监听WebSocket关闭。 */ + function onSocketClose(callback: (res: any) => void): void; + /** + * 在接入AI之前需要使用管理员权限操作详细情况官网 + * https://smartprogram.baidu.com/docs/develop/api/ai/ + */ + // #region AI + namespace ai { + /** + * 用户向服务请求识别身份证,身份证识别包括正面和背面。 + */ + interface ocrIdCardOptions extends BaseOptions { + image: string; // 图片资源地址 + detect_direction?: boolean; // 是否检测图像旋转,可检验图像的选装方向和旋转角度。true:检测旋转角度并矫正识别。针对摆放情况不可控制的情况建议本参数置为true; false: 不检测旋转角度,默认不检测。 + id_card_side?: string; // front:身份证含照片的一面;back:身份证带国徽的一面。 + detect_risk?: boolean; // 是否开启身份证风险类型(身份证复印件、临时身份证、身份证翻拍、修改过的身份证)功能,默认不开启,即:false。可选值:true-开启;false-不开启。 + success?(res: ocrIdCardResponse): void; + } + /** + * 识别银行卡并返回卡号、发卡行和卡片类型。 + */ + interface ocrBankCardOptions extends BaseOptions { + image: string; // 图片资源地址 + success?(res: ocrBankCardResponse): void; + } + /** + * 对机动车驾驶证所有关键字段进行识别。 + */ + interface ocrDrivingLicenseOptions extends BaseOptions { + image: string; // 图片资源地址 + detect_direction?: boolean; // 是否检测图像旋转,可检验图像的选装方向和旋转角度。true:检测旋转角度并矫正识别。针对摆放情况不可控制的情况建议本参数置为true;false:不检测旋转角度,默认不检测。 + unified_valid_period?: boolean; // true: 归一化格式输出;false 或无此参数按非归一化格式输出。 + success?(res: ocrDrivingLicenseResponse): void; + } + /** + * 对机动车行驶证正本所有关键字段进行识别 + */ + interface ocrVehicleLicenseOptions extends BaseOptions { + image: string; // 图片资源地址 + detect_direction?: boolean; // 是否检测图像旋转,可检验图像的选装方向和旋转角度。true:检测旋转角度并矫正识别。针对摆放情况不可控制的情况建议本参数置为true; false:不检测旋转角度,默认不检测。 + accuracy?: string; // normal 使用快速服务,1200ms左右时延;缺省或其它值使用高精度服务,1600ms左右时延。 + success?(res: ocrVehicleLicenseResponse): void; + } + interface ocrIdCardResponse { + direction: number; // 图像方向,当 detect_direction=true 时存在。-1: 未定义,0: 正向,1: 逆时针90度,2: 逆时针180度,3: 逆时针270度。 + image_status: string; // normal-识别正常;reversed_side-身份证正反面颠倒;non_idcard-上传的图片中不包含身份证;blurred-身份证模糊;other_type_card-其他类型证照;over_exposure-身份证关键字段反光或过曝;unknown-未知状态。 + risk_type: string; // 输入参数 detect_risk = true 时,则返回该字段识别身份证类型: normal-正常身份证;copy-复印件;temporary-临时身份证;screen-翻拍;unknown-其他未知情况。 + edit_tool: string; // 如果参数 detect_risk = true 时,则返回此字段。如果检测身份证被编辑过,该字段指定编辑软件名称,如:Adobe Photoshop CC 2014 (Macintosh),如果没有被编辑过则返回值无此参数。 + log_id: string; // 唯一的log id,用于问题定位。 + words_result_num: number; // 识别结果数,表示words_result的元素个数。 + words_result: { // 定位和识别结果 + [key: string]: { + location: { // 位置数组(坐标0点为左上角) + left: number; // 表示定位位置的长方形左上顶点的水平坐标。 + top: number; // 表示定位位置的长方形左上顶点的垂直坐标。 + width: number; // 表示定位位置的长方形的宽度。 + height: number; // 表示定位位置的长方形的高。 + } + words: string; // 识别结果字符串 + } + }; + } + interface ocrBankCardResponse { + log_id: string; // 请求标识码,随机数,唯一。 + result: { // 返回结果 + bank_card_number: string; // 银行卡卡号 + bank_name: string; // 银行名,不能识别时为空 。 + bank_card_type: string; // 银行卡类型,0: 不能识别; 1: 借记卡; 2: 信用卡 。 + }; + } + interface ocrDrivingLicenseResponse { + log_id: string; // 唯一的log id,用于问题定位。 + words_result_num: number; // 识别结果数,表示 words_result 的元素个数。 + words_result: { + [key: string]: { words: string }; + }; + } + interface ocrVehicleLicenseResponse { + log_id: string; // 唯一的log id,用于问题定位。 + words_result_num: number; // 识别结果数,表示 words_result 的元素个数。 + words_result: { + [key: string]: { words: string }; + }; + } + /** + * 用户向服务请求识别身份证,身份证识别包括正面和背面。 + */ + function ocrIdCard(options: ocrIdCardOptions): void; + /** + * 识别银行卡并返回卡号、发卡行和卡片类型。 + */ + function ocrBankCard(options: ocrBankCardOptions): void; + /** + * 对机动车驾驶证所有关键字段进行识别。 + */ + function ocrDrivingLicense(options: ocrDrivingLicenseOptions): void; + /** + * 对机动车行驶证正本所有关键字段进行识别 + */ + function ocrVehicleLicense(options: ocrVehicleLicenseOptions): void; + /** + * 运用业界领先的深度学习技术,判断一段文本内容是否符合网络发文规范,实现 + * 自动化、智能化的文本审核。 + */ + interface textReviewOptions extends BaseOptions { + content: string; // 待审核文本,UTF-8,不可为空,不超过20000字节。 + success?(res: textReviewResponse): void; + } + interface textReviewResponse { + log_id: string; // 唯一的log id,用于问题定位。 + result: { // 审核结果详情 + spam: number; // 请求中是否包含违禁,0表示非违禁,1表示违禁,2表示建议人工复审 。 + reject: any[]; // 审核未通过的类别列表与详情 + review: any[]; // 待人工复审的类别列表与详情 + pass: Array<{ // 审核通过的类别列表与详情 + label: number; // 请求中的违禁类型 + score: number; // 违禁检测分,范围 0~1,数值从低到高代表风险程度的高低 。 + hit: string[]; // 违禁类型对应命中的违禁词集合,可能为空 。 + }>; + }; + /** + * 违禁labels类型说明: + * 值 说明 + * 1 暴恐违禁 + * 2 文本色情 + * 3 政治敏感 + * 4 恶意推广 + * 5 低俗辱骂 + */ + } + /** + * 运用业界领先的深度学习技术,判断一段文本内容是否符合网络发文规范,实现 + * 自动化、智能化的文本审核。 + */ + function textReview(options: textReviewOptions): void; + /** + * 将文本转换为可以播放的mp3文件。 + */ + interface textToAudioOptions extends BaseOptions { + tex: string; // 合成的文本,使用UTF-8编码,小于512个中文字或者英文数字(文本在百度服务器内转换为GBK后,长度必须小于1024字节)。 + ctp?: string | number; // 客户端类型选择,Web端填写固定值1。 + lan?: string; // 固定值zh。语言选择,目前只有中英文混合模式,填写固定值zh。 + spd?: string; // 语速,取值0-9,默认为5中语速。 + pit?: string; // 音调,取值0-9,默认为5中语调。 + vol?: string; // 音量,取值0-9,默认为5中音量。 + per?: string; // 发音人选择, 0为普通女声,1为普通男生,3为情感合成-度逍遥,4为情感合成-度丫丫,默认为普通女声。 + success?(res: textToAudioResponse): void; + } + interface textToAudioResponse { + filePath: string; + } + /** + * 将文本转换为可以播放的mp3文件。 + */ + function textToAudio(options: textToAudioOptions): void; + /** + * 自定义图像审核。 + */ + interface imageAuditOptions extends BaseOptions { + image: string; // 图像资源地址 + imgUrl?: string; // 网图URL地址,以网图形式请求,图片Url需要做UrlEncode,不能与image并存。 + success?(res: imageAuditResponse): void; + } + interface imageAuditResponse { + log_id: string; // 请求唯一id + conclusion: string; // 审核结果描述,成功才返回,失败不返回。 + conclusionType: number; // 审核结果标识,成功才返回,失败不返回。 + data: imageAuditdata[]; + // 审核项详细信息,响应成功并且conclusion为疑似或不合规时才返回,响应失败或conclusion为合规是不返回。 + } + interface imageAuditdata { + type: number; + msg: number; + probability: number; + stars: imageAuditdata[]; + words: number; + } + /** + * 自定义图像审核。 + */ + function imageAudit(options: imageAuditOptions): void; + /** + * 通用物体及场景识别,即对于输入的一张图片(可正常解码,且长宽比适宜),输出图片中的多个物体及场景标签。 + */ + interface GeneralIdentifyOptions extends BaseOptions { + image: string; // 图像资源地址 + success?(res: GeneralIdentifyResponse): void; + } + interface GeneralIdentifyResponse { + log_id: number; // 唯一的log id,用于问题定位。 + result_num: number; // 返回结果数目,及result数组中的元素个数。 + result: Array<{ // 标签结果数组 + keyword: string; // 图片中的物体或场景名称 + score: number; // 置信度,0-1 + root: string; // 识别结果的上层标签,有部分钱币、动漫、烟酒等tag无上层标签。 + }>; + } + /** + * 通用物体及场景识别,即对于输入的一张图片(可正常解码,且长宽比适宜),输出图片中的多个物体及场景标签。 + */ + function advancedGeneralIdentify(options: GeneralIdentifyOptions): void; + /** + * 用户向服务请求检测图像中的主体位置。 + */ + interface DetectIdentifyOptions extends BaseOptions { + image: string; // 图像资源地址 + with_face?: number; // 如果检测主体是人,主体区域是否带上人脸部分,0-不带人脸区域,其他-带人脸区域,裁剪类需求推荐带人脸,检索/识别类需求推荐不带人脸。默认取1,带人脸。 + success?(res: DetectIdentifyResponse): void; + } + interface DetectIdentifyResponse { + log_id: number; // 唯一的log id,用于问题定位。 + result: { // 裁剪结果 + left: number; // 表示定位位置的长方形左上顶点的水平坐标。 + top: number; // 表示定位位置的长方形左上顶点的垂直坐标。 + width: number; // 表示定位位置的长方形的宽度。 + height: number; // 表示定位位置的长方形的高度。 + }; + } + /** + * 用户向服务请求检测图像中的主体位置。 + */ + function objectDetectIdentify(options: DetectIdentifyOptions): void; + /** + * 用于检测一张车辆图片的具体车型,即对于输入的一张图片(可正常解码,且长 + * 宽比适宜),输出图片的车辆品牌及型号、颜色及年份、位置信息。 + */ + interface carClassifyOptions extends BaseOptions { + image: string; // 图像资源地址 + color_result?: string; // 颜色 + top_num?: number; // 返回结果top n,默认5。 + success?(res: carClassifyResponse): void; + } + interface carClassifyResponse { + log_id: number; // 唯一的log id,用于问题定位。 + result: Array<{ + name: string; // 车型名称,示例:宝马x6 + score: number; // 置信度,示例:0.5321 + year: string; // 年份 + }>; + location_result: { // 车在图片中的位置信息 + left: number; // 左起像素位置 + top: number; // 上起像素位置 + width: number; // 像素宽 + height: number; // 像素高 + }; + } + /** + * 用于检测一张车辆图片的具体车型,即对于输入的一张图片(可正常解码,且长 + * 宽比适宜),输出图片的车辆品牌及型号、颜色及年份、位置信息。 + */ + function carClassify(options: carClassifyOptions): void; + /** + * 用于菜品识别,即对于输入的一张图片(可正常解码,且长宽比适宜),输出图 + * 片的菜品名称、卡路里信息、置信度。 + */ + interface dishClassifyOptions extends BaseOptions { + image: string; // 图像资源地址 + filter_threshold?: number; // 默认0.95,可以通过该参数调节识别效果,降低非菜识别率. + top_num?: number; // 返回结果top n,默认5。 + success?(res: dishClassifyResponse): void; + } + interface dishClassifyResponse { + log_id: number; // 唯一的log id,用于问题定位。 + result_num: number; // 返回结果数目,及result数组中的元素个数。 + result: Array<{ // 菜品识别结果数组 + name: string; // 菜名,示例:鱼香肉丝。 + calorie: number; // 卡路里,每100g的卡路里含量。 + probability: number; // 识别结果中每一行的置信度值,0-1。 + }>; + } + /** + * 用于菜品识别,即对于输入的一张图片(可正常解码,且长宽比适宜),输出图 + * 片的菜品名称、卡路里信息、置信度。 + */ + function dishClassify(options: dishClassifyOptions): void; + /** + * 用于检测和识别图片中的品牌 LOGO 信息 + */ + interface logoClassifyOptions extends BaseOptions { + image: string; // 图像资源地址 + custom_lib?: boolean; // 是否只检索用户子库,true则只检索用户子库,false(默认)为检索底库+用户子库。 + success?(res: logoClassifyResponse): void; + } + interface logoClassifyResponse { + log_id: number; // 唯一的log id,用于问题定位。 + result_num: number; // 识别结果数,标识返回结果数目。 + result: Array<{ // 菜品识别结果数组 + type: number; // type=0 为1千种高优商标识别结果;type=1 为2万类logo库的结果;其它type为自定义logo库结果。 + name: number; // 识别的品牌名称 + probability: number; // 分类结果置信度(0–1.0) + location: { + left: number; // 左起像素位置 + top: number; // 上起像素位置 + width: number; // 像素宽 + height: number; // 像素高 + }; // 位置信息(左起像素位置、上起像素位置、像素宽、像素高) + }>; + } + /** + * 用于检测和识别图片中的品牌 LOGO 信息 + */ + function logoClassify(options: logoClassifyOptions): void; + /** + * 用于检测和识别图片中的动物信息 + */ + interface animalClassifyOptions extends BaseOptions { + image: string; // 图像资源地址 + top_num?: number; // 返回预测得分top结果数,默认为6 + success?(res: animalClassifyResponse): void; + } + interface animalClassifyResponse { + log_id: number; // 唯一的log id,用于问题定位。 + result_num: number; // 识别结果数,标识返回结果数目。 + result: Array<{ // 菜品识别结果数组 + name: number; // 动物名称,示例:蒙古马。 + score: number; // 置信度,示例:0.5321。 + }>; + } + /** + * 用于检测和识别图片中的动物信息 + */ + function animalClassify(options: animalClassifyOptions): void; + /** + * 用于检测和识别图片中的植物信息 + */ + interface plantClassifyOptions extends BaseOptions { + image: string; // 图像资源地址 + success?(res: plantClassifyResponse): void; + } + interface plantClassifyResponse { + log_id: number; // 唯一的log id,用于问题定位。 + result: Array<{ // 菜品识别结果数组 + name: number; // 植物名称,示例:吉娃莲。 + score: number; // 置信度,示例:0.5321。 + }>; + } + /** + * 用于检测和识别图片中的植物信息 + */ + function plantClassify(options: plantClassifyOptions): void; + + /** + * 获取全局唯一的语音识别器voiceRecognizer。 + */ + interface VoiceRecognizerStart { + mode?: string; // 听音模式,有效值dnn/touch + longSpeech?: boolean; // 是否开启长语音 + context?: string; // 语音识别所用的场景值,有效值见下表格。 + } + interface VoiceRecognizeResponse { + result: string; // 小程序语音识别过程中的返回内容 + } + interface VoiceErrorResponse { + result: string; // 小程序语音识别过程中的返回内容 + } + interface VoiceRecognizerTask { + start(options: VoiceRecognizerStart): void; // 开始; + stop(): void; // 停止; + cancel(): void; // 取消; + onStart(callback: () => void): void; // 引擎准备就绪,可以开始说话; + onRecognize(callback: (res: VoiceRecognizeResponse) => void): void; // ;有识别结果返回 + onFinish(callback: (res: DataResponse) => void): void; // 识别完成; + onError(callback: (res: VoiceErrorResponse) => void): void; // 识别遇到错;误 + } + /** + * 获取全局唯一的语音识别器voiceRecognizer。 + */ + function getVoiceRecognizer(): VoiceRecognizerTask; + } + // #endregion + + // #endregion + // #region 媒体API列表 + // 媒体-----图片 + type ImageSizeType = "original" | "compressed"; + type ImageSourceType = "album" | "camera"; + type VideoSourceType = "album" | "camera"; + type CameraDevice = "front" | "back"; + interface TempFile { + /** 本地文件路径 */ + path: string; + /** 本地文件大小,单位:B */ + size: number; + } + interface TempFilesData { + /** 文件的临时路径 */ + tempFilePaths: string; + /** + * 图片的本地文件列表,每一项是一个 File 对象 + * @version 1.2.0 + */ + tempFiles: TempFile[]; + } + interface ChooseImageOptions extends BaseOptions { + /** 最多可以选择的图片张数,默认9 */ + count?: number; + /** original 原图,compressed 压缩图,默认二者都有 */ + sizeType?: ImageSizeType[]; + /** album 从相册选图,camera 使用相机,默认二者都有 */ + sourceType?: ImageSourceType[]; + /** 成功则返回图片的本地文件路径列表 tempFilePaths */ + success(res: TempFilesData): void; + } + /** + * 从本地相册选择图片或使用相机拍照。 + */ + function chooseImage(options: ChooseImageOptions): void; + interface PreviewImageOptions extends BaseOptions { + /** 当前显示图片的链接,不填则默认为 urls 的第一张 */ + current?: string; + /** 需要预览的图片链接列表 */ + urls: string[]; + } + /** + * 预览图片。 + */ + function previewImage(options: PreviewImageOptions): void; + interface GetImageInfoOptions extends BaseOptions { + /** + * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 + */ + src: string; + } + /** + * 获取图片信息 + */ + function getImageInfo(options: GetImageInfoOptions): void; + interface SaveImageToPhotosAlbumOptions extends BaseOptions { + /** + * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径 + */ + filePath: string; + success(res: { errMsg: string }): void; + } + /** + * 保存图片到系统相册。 + * 需要用户授权 scope.writePhotosAlbum + * @version 1.2.0 + */ + function saveImageToPhotosAlbum(options: SaveImageToPhotosAlbumOptions): void; + // 媒体-----录音 + interface StartRecordAudioOptions extends BaseOptions { + /** 录音成功后调用,返回录音文件的临时文件路径,res = {tempFilePath: '录音文件的临时路径'} */ + success?(res: TempFileResponse): void; + } + /** + * 开始录音。当主动调用swan.stopRecord, + * 或者录音超过1分钟时自动结束录音,返回录音文件的临时文件路径。 + * 注:文件的临时路径,在小程序本次启动期间可以正常使用, + * 如需持久保存,需在主动调用swan.saveFile,在小程序下次启动时才能访问得到。 + * @deprecated 1.6.0 + */ + function startRecord(options: StartRecordAudioOptions): void; + + interface StopRecordAudioOptions extends BaseOptions { + success?(res: TempFileResponse): void; + } + /** + * 主动调用停止录音。 + */ + function stopRecord(options?: StopRecordAudioOptions): void; + type EncodeBitRate = + | 8000 + | 11025 + | 12000 + | 16000 + | 22050 + | 24000 + | 32000 + | 44100 + | 48000; + interface RecorderManagerStartOptions { + /** + * 指定录音的时长,单位 ms + * 如果传入了合法的 duration + * 在到达指定的 duration 后会自动停止录音,最大值 600000(10 分钟),默认值 60000(1 分钟) + */ + duration?: number; + /** + * 采样率,有效值 8000/16000/44100 + */ + sampleRate?: number; + /** + * 否 录音通道数,有效值 1/2 + */ + numberOfChannels?: number; + /** + * 编码码率 + * 采样率和码率有一定要求,具体有效值如下: + * 采样率 编码码率 + * + 8000 16000 ~ 48000 + * + 11025 16000 ~ 48000 + * + 12000 24000 ~ 64000 + * + 16000 24000 ~ 96000 + * + 22050 32000 ~ 128000 + * + 24000 32000 ~ 128000 + * + 32000 48000 ~ 192000 + * + 44100 64000 ~ 320000 + * + 48000 64000 ~ 320000 + */ + encodeBitRate: number; + /** 音频格式,有效值 aac/mp3 */ + format: string; + } + interface OnRecorderManagerStopOptions { + tempFilePath: string; + } + interface OnFrameRecordedOptions { + /** 录音分片结果数据 */ + frameBuffer: ArrayBuffer; + /** 当前帧是否正常录音结束前的最后一帧 */ + isLastFrame: boolean; + } + interface RecorderManager { + /** 开始录音 */ + start(options?: RecorderManagerStartOptions): void; + /** 暂停录音 */ + pause(): void; + /** 继续录音 */ + resume(): void; + /** 停止录音 */ + stop(): void; + /** 录音开始事件 */ + onStart(callback?: () => void): void; + /** 录音暂停事件 */ + onPause(callback?: () => void): void; + /** 录音恢复事件 */ + onResume(callback?: () => void): void; + /** 录音停止事件,会回调文件地址 */ + onStop(callback?: (options: OnRecorderManagerStopOptions) => void): void; + /** 已录制完指定帧大小的文件,会回调录音分片结果数据。如果设置了 frameSize ,则会回调此事件 */ + onFrameRecorded(callback?: (options: OnFrameRecordedOptions) => void): void; + /** 录音错误事件, 会回调错误信息 */ + onError(callback?: (err: ErrMsgResponse) => void): void; + } + /** + * 获取全局唯一的录音管理器 recorderManager + * @version 1.6.0 + */ + function getRecorderManager(): RecorderManager; + // 媒体-----音频播放控制 + interface PlayVoiceOptions extends BaseOptions { + /** 需要播放的语音文件的文件路径 */ + filePath: string; + } + /** + * 开始播放语音,同时只允许一个语音文件正在播放, + * 如果前一个语音文件还没播放完,将中断前一个语音播放。 + * @deprecated 1.6.0 + */ + function playVoice(options: PlayVoiceOptions): void; + /** + * 暂停正在播放的语音。 + * 再次调用swan.playVoice播放同一个文件时,会从暂停处开始播放。 + * 如果想从头开始播放,需要先调用 swan.stopVoice。 + * @deprecated 1.6.0 + */ + function pauseVoice(): void; + /** + * 结束播放语音。 + * @deprecated 1.6.0 + */ + function stopVoice(): void; + // 媒体-----音乐播放控制 + interface BackgroundAudioPlayerState { + /** 选定音频的长度(单位:s),只有在当前有音乐播放时返回 */ + duration: number; + /** 选定音频的播放位置(单位:s),只有在当前有音乐播放时返回 */ + currentPosition: number; + /** 播放状态(2:没有音乐在播放,1:播放中,0:暂停中) */ + status: number; + /** 音频的下载进度(整数,80 代表 80%),只有在当前有音乐播放时返回 */ + downloadPercent: number; + /** 歌曲数据链接,只有在当前有音乐播放时返回 */ + dataUrl: string; + } + interface GetBackgroundAudioPlayerStateOptions extends BaseOptions { + /** 接口调用成功的回调函数 */ + success?(state: BackgroundAudioPlayerState): void; + /** 接口调用失败的回调函数 */ + fail?(): void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?(): void; + } + /** + * 获取音乐播放状态。 + * @deprecated 1.2.0 + */ + function getBackgroundAudioPlayerState( + options: GetBackgroundAudioPlayerStateOptions + ): void; + interface PlayBackgroundAudioOptions extends BaseOptions { + /** 音乐链接 */ + dataUrl: string; + /** 音乐标题 */ + title?: string; + /** 封面URL */ + coverImgUrl?: string; + } + /** + * 播放音乐,同时只能有一首音乐正在播放。 + * @deprecated 1.2.0 + */ + function playBackgroundAudio(options: PlayBackgroundAudioOptions): void; + /** + * 暂停播放音乐。 + * @deprecated 1.2.0 + */ + function pauseBackgroundAudio(options?: PlayBackgroundAudioOptions): void; + interface SeekBackgroundAudioOptions extends BaseOptions { + /** 音乐位置,单位:秒 */ + position: number; + } + /** + * 控制音乐播放进度。 + * @deprecated 1.2.0 + */ + function seekBackgroundAudio(options: SeekBackgroundAudioOptions): void; + /** + * 停止播放音乐。 + * @deprecated 1.2.0 + */ + function stopBackgroundAudio(options?: PlayBackgroundAudioOptions): void; + /** + * 监听音乐播放。 + * @deprecated 1.2.0 + */ + function onBackgroundAudioPlay(callback: () => void): void; + /** + * 监听音乐暂停。 + * @deprecated 1.2.0 + */ + function onBackgroundAudioPause(callback: () => void): void; + /** + * 监听音乐停止。 + * @deprecated 1.2.0 + */ + function onBackgroundAudioStop(callback: () => void): void; + interface BackgroundAudioManager { + /** 当前音频的长度(单位:s),只有在当前有合法的 src 时返回 */ + readonly duration: number; + /** 当前音频的播放位置(单位:s),只有在当前有合法的 src 时返回 */ + readonly currentTime: number; + /** 当前是是否暂停或停止状态,true 表示暂停或停止,false 表示正在播放 */ + readonly paused: boolean; + /** 音频的数据源,默认为空字符串,当设置了新的 src 时,会自动开始播放 ,目前支持的格式有 m4a, aac, mp3, wav */ + src?: string; + /** 音频开始播放的位置(单位:s) */ + startTime?: number; + /** 音频缓冲的时间点,仅保证当前播放时间点到此时间点内容已缓冲。 是 */ + buffered: number; + /** 音频标题,用于做原生音频播放器音频标题。原生音频播放器中的分享功能,分享出去的卡片标题,也将使用该值。 */ + title?: string; + /** 专辑名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */ + epname?: string; + /** 歌手名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值 */ + singer?: string; + /** 封面图url,用于做原生音频播放器背景图。原生音频播放器中的分享功能,分享出去的卡片配图及背景也将使用该图。 */ + coverImgUrl?: string; + /** 播放 */ + play(): void; + /** 暂停 */ + pause(): void; + /** 停止 */ + stop(): void; + /** 跳转到指定位置,单位 s */ + seek(position: number): void; + /** 背景音频进入可以播放状态,但不保证后面可以流畅播放 */ + onCanplay(callback: (res: ErrCodeResponse) => void): void; + /** 背景音频播放事件 */ + onPlay(callback: (res: ErrCodeResponse) => void): void; + /** 背景音频暂停事件 */ + onPause(callback: (res: ErrCodeResponse) => void): void; + /** 背景音频停止事件 */ + onStop(callback: (res: ErrCodeResponse) => void): void; + /** 背景音频自然播放结束事件 */ + onEnded(callback: (res: ErrCodeResponse) => void): void; + /** 背景音频播放进度更新事件 */ + onTimeUpdate(callback: (res: ErrCodeResponse) => void): void; + /** 背景音频播放错误事件 */ + onError(callback: (res: ErrCodeResponse) => void): void; + /** 音频加载中事件,当音频因为数据不足,需要停下来加载时会触发 */ + onWaiting(callback: (res: ErrCodeResponse) => void): void; + } + /** + * 获取全局唯一的背景音频管理器 backgroundAudioManager。 + * @version 1.2.0 + */ + function getBackgroundAudioManager(): BackgroundAudioManager; + // 媒体-----音频组件控制 + /** + * audioContext 通过 audioId 跟一个

' @@ -275,7 +311,7 @@ export interface TooltipOption { /** * Default title value if title attribute isn't present. - * If a function is given, it will be called with its this reference set to the element + * If a function is given, it will be called with its `this` reference set to the element * that the tooltip or popover is attached to. * * @default "" @@ -322,12 +358,22 @@ export interface TooltipOption { // Events // -------------------------------------------------------------------------------------- -export interface CarouselEventHandler extends JQuery.Event { +export interface CarouselEventHandler extends JQuery.TriggeredEvent { + /** + * The carousel dom element. + */ + target: HTMLElement; // overridden only for better JsDoc + /** * The direction in which the carousel is sliding. */ direction: "left" | "right"; + /** + * The DOM element that is being slid into place as the active item. + */ + relatedTarget: HTMLElement; + /** * The index of the current item. */ @@ -339,6 +385,47 @@ export interface CarouselEventHandler extends JQuery.Event extends JQuery.TriggeredEvent { + /** + * The the dropdown's toggle and the dropdown menu container (the `.dropdown` element). + */ + target: HTMLElement; // overridden only for better JsDoc + + /** + * The toggling anchor element. + */ + relatedTarget: HTMLElement; +} + +export interface ModalEventHandler extends JQuery.TriggeredEvent { + /** + * The modal dom element. + */ + target: HTMLElement; // overridden only for better JsDoc + + /** + * For `show.bs.modal` and `shown.bs.modal` is the clicked element, when caused by a _click_. + * Otherwise is undefined. + */ + relatedTarget: HTMLElement | undefined; +} + +export interface TapEventHandler extends JQuery.TriggeredEvent { + /** + * * For `show.bs.tab` and `shown.bs.tab`, is the newly activated tab. + * * For `hide.bs.tab`, is the current active tab. + * * For `hidden.bs.tab`, is the previous active tab. + */ + target: HTMLElement; // overridden only for better JsDoc + + /** + * * For `show.bs.tab` and `shown.bs.tab`, is the previous active tab. + * * For `hide.bs.tab`, is the new soon-to-be-active tab. + * * For `hidden.bs.tab`, is the new active tab. + */ + relatedTarget: HTMLElement; +} + export type AlertEvent = "close.bs.alert" | "closed.bs.alert"; export type CarouselEvent = "slide.bs.carousel" | "slid.bs.carousel"; export type CollapseEvent = "show.bs.collapse" | "shown.bs.collapse" | "hide.bs.collapse" | "hidden.bs.collapse"; @@ -347,6 +434,7 @@ export type ModalEvent = "show.bs.modal" | "shown.bs.modal" | "hide.bs.modal" | export type PopoverEvent = "show.bs.popover" | "shown.bs.popover" | "hide.bs.popover" | "hidden.bs.popover" | "inserted.bs.popover"; export type ScrollspyEvent = "activate.bs.scrollspy"; export type TapEvent = "show.bs.tab" | "shown.bs.tab" | "hide.bs.tab" | "hidden.bs.tab"; +export type ToastEvent = "show.bs.toast" | "shown.bs.toast" | "hide.bs.toast" | "hidden.bs.toast"; export type TooltipEvent = "show.bs.tooltip" | "shown.bs.tooltip" | "hide.bs.tooltip" | "hidden.bs.tooltip" | "inserted.bs.tooltip"; // -------------------------------------------------------------------------------------- @@ -355,37 +443,177 @@ export type TooltipEvent = "show.bs.tooltip" | "shown.bs.tooltip" | "hide.bs.too declare global { interface JQuery { + /** + * If no _method_ is specified, makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. + * (Not necessary when using the data-api's auto-initialization.) + * Otherwise, call the method on the alert element: + * * `close` – Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. + * * `dispose` – Destroys an element's alert. + */ alert(action?: "close" | "dispose"): this; + /** + * Call a method on the button element: + * * `toggle` – Toggles push state. Gives the button the appearance that it has been activated. + * * `dispose` – Destroys an element's button. + */ button(action: "toggle" | "dispose"): this; + /** + * Call a method on the carousel element: + * * `cycle` – Cycles through the carousel items from left to right. + * * `pause` – Stops the carousel from cycling through items. + * * _number_ – Cycles the carousel to a particular frame (0 based, similar to an array). + * * `prev` – Cycles to the previous item. + * * `next` – Cycles to the next item. + * * `dispose` – Destroys an element's carousel. + * + * Returns to the caller before the target item has been shown (i.e. before the `slid.bs.carousel` event occurs). + */ carousel(action: "cycle" | "pause" | number | "prev" | "next" | "dispose"): this; + /** + * Initializes the carousel and starts cycling through items. + */ carousel(options?: CarouselOption): this; + /** + * Call a method on the collapsible element: + * * `toggle` – Toggles a collapsible element to shown or hidden. + * * `show` – Shows a collapsible element. + * * `hide` – Hides a collapsible element. + * * `dispose` – Destroys an element's collapse. + * + * Returns to the caller before the collapsible element has actually been shown or hidden (i.e. before the `shown.bs.collapse` or `hidden.bs.collapse` event occurs). + */ collapse(action: "toggle" | "show" | "hide" | "dispose"): this; + /** + * Activates a content as a collapsible element. + */ collapse(options?: CollapseOption): this; + /** + * Call a method on the dropdown element: + * * `toggle` – Toggles the dropdown menu of a given navbar or tabbed navigation. + * * `update` – Updates the position of an element's dropdown. + * * `dispose` – Destroys an element's dropdown. + */ dropdown(action: "toggle" | "update" | "dispose"): this; + /** + * Toggle contextual overlays for displaying lists of links. + * + * The data-api, `data-toggle="dropdown"` is always required to be present on the dropdown's trigger element. + */ dropdown(options?: DropdownOption): this; + /** + * Call a method on the modal element: + * * `toggle` – Manually toggles a modal. + * * `show` – Manually opens a modal. + * * `hide` – Manually hides a modal. + * * `handleUpdate` – Manually readjust the modal's position if the height of a modal changes while it is open (i.e. in case a scrollbar appears). + * * `dispose` – Destroys an element's modal. + * + * Returns to the caller before the modal has actually been shown or hidden (i.e. before the `shown.bs.modal` or `hidden.bs.modal` event occurs). + */ modal(action: "toggle" | "show" | "hide" | "handleUpdate" | "dispose"): this; + /** + * Activates a content as a modal. + */ modal(options?: ModalOption): this; + /** + * Call a method on the popover element: + * * `show` – Reveals an element's popover. Popovers whose both title and content are zero-length are never displayed. + * * `hide` – Hides an element's popover. + * * `toggle` – Toggles an element's popover. + * * `dispose` – Hides and destroys an element's popover. + * Popovers that use delegation (which are created using the `selector` option) cannot be individually destroyed on descendant trigger elements. + * * `enable` – Gives an element's popover the ability to be shown. Popovers are enabled by default. + * * `disable` – Removes the ability for an element's popover to be shown. The popover will only be able to be shown if it is re-enabled. + * * `toggleEnabled` – Toggles the ability for an element's popover to be shown or hidden. + * * `update` – Updates the position of an element's popover. + * + * Returns to the caller before the popover has actually been shown or hidden (i.e. before the `shown.bs.popover` or `hidden.bs.popover` event occurs). + * This is considered a "manual" triggering of the popover. + */ popover(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; + /** + * Initializes popovers for an element collection. + */ popover(options?: PopoverOption): this; +// tslint:disable:jsdoc-format + /** + * Call a method on the scrollspy element: + * * `refresh` – When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh, see example. + * * `dispose` – Destroys an element's scrollspy. + * + * @example +```javascript +$('[data-spy="scroll"]').each(function () { + var $spy = $(this).scrollspy('refresh') +}) +``` + */ +// tslint:enable:jsdoc-format scrollspy(action: "refresh" | "dispose"): this; + /** + * Add scrollspy behavior to a topbar navigation. + */ scrollspy(options?: ScrollspyOption): this; + /** + * Call a method on the list item or tab element: + * * `show` – Selects the given list item or tab and shows its associated pane. + * Any other list item or tab that was previously selected becomes unselected and its associated pane is hidden. + * * `dispose` – Destroys an element's tab. + * + * Returns to the caller before the tab pane has actually been shown (i.e. before the `shown.bs.tab` event occurs). + */ tab(action: "show" | "dispose"): this; + /** + * Call a method on the toast element: + * * `show` – Reveals an element's toast. You have to manually call this method, instead your toast won't show. + * * `hide` – Hides an element's toast. You have to manually call this method if you made `autohide` to false. + * * `dispose` – Hides an element's toast. Your toast will remain on the DOM but won't show anymore. + * + * Returns to the caller before the toast has actually been shown or hidden (i.e. before the `shown.bs.toast` or `hidden.bs.toast` event occurs). + */ + toast(action: "show" | "hide" | "dispose"): this; + /** + * Attaches a toast handler to an element collection. + */ + toast(options?: ToastOption): this; + + /** + * Call a method on the tooltip element: + * * `show` – Reveals an element's tooltip. Tooltips with zero-length titles are never displayed. + * * `hide` – Hides an element's tooltip. + * * `toggle` – Toggles an element's tooltip. + * * `dispose` – Hides and destroys an element's tooltip. + * Tooltips that use delegation (which are created using `selector` option) cannot be individually destroyed on descendant trigger elements. + * * `enable` – Gives an element's tooltip the ability to be shown. Tooltips are enabled by default. + * * `disable` – Removes the ability for an element's tooltip to be shown. The tooltip will only be able to be shown if it is re-enabled. + * * `toggleEnabled` – Toggles the ability for an element's tooltip to be shown or hidden. + * * `update` – Updates the position of an element's tooltip. + * + * Returns to the caller before the tooltip has actually been shown or hidden (i.e. before the `shown.bs.tooltip` or `hidden.bs.tooltip` event occurs). + * This is considered a "manual" triggering of the tooltip. + */ tooltip(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; + /** + * Attaches a tooltip handler to an element collection. + */ tooltip(options?: TooltipOption): this; on(events: CarouselEvent, handler: JQuery.EventHandlerBase>): this; - on(events: - AlertEvent | CollapseEvent | DropdownEvent | ModalEvent | - PopoverEvent | ScrollspyEvent | TapEvent | TooltipEvent, - handler: JQuery.EventHandler): this; + on(events: DropdownEvent, handler: JQuery.EventHandlerBase>): this; + on(events: ModalEvent, handler: JQuery.EventHandlerBase>): this; + on(events: TapEvent, handler: JQuery.EventHandlerBase>): this; + on( + events: AlertEvent | CollapseEvent | PopoverEvent | ScrollspyEvent | ToastEvent | TooltipEvent, + handler: JQuery.EventHandler + ): this; } } diff --git a/types/bootstrap/v3/bootstrap-tests.ts b/types/bootstrap/v3/bootstrap-tests.ts index 00a8fa44fd..e834903867 100644 --- a/types/bootstrap/v3/bootstrap-tests.ts +++ b/types/bootstrap/v3/bootstrap-tests.ts @@ -1,9 +1,21 @@ +declare let aHtmlElement: HTMLElement; + +// -------------------------------------------------------------------------------------- +// jQuery backward compatibility +// -------------------------------------------------------------------------------------- + +$(".dropdown").on("affixed.bs.affix", (e) => { + e.stopPropagation(); +}); + // -------------------------------------------------------------------------------------- // Modal // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $(".modal").modal(); +// $ExpectType JQuery $(".modal").modal("show"); $(".modal").modal("toggle"); @@ -25,16 +37,24 @@ $(".modal").modal({ // Dropdown // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $(".dropdown").dropdown(); +// $ExpectType JQuery $(".dropdown").dropdown("toggle"); +$(".dropdown").on("show.bs.dropdown", (e) => { + aHtmlElement = e.relatedTarget; +}); + // -------------------------------------------------------------------------------------- // Scrollspy // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $(".navbar").scrollspy(); +// $ExpectType JQuery $(".navbar").scrollspy("refresh"); $(".navbar").scrollspy({ @@ -42,15 +62,36 @@ $(".navbar").scrollspy({ offset: 10, }); +$(".navbar").on("activate.bs.scrollspy", () => { + // do something... +}); + +// -------------------------------------------------------------------------------------- +// Togglable tabs +// -------------------------------------------------------------------------------------- + +// $ExpectType JQuery +$(".tab").tab(); + +// $ExpectType JQuery +$(".tab").tab("show"); + +$(".tab").on("shown.bs.tab", (e) => { + aHtmlElement = e.target; // newly activated tab + aHtmlElement = e.relatedTarget; // previous active tab +}); + // -------------------------------------------------------------------------------------- // Tooltip // -------------------------------------------------------------------------------------- -$("#element").tooltip(); +// $ExpectType JQuery +$(".tooltip").tooltip(); -$("#element").tooltip("show"); +// $ExpectType JQuery +$(".tooltip").tooltip("show"); -$("#element").tooltip({ +$(".tooltip").tooltip({ animation: true, container: false, delay: 0, @@ -63,26 +104,26 @@ $("#element").tooltip({ viewport: { selector: "body", padding: 0 }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ container: "body", }); -$("#element").tooltip({ +$(".tooltip").tooltip({ delay: { show: 500, hide: 100 }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ placement() { return "top"; }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ placement(tooltip: HTMLElement, trigger: Element) { console.log(this.options.delay); return "top"; }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ placement(tooltip: HTMLElement, trigger: Element) { // $ExpectError console.log(this.options.content); // only for PopoverOption, not TooltipOption @@ -90,23 +131,29 @@ $("#element").tooltip({ }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ title() { return this.id; }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ viewport: "body", }); +$(".tooltip").on("hidden.bs.tooltip", () => { + // do something... +}); + // -------------------------------------------------------------------------------------- // Popover // -------------------------------------------------------------------------------------- -$("#element").popover(); +// $ExpectType JQuery +$(".popover").popover(); -$("#element").popover("show"); +// $ExpectType JQuery +$(".popover").popover("show"); -$("#element").popover({ +$(".popover").popover({ animation: true, container: false, content: "content", @@ -120,51 +167,60 @@ $("#element").popover({ viewport: { selector: "body", padding: 0 }, }); -$("#element").popover({ +$(".popover").popover({ container: "body", }); -$("#element").popover({ +$(".popover").popover({ content() { return `Elem id: ${this.id}`; }, }); -$("#element").popover({ +$(".popover").popover({ delay: { show: 500, hide: 100 }, }); -$("#element").popover({ +$(".popover").popover({ placement() { return "top"; }, }); -$("#element").popover({ +$(".popover").popover({ placement(tooltip: HTMLElement, trigger: Element) { console.log(this.options.content); return "top"; }, }); -$("#element").popover({ +$(".popover").popover({ title() { return `Elem id: ${this.id}`; }, }); -$("#element").popover({ +$(".popover").popover({ viewport: "body", }); +$(".popover").on("hidden.bs.popover", () => { + // do something... +}); + // -------------------------------------------------------------------------------------- // Alert // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $(".alert").alert(); +// $ExpectType JQuery $(".alert").alert("close"); +$(".alert").on("closed.bs.alert", () => { + // do something... +}); + // -------------------------------------------------------------------------------------- // Button // -------------------------------------------------------------------------------------- -$(".btn").button(); - +// $ExpectType JQuery $(".btn").button("toggle"); $(".btn").button("reset"); @@ -175,8 +231,10 @@ $(".btn").button("Swaps text to any data defined text state."); // Collapse // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $(".collapse").collapse(); +// $ExpectType JQuery $(".collapse").collapse("toggle"); $(".collapse").collapse({ @@ -184,12 +242,18 @@ $(".collapse").collapse({ toggle: false, }); +$(".collapse").on("hidden.bs.collapse", () => { + // do something... +}); + // -------------------------------------------------------------------------------------- // Carousel // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $(".carousel").carousel(); +// $ExpectType JQuery $(".carousel").carousel("cycle"); $(".carousel").carousel(200); @@ -209,12 +273,19 @@ $(".carousel").carousel({ pause: null, }); +$("#myCarousel").on("slide.bs.carousel", (e) => { + const dir: "left" | "right" = e.direction; + aHtmlElement = e.relatedTarget; +}); + // -------------------------------------------------------------------------------------- // Affix // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $(".affix").affix(); +// $ExpectType JQuery $(".affix").affix("checkPosition"); $(".affix").affix({ diff --git a/types/bootstrap/v3/index.d.ts b/types/bootstrap/v3/index.d.ts index a6ddbeb1f8..d3b80a0529 100644 --- a/types/bootstrap/v3/index.d.ts +++ b/types/bootstrap/v3/index.d.ts @@ -7,6 +7,16 @@ /// +// -------------------------------------------------------------------------- +// For jQuery v1 and v2 backward compatibility +// -------------------------------------------------------------------------- + +/** + * Same as jQuery v3 `JQuery.EventHandlerBase`. + */ +type JQueryEventHandlerBase = + (this: TContext, t: T, ...args: any[]) => void | false; + // -------------------------------------------------------------------------- // Some Types and Interfaces // -------------------------------------------------------------------------- @@ -43,86 +53,431 @@ interface TooltipInstance { // -------------------------------------------------------------------------------------- interface ModalOptions { + /** + * Includes a modal-backdrop element. + * Alternatively, specify `static` for a backdrop which doesn't close the modal on click. + * + * @default true + */ backdrop?: boolean | "static"; + + /** + * Closes the modal when escape key is pressed. + * + * @default true + */ keyboard?: boolean; + + /** + * Shows the modal when initialized. + * + * @default true + */ show?: boolean; + + /** + * If a remote URL is provided, **content will be loaded one time** via jQuery's `load` method and injected into the `.modal-content` div. + * + * @default false + * @deprecated Use client-side templating or a data binding framework instead, or call `jQuery.load` yourself. + */ remote?: string; } interface ScrollSpyOptions { + /** + * Pixels to offset from top when calculating position of scroll. + * + * @default 10 + */ offset?: number; + + /** + * The ID or class of the parent element of any Bootstrap `.nav` component. + * + * @default "" + */ target?: string; } interface TooltipOptions { + /** + * Apply a CSS fade transition to the tooltip or popover. + * + * @default true + */ animation?: boolean; + + /** + * Appends the tooltip or popover to a specific element. Example: `container: 'body'`. + * This option is particularly useful in that it allows you to position the tooltip or popover + * in the flow of the document near the triggering element - which will prevent + * it from floating away from the triggering element during a window resize. + * + * @default false + */ container?: string | false; + + /** + * Delay showing and hiding the tooltip or popover (ms) - does not apply to manual trigger type. + * If a number is supplied, delay is applied to both hide/show. + * Object structure is: `delay: { "show": 500, "hide": 100 }`. + * + * @default 0 + */ delay?: number | BootstrapDelay; + + /** + * Insert HTML into the tooltip or popover. If false, jQuery's text method will be used to insert content into the DOM. + * Use text if you're worried about XSS attacks. + * + * @default false + */ html?: boolean; + + /** + * How to position the tooltip or popover - top | bottom | left | right | auto. + * When "auto" is specified, it will dynamically reorient the tooltip or popover. + * For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right. + * + * When a function is used to determine the placement, it is called with + * the tooltip or popover DOM node as its first argument and the triggering element DOM node as its second. + * The `this` context is set to the tooltip or popover instance. + * + * @default tooltip: "top", popover: "right" + */ placement?: BootstrapPlacement | ((this: TooltipInstance, tooltip: HTMLElement, trigger: Element) => BootstrapPlacement); + + /** + * If a selector is provided, tooltip or popover objects will be delegated to the specified targets. + * In practice, this is used to enable dynamic HTML content to have popovers added. + * + * @default false + */ selector?: string; + + /** + * Base HTML to use when creating the tooltip or popover. + * The tooltip's (resp., popover's) title will be injected into the `.tooltip-inner` (resp., `.popover-title`). + * The popover's content will be injected into the `.popover-content`. + * The `.tooltip-arrow` (resp., `.arrow`) will become the tooltip's (resp., popover's) arrow. + * The outermost wrapper element should have the `.tooltip` (resp., `.popover`) class. + * + * @default '' + * @default '' + */ template?: string; + + /** + * Default title value if title attribute isn't present. + * If a function is given, it will be called with its `this` reference set to the element + * that the tooltip or popover is attached to. + * + * @default "" + */ title?: string | ((this: Element) => string); + + /** + * How tooltip or popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. + * "manual" cannot be combined with any other trigger. + * + * @default tooltip: "hover focus", popover: "click" + */ trigger?: BootstrapTrigger; + + /** + * Keeps the tooltip within the bounds of this element. Example: viewport: `#viewport` or `{"selector": "#viewport", "padding": 0}`. + * If a function is given in the object, it is called with the triggering element DOM node as its only argument. + * The `this` context is set to the tooltip instance. + * + * @default {selector: 'body', padding: 0} + */ viewport?: string | BootstrapViewport; } interface PopoverOptions extends TooltipOptions { + /** + * Default content value if `data-content` attribute isn't present. + * If a function is given, it will be called with its `this` reference + * set to the element that the popover is attached to. + * + * @default "" + */ content?: string | ((this: Element) => string); } interface CollapseOptions { + /** + * If a selector is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. + * + * @default false + */ parent?: string | false; + + /** + * Toggles the collapsible element on invocation. + * + * @default true + */ toggle?: boolean; } interface CarouselOptions { + /** + * The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle. + * + * @default 5000 + */ interval?: number | false; + + /** + * If set to "hover", pauses the cycling of the carousel on `mouseenter` and resumes the cycling of the carousel on `mouseleave`. + * If set to null, hovering over the carousel won't pause it. + * + * @default "hover" + */ pause?: "hover" | null; + + /** + * Whether the carousel should cycle continuously or have hard stops. + * + * @default true + */ wrap?: boolean; + + /** + * Whether the carousel should react to keyboard events. + * + * @default true + */ keyboard?: boolean; } interface AffixOptions { + /** + * Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and bottom directions. + * To provide a unique, bottom and top offset just provide an object offset: `{top: 7, bottom: 5}`. + * Use a function in the object when you need to dynamically calculate an offset. + * + * @default 10 + */ offset?: number | BootstrapOffset; + + /** + * Specifies the target element of the affix. + * + * @default window + */ target?: string | Node | JQuery | Window; } +// -------------------------------------------------------------------------------------- +// Events +// -------------------------------------------------------------------------------------- + +interface CarouselEventHandler extends JQueryEventObject { + /** + * The direction in which the carousel is sliding. + */ + direction: "left" | "right"; + + /** + * The DOM element that is being slid into place as the active item. + */ + relatedTarget: HTMLElement; +} + +interface DropdownsEventHandler extends JQueryEventObject { + /** + * The toggling anchor element. + */ + relatedTarget: HTMLElement; +} + +interface TapEventHandler extends JQueryEventObject { + /** + * * For `show.bs.tab` and `shown.bs.tab`, is the new active tab. + * * For `hide.bs.tab`, is the current active tab. + * * For `hidden.bs.tab`, is the previous active tab. + */ + target: HTMLElement; // overridden only for better JsDoc + + /** + * * For `show.bs.tab` and `shown.bs.tab`, is the previous active tab, if available. + * * For `hide.bs.tab`, is the new soon-to-be-active tab. + * * For `hidden.bs.tab`, is the new active tab. + */ + relatedTarget: HTMLElement; +} + +type AffixEvent = "affix.bs.affix" | "affixed.bs.affix" | "affix-top.bs.affix" | "affixed-top.bs.affix" | "affix-bottom.bs.affix" | "affixed-bottom.bs.affix"; +type AlertEvent = "close.bs.alert" | "closed.bs.alert"; +type CarouselEvent = "slide.bs.carousel" | "slid.bs.carousel"; +type CollapseEvent = "show.bs.collapse" | "shown.bs.collapse" | "hide.bs.collapse" | "hidden.bs.collapse"; +type DropdownEvent = "show.bs.dropdown" | "shown.bs.dropdown" | "hide.bs.dropdown" | "hidden.bs.dropdown"; +type PopoverEvent = "show.bs.popover" | "shown.bs.popover" | "hide.bs.popover" | "hidden.bs.popover" | "inserted.bs.popover"; +type ScrollspyEvent = "activate.bs.scrollspy"; +type TapEvent = "show.bs.tab" | "shown.bs.tab" | "hide.bs.tab" | "hidden.bs.tab"; +type TooltipEvent = "show.bs.tooltip" | "shown.bs.tooltip" | "hide.bs.tooltip" | "hidden.bs.tooltip" | "inserted.bs.tooltip"; + // -------------------------------------------------------------------------------------- // jQuery // -------------------------------------------------------------------------------------- -interface JQuery { - modal(action?: "toggle" | "show" | "hide" | "handleUpdate"): JQuery; - modal(options: ModalOptions): JQuery; +interface JQuery { + /** + * Call a method on the modal element: + * * `toggle` – Manually toggles a modal. + * * `show` – Manually opens a modal. + * * `hide` – Manually hides a modal. + * * `handleUpdate` – Readjusts the modal's positioning to counter a scrollbar in case one should appear, which would make the modal jump to the left. + * Only needed when the height of the modal changes while it is open. + * + * Returns to the caller before the modal has actually been shown or hidden (i.e. before the `shown.bs.modal` or `hidden.bs.modal` event occurs). + */ + modal(action: "toggle" | "show" | "hide" | "handleUpdate"): this; + /** + * Activates a content as a modal. + */ + modal(options?: ModalOptions): this; - dropdown(action?: "toggle"): JQuery; + /** + * If no _method_ is specified, toggle contextual overlays for displaying lists of links. + * The data-api, `data-toggle="dropdown"` is always required to be present on the dropdown's trigger element. + * + * When _method_ `toggle` is specified, toggles the dropdown menu of a given navbar or tabbed navigation. + */ + dropdown(action?: "toggle"): this; - scrollspy(action?: "refresh"): JQuery; - scrollspy(options: ScrollSpyOptions): JQuery; +// tslint:disable:jsdoc-format + /** + * When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh, see example. + * @example +```javascript +$('[data-spy="scroll"]').each(function () { + var $spy = $(this).scrollspy('refresh') +}) +``` + */ +// tslint:enable:jsdoc-format + scrollspy(action: "refresh"): this; + /** + * Add scrollspy behavior to a topbar navigation. + */ + scrollspy(options?: ScrollSpyOptions): this; - tab(action?: "show"): JQuery; + /** + * If no _method_ is specified, activates a tab element and content container. Tab should have either a `data-target` or an `href` targeting a container node in the DOM. + * + * When _method_ `show` is specified, selects the given tab and shows its associated content. + * Any other tab that was previously selected becomes unselected and its associated content is hidden. + * + * Returns to the caller before the tab pane has actually been shown (i.e. before the `shown.bs.tab` event occurs). + */ + tab(action?: "show"): this; - tooltip(action?: "show" | "hide" | "toggle" | "destroy"): JQuery; - tooltip(options: TooltipOptions): JQuery; + /** + * Call a method on the tooltip element: + * * `show` – Reveals an element's tooltip. Tooltips with zero-length titles are never displayed. + * * `hide` – Hides an element's tooltip. + * * `toggle` – Toggles an element's tooltip. + * * `destroy` – Hides and destroys an element's tooltip. + * Tooltips that use delegation (which are created using `selector` option) cannot be individually destroyed on descendant trigger elements. + * + * Returns to the caller before the tooltip has actually been shown or hidden (i.e. before the `shown.bs.tooltip` or `hidden.bs.tooltip` event occurs). + * This is considered a "manual" triggering of the tooltip. + */ + tooltip(action: "show" | "hide" | "toggle" | "destroy"): this; + /** + * Attaches a tooltip handler to an element collection. + */ + tooltip(options?: TooltipOptions): this; - popover(action?: "show" | "hide" | "toggle" | "destroy"): JQuery; - popover(options: PopoverOptions): JQuery; + /** + * Call a method on the popover element: + * * `show` – Reveals an element's popover. Popovers whose both title and content are zero-length are never displayed. + * * `hide` – Hides an element's popover. + * * `toggle` – Toggles an element's popover. + * * `destroy` – Hides and destroys an element's popover. + * Popovers that use delegation (which are created using the `selector` option) cannot be individually destroyed on descendant trigger elements. + * + * Returns to the caller before the popover has actually been shown or hidden (i.e. before the `shown.bs.popover` or `hidden.bs.popover` event occurs). + * This is considered a "manual" triggering of the popover. + */ + popover(action: "show" | "hide" | "toggle" | "destroy"): this; + /** + * Initializes popovers for an element collection. + */ + popover(options?: PopoverOptions): this; - alert(action?: "close"): JQuery; + /** + * If no _method_ is specified, makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. + * (Not necessary when using the data-api's auto-initialization.) + * + * When _method_ `close` is specified, closes an alert by removing it from the DOM. If the `.fade` and `.in` classes are present on the element, + * the alert will fade out before it is removed. + */ + alert(action?: "close"): this; - button(action?: "toggle" | "reset" | string): JQuery; + /** + * Call a method on the button element: + * * `toggle` – Toggles push state. Gives the button the appearance that it has been activated. + * * `reset` – Resets button state: swaps text to original text. This method is asynchronous and returns before the resetting has actually completed. + * * _string_ – Swaps text to any data defined text state. + */ + button(action: "toggle" | "reset" | string): this; - collapse(action?: "toggle" | "show" | "hide"): JQuery; - collapse(options: CollapseOptions): JQuery; + /** + * Call a method on the collapsible element: + * * `toggle` – Toggles a collapsible element to shown or hidden. + * * `show` – Shows a collapsible element. + * * `hide` – Hides a collapsible element. + * + * Returns to the caller before the collapsible element has actually been shown or hidden (i.e. before the `shown.bs.collapse` or `hidden.bs.collapse` event occurs). + */ + collapse(action: "toggle" | "show" | "hide"): this; + /** + * Activates a content as a collapsible element. + */ + collapse(options?: CollapseOptions): this; - carousel(action?: "cycle" | "pause" | number | "prev" | "next"): JQuery; - carousel(options: CarouselOptions): JQuery; + /** + * Call a method on the carousel element: + * * `cycle` – Cycles through the carousel items from left to right. + * * `pause` – Stops the carousel from cycling through items. + * * _number_ – Cycles the carousel to a particular frame (0 based, similar to an array). + * * `prev` – Cycles to the previous item. + * * `next` – Cycles to the next item. + * + * Returns to the caller before the target item has been shown (i.e. before the `slid.bs.carousel` event occurs). + */ + carousel(action: "cycle" | "pause" | number | "prev" | "next"): this; + /** + * Initializes the carousel and starts cycling through items. + */ + carousel(options?: CarouselOptions): this; - affix(action?: "checkPosition"): JQuery; - affix(options: AffixOptions): JQuery; + /** + * Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. + * The `.affix`, `.affix-top`, and `.affix-bottom` classes are added to or removed from the affixed content according to the new state. + * This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content. + */ + affix(action: "checkPosition"): this; + /** + * Activates your content as affixed content. + */ + affix(options?: AffixOptions): this; - emulateTransitionEnd(duration: number): JQuery; + on(events: CarouselEvent, handler: JQueryEventHandlerBase): this; + on(events: DropdownEvent, handler: JQueryEventHandlerBase): this; + on(events: TapEvent, handler: JQueryEventHandlerBase): this; + on( + events: AffixEvent | AlertEvent | CollapseEvent | PopoverEvent | ScrollspyEvent | TooltipEvent, + handler: JQueryEventHandlerBase + ): this; + + /** @deprecated */ + emulateTransitionEnd(duration: number): this; } // -------------------------------------------------------------------------------------- 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/boxen/boxen-tests.ts b/types/boxen/boxen-tests.ts new file mode 100644 index 0000000000..303e5dd7fa --- /dev/null +++ b/types/boxen/boxen-tests.ts @@ -0,0 +1,37 @@ +import boxen = require('boxen'); + +boxen('unicorn'); // $ExpectType string +boxen('unicorn', { borderColor: 'black' }); // $ExpectType string +boxen('unicorn', { borderStyle: 'double' }); // $ExpectType string +boxen('unicorn', { borderStyle: 'foo' }); // $ExpectError +// $ExpectType string +boxen('unicorn', { + borderStyle: { + topLeft: '+', + topRight: '+', + bottomLeft: '+', + bottomRight: '+', + horizontal: '-', + vertical: '|', + }, +}); +boxen('unicorn', { dimBorder: true }); // $ExpectType string +boxen('unicorn', { padding: 1 }); // $ExpectType string +boxen('unicorn', { padding: { top: 1 } }); // $ExpectType string +boxen('unicorn', { padding: { right: 1 } }); // $ExpectType string +boxen('unicorn', { padding: { bottom: 1 } }); // $ExpectType string +boxen('unicorn', { padding: { left: 1 } }); // $ExpectType string +boxen('unicorn', { margin: 1 }); // $ExpectType string +boxen('unicorn', { margin: { top: 1 } }); // $ExpectType string +boxen('unicorn', { margin: { right: 1 } }); // $ExpectType string +boxen('unicorn', { margin: { bottom: 1 } }); // $ExpectType string +boxen('unicorn', { margin: { left: 1 } }); // $ExpectType string +boxen('unicorn', { float: 'right' }); // $ExpectType string +boxen('unicorn', { float: 'center' }); // $ExpectType string +boxen('unicorn', { float: 'left' }); // $ExpectType string +boxen('unicorn', { float: 'foo' }); // $ExpectError +boxen('unicorn', { backgroundColor: 'white' }); // $ExpectType string +boxen('unicorn', { align: 'left' }); // $ExpectType string +boxen('unicorn', { align: 'center' }); // $ExpectType string +boxen('unicorn', { align: 'right' }); // $ExpectType string +boxen('unicorn', { align: 'foo' }); // $ExpectError diff --git a/types/boxen/index.d.ts b/types/boxen/index.d.ts new file mode 100644 index 0000000000..94b68bb5c7 --- /dev/null +++ b/types/boxen/index.d.ts @@ -0,0 +1,114 @@ +// Type definitions for boxen 2.1 +// Project: https://github.com/sindresorhus/boxen#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { BoxDefinition, BoxNames } from 'cli-boxes'; + +export = boxen; + +/** + * Create boxes in the terminal + * @param input Text inside the box. + */ +declare function boxen(input: string, options?: boxen.Options): string; + +declare namespace boxen { + interface Options { + /** + * Color of the box border. + * Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `gray` or a hex value like `#ff0000` + */ + borderColor?: string; + + /** + * Style of the box border. + * Can be any of the above predefined styles or an object. + * + * Predefined values: + * - `single` + * ``` + * ┌───┐ + * │foo│ + * └───┘ + * ``` + * - `double` + * ``` + * ╔═══╗ + * ║foo║ + * ╚═══╝ + * ``` + * - `round` (`single` sides with round corners) + * ``` + * ╭───╮ + * │foo│ + * ╰───╯ + * ``` + * - `single-double` (`single` on top and bottom, `double` on right and left) + * ``` + * ╓───╖ + * ║foo║ + * ╙───╜ + * ``` + * - `double-single` (`double` on top and bottom, `single` on right and left) + * ``` + * ╒═══╕ + * │foo│ + * ╘═══╛ + * ``` + * - `classic` + * ``` + * +---+ + * |foo| + * +---+ + * ``` + */ + borderStyle?: BoxNames | BoxDefinition; + + /** + * Reduce opacity of the border. + * @default false + */ + dimBorder?: boolean; + + /** + * Space between the text and box border. + * When a number is specified, the left/right padding is 3 times the top/bottom to make it look nice. + * @default 0 + */ + padding?: number | PositionOptions; + + /** + * Space around the box. + * When a number is specified, the left/right margin is 3 times the top/bottom to make it look nice. + * @default 0 + */ + margin?: number | PositionOptions; + + /** + * Float the box on the available terminal screen space. + * @default 'left' + */ + float?: 'right' | 'center' | 'left'; + + /** + * Color of the background. + * Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `gray` or a hex value like `#ff0000` + */ + backgroundColor?: string; + + /** + * Align the text in the box based on the widest line. + * @default 'left' + */ + align?: 'left' | 'center' | 'right'; + } + + interface PositionOptions { + top?: number; + right?: number; + bottom?: number; + left?: number; + } +} diff --git a/types/boxen/tsconfig.json b/types/boxen/tsconfig.json new file mode 100644 index 0000000000..6d34147e83 --- /dev/null +++ b/types/boxen/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", + "boxen-tests.ts" + ] +} diff --git a/types/boxen/tslint.json b/types/boxen/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/boxen/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/braintree-web/index.d.ts b/types/braintree-web/index.d.ts index bc5ca0b01f..a2cfdb06c1 100644 --- a/types/braintree-web/index.d.ts +++ b/types/braintree-web/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/braintree/braintree-web // Definitions by: Guy Shahine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /** * @module braintree-web/american-express @@ -359,7 +360,8 @@ declare namespace braintree { * }); * @static */ - create: (options: { authorization: string }, callback: callback) => void; + create(options: { authorization: string }): Promise; + create(options: { authorization: string }, callback: callback): void; /** * @description The current version of the SDK, i.e. `3.0.2`. @@ -439,7 +441,8 @@ declare namespace braintree { * @param {callback} callback The second argument, `data`, is the {@link DataCollector} instance. * @returns {void} */ - create: (options: { client: Client, kount: boolean, paypal: boolean }, callback: callback) => void; + create(options: { client: Client, kount: boolean, paypal: boolean }): Promise; + create(options: { client: Client, kount: boolean, paypal: boolean }, callback: callback): void; /** * @description The current version of the SDK, i.e. `3.0.2`. @@ -591,18 +594,15 @@ declare namespace braintree { * @property {?HostedFields~hostedFieldsFieldData} fields.expirationYear {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the expiration year field, if it is present. * @property {?HostedFields~hostedFieldsFieldData} fields.postalCode {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the postal code field, if it is present. */ - interface HostedFieldsFieldDataFields { - number: HostedFieldsHostedFieldsFieldData; - cvv: HostedFieldsHostedFieldsFieldData; - expirationDate: HostedFieldsHostedFieldsFieldData; - expirationMonth: HostedFieldsHostedFieldsFieldData; - expirationYear: HostedFieldsHostedFieldsFieldData; - postalCode: HostedFieldsHostedFieldsFieldData; - } + type HostedFieldsHostedFieldsFieldName = 'number' | 'cvv' | 'expirationDate' | 'expirationMonth' | 'expirationYear' | 'postalCode'; + + type HostedFieldsFieldDataFields = { + [key in HostedFieldsHostedFieldsFieldName]: HostedFieldsHostedFieldsFieldData; + }; interface HostedFieldsStateObject { cards: HostedFieldsHostedFieldsCard[]; - emittedBy: string; + emittedBy: HostedFieldsHostedFieldsFieldName; fields: HostedFieldsFieldDataFields; } @@ -666,7 +666,8 @@ declare namespace braintree { * } * }, callback); */ - create: (options: { client: Client, fields: HostedFieldFieldOptions, styles: any }, callback: callback) => void; + create(options: { client: Client, fields: HostedFieldFieldOptions, styles: any }): Promise; + create(options: { client: Client, fields: HostedFieldFieldOptions, styles: any }, callback: callback): void; /** @@ -726,7 +727,7 @@ declare namespace braintree { * }); * @returns {void} */ - on(event: string, handler: ((event: any) => any)): void; + on(event: string, handler: ((event: HostedFieldsStateObject) => void)): void; /** * Cleanly tear down anything set up by {@link module:braintree-web/hosted-fields.create|create} @@ -785,7 +786,9 @@ declare namespace braintree { * }); * @returns {void} */ - tokenize(options?: { vault: boolean }, callback?: callback): void; + tokenize(options?: { vault?: boolean, cardholderName?: string, billingAddress?: any }): Promise; + tokenize(options: { vault?: boolean, cardholderName?: string, billingAddress?: any }, callback: callback): void; + tokenize(callback: callback): void; /** * Add a class to a {@link module:braintree-web/hosted-fields~field field}. Useful for updating field styles when events occur elsewhere in your checkout. @@ -1138,7 +1141,8 @@ declare namespace braintree { * client: client * }, callback); */ - create: (options: { client: Client }, callback: callback) => void; + create(options: { client: Client }): Promise; + create(options: { client: Client }, callback: callback): void; /** * @description The current version of the SDK, i.e. `3.0.2`. @@ -1207,6 +1211,7 @@ declare namespace braintree { * } * }); */ + verifyCard(options: { nonce: string, amount: number, addFrame: (err?: BraintreeError, iframe?: HTMLIFrameElement) => void, removeFrame?: () => void }): Promise; verifyCard(options: { nonce: string, amount: number, addFrame: (err?: BraintreeError, iframe?: HTMLIFrameElement) => void, removeFrame: () => void }, callback: callback): void; /** @@ -1751,3 +1756,4 @@ declare namespace braintree { export = braintree; export as namespace braintree; + diff --git a/types/braintree-web/test/node.ts b/types/braintree-web/test/node.ts index 9eed5b228d..59db2fb944 100644 --- a/types/braintree-web/test/node.ts +++ b/types/braintree-web/test/node.ts @@ -6,7 +6,7 @@ let clientToken: string = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiO braintree.client.create({ authorization: clientToken -}, function (error: braintree.BraintreeError, clientInstance: any) { +}, function (error: braintree.BraintreeError, clientInstance: braintree.Client) { var form: HTMLFormElement = document.getElementById('my-form-id') as HTMLFormElement; var data: { creditCard: braintree.CreditCardInfo } = { @@ -396,7 +396,7 @@ let submitNonceToServer: (nonce: string) => void; braintree.threeDSecure.verifyCard({ nonce: existingNonce, - amount: 123.45, + amount: 123.45, // $ExpectType number addFrame: function (err, iframe) { // Set up your UI and add the iframe. let my3DSContainer = document.createElement('div'); @@ -437,4 +437,4 @@ braintree.threeDSecure.cancelVerifyCard(function (err: braintree.BraintreeError, verifyPayload.nonce; // The nonce returned from the 3ds lookup call verifyPayload.liabilityShifted; // boolean verifyPayload.liabilityShiftPossible; // boolean -}); +}); \ No newline at end of file diff --git a/types/braintree-web/test/web.ts b/types/braintree-web/test/web.ts index 22073363d4..1801cbb497 100644 --- a/types/braintree-web/test/web.ts +++ b/types/braintree-web/test/web.ts @@ -1,10 +1,13 @@ +import { ApplePay } from ".."; +import * as braintree from ".."; + let version: string = braintree.VERSION; let clientToken: string = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI0YjlhYzVmYmI4ZTNkYzQzMmFkZjJhNzBlNjZlMWNjY2M5ODRkYzE4ZTM4YmY4NjYzZTM5NjM3NWZjYmQzY2U5fGNyZWF0ZWRfYXQ9MjAxNi0wOS0wOFQwNTowMzo0MC4xNjk1NTUwMzUrMDAwMFx1MDAyNm1lcmNoYW50X2lkPTM0OHBrOWNnZjNiZ3l3MmJcdTAwMjZwdWJsaWNfa2V5PTJuMjQ3ZHY4OWJxOXZtcHIiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tOjQ0My9tZXJjaGFudHMvMzQ4cGs5Y2dmM2JneXcyYi9jbGllbnRfYXBpL3YxL2NvbmZpZ3VyYXRpb24iLCJjaGFsbGVuZ2VzIjpbXSwiZW52aXJvbm1lbnQiOiJzYW5kYm94IiwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzLzM0OHBrOWNnZjNiZ3l3MmIvY2xpZW50X2FwaSIsImFzc2V0c1VybCI6Imh0dHBzOi8vYXNzZXRzLmJyYWludHJlZWdhdGV3YXkuY29tIiwiYXV0aFVybCI6Imh0dHBzOi8vYXV0aC52ZW5tby5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tIiwiYW5hbHl0aWNzIjp7InVybCI6Imh0dHBzOi8vY2xpZW50LWFuYWx5dGljcy5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tLzM0OHBrOWNnZjNiZ3l3MmIifSwidGhyZWVEU2VjdXJlRW5hYmxlZCI6dHJ1ZSwicGF5cGFsRW5hYmxlZCI6dHJ1ZSwicGF5cGFsIjp7ImRpc3BsYXlOYW1lIjoiQWNtZSBXaWRnZXRzLCBMdGQuIChTYW5kYm94KSIsImNsaWVudElkIjpudWxsLCJwcml2YWN5VXJsIjoiaHR0cDovL2V4YW1wbGUuY29tL3BwIiwidXNlckFncmVlbWVudFVybCI6Imh0dHA6Ly9leGFtcGxlLmNvbS90b3MiLCJiYXNlVXJsIjoiaHR0cHM6Ly9hc3NldHMuYnJhaW50cmVlZ2F0ZXdheS5jb20iLCJhc3NldHNVcmwiOiJodHRwczovL2NoZWNrb3V0LnBheXBhbC5jb20iLCJkaXJlY3RCYXNlVXJsIjpudWxsLCJhbGxvd0h0dHAiOnRydWUsImVudmlyb25tZW50Tm9OZXR3b3JrIjp0cnVlLCJlbnZpcm9ubWVudCI6Im9mZmxpbmUiLCJ1bnZldHRlZE1lcmNoYW50IjpmYWxzZSwiYnJhaW50cmVlQ2xpZW50SWQiOiJtYXN0ZXJjbGllbnQzIiwiYmlsbGluZ0FncmVlbWVudHNFbmFibGVkIjp0cnVlLCJtZXJjaGFudEFjY291bnRJZCI6ImFjbWV3aWRnZXRzbHRkc2FuZGJveCIsImN1cnJlbmN5SXNvQ29kZSI6IlVTRCJ9LCJjb2luYmFzZUVuYWJsZWQiOmZhbHNlLCJtZXJjaGFudElkIjoiMzQ4cGs5Y2dmM2JneXcyYiIsInZlbm1vIjoib2ZmIn0="; braintree.client.create({ authorization: clientToken -}, function (error: braintree.BraintreeError, clientInstance: any) { +}, function (error: braintree.BraintreeError, clientInstance: braintree.Client) { var form: HTMLFormElement = document.getElementById('my-form-id') as HTMLFormElement; var data: { creditCard: braintree.CreditCardInfo } = { @@ -62,7 +65,7 @@ braintree.client.create({ select: true } } - }, function (hostedFieldsErr?: braintree.BraintreeError, hostedFieldsInstance?: any) { + }, function (hostedFieldsErr?: braintree.BraintreeError, hostedFieldsInstance?: braintree.HostedFields) { if (hostedFieldsErr) { // Handle error in Hosted Fields creation @@ -178,7 +181,7 @@ braintree.client.create({ }); }); - braintree.applePay.create({ client: clientInstance }, function (createErr?: braintree.BraintreeError, applePayInstance?: any) { + braintree.applePay.create({ client: clientInstance }, function (createErr?: braintree.BraintreeError, applePayInstance?: ApplePay) { if (createErr) { // Handle error in client creation console.log(`Error Code: ${error.code}, Type: ${error.type}, Message: ${error.message}, Details: ${error.details}`); @@ -194,7 +197,7 @@ braintree.client.create({ total: { label: 'Your Label', amount: '10.00' }, }; - var paymentRequest = braintree.applePay.createPaymentRequest(request); + var paymentRequest = applePayInstance.createPaymentRequest(request); console.log(paymentRequest); // { total: { }, countryCode: 'US', currencyCode: 'USD', merchantCapabilities: [ ], supportedNetworks: [ ] } @@ -394,7 +397,7 @@ let submitNonceToServer: (nonce: string) => void; braintree.threeDSecure.verifyCard({ nonce: existingNonce, - amount: 123.45, + amount: 123.45, // $ExpectType number addFrame: function (err, iframe) { // Set up your UI and add the iframe. let my3DSContainer = document.createElement('div'); 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/broccoli-plugin/tslint.json b/types/broccoli-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/broccoli-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/browser-bunyan/browser-bunyan-tests.ts b/types/browser-bunyan/browser-bunyan-tests.ts index 6cf1bf926b..9dcb519c27 100644 --- a/types/browser-bunyan/browser-bunyan-tests.ts +++ b/types/browser-bunyan/browser-bunyan-tests.ts @@ -23,3 +23,19 @@ const myObject = { x: 1, y: 2 }; log.info({ obj: myObject }, 'This is my object:'); new bunyan.ConsoleFormattedStream({ logByLevel: true }); + +const style = { + levels: { + trace: 'color: DeepPink', + debug: 'color: GoldenRod', + info: 'color: DarkTurquoise', + warn: 'color: Purple', + error: 'color: Crimson', + fatal: 'color: Black', + }, + def: 'color: DimGray', + msg: 'color: SteelBlue', + src: 'color: DimGray; font-style: italic; font-size: 0.9em', +}; + +new bunyan.ConsoleFormattedStream({ css: style }); diff --git a/types/browser-bunyan/index.d.ts b/types/browser-bunyan/index.d.ts index 4fedbcd780..24d4b3e874 100644 --- a/types/browser-bunyan/index.d.ts +++ b/types/browser-bunyan/index.d.ts @@ -10,17 +10,30 @@ import * as bunyan from 'bunyan'; declare namespace BrowserBunyan { + interface ConsoleFormattedStreamLevelStyle { + trace: string; + debug: string; + info: string; + warn: string; + error: string; + fatal: string; + } + + interface ConsoleFormattedStreamStyle { + levels: Partial; + def: string; + msg: string; + src: string; + } + interface ConsoleFormattedStreamOptions { logByLevel?: boolean; + css?: Partial; } - interface ConsoleFormattedStream { - new(options?: ConsoleFormattedStreamOptions): NodeJS.WritableStream; - } + type ConsoleFormattedStream = new(options?: ConsoleFormattedStreamOptions) => NodeJS.WritableStream; - interface ConsoleRawStream { - new(options?: ConsoleFormattedStreamOptions): NodeJS.WritableStream; - } + type ConsoleRawStream = new(options?: ConsoleFormattedStreamOptions) => NodeJS.WritableStream; } type BrowserBunyan = typeof bunyan & { diff --git a/types/browserslist-useragent/browserslist-useragent-tests.ts b/types/browserslist-useragent/browserslist-useragent-tests.ts new file mode 100644 index 0000000000..83103178e5 --- /dev/null +++ b/types/browserslist-useragent/browserslist-useragent-tests.ts @@ -0,0 +1,30 @@ +import { + matchesUA, + resolveUserAgent, + normalizeQuery +} from 'browserslist-useragent'; + +// $ExpectType boolean +matchesUA( + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' +); + +// $ExpectType boolean +matchesUA( + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36', + { + browsers: ['defaults'], + env: 'production', + ignorePath: true, + ignoreMinor: false, + allowHigherVersions: false + } +); + +// $ExpectType ResolvedUserAgent +resolveUserAgent( + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' +); + +// $ExpectType string +normalizeQuery('defaults'); diff --git a/types/browserslist-useragent/index.d.ts b/types/browserslist-useragent/index.d.ts new file mode 100644 index 0000000000..4c7e548a4a --- /dev/null +++ b/types/browserslist-useragent/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for browserslist-useragent 3.0 +// Project: https://github.com/browserslist/browserslist-useragent (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: nju33 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface ResolvedUserAgent { + family: string; + version: string; +} + +export interface BrowserslistUseragentOptions { + browsers?: string[]; + env?: string; + ignorePath?: boolean; + ignoreMinor?: boolean; + allowHigherVersions?: boolean; +} + +export function matchesUA( + uaString: string, + opts?: BrowserslistUseragentOptions +): boolean; +export function resolveUserAgent(uaString: string): ResolvedUserAgent; +export function normalizeQuery(query: string): string; diff --git a/types/browserslist-useragent/tsconfig.json b/types/browserslist-useragent/tsconfig.json new file mode 100644 index 0000000000..849531b901 --- /dev/null +++ b/types/browserslist-useragent/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-useragent-tests.ts"] +} diff --git a/types/browserslist-useragent/tslint.json b/types/browserslist-useragent/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/browserslist-useragent/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/bs58/bs58-tests.ts b/types/bs58/bs58-tests.ts index 5fe3b73675..f484122683 100644 --- a/types/bs58/bs58-tests.ts +++ b/types/bs58/bs58-tests.ts @@ -1,11 +1,8 @@ +import bs58 = require('bs58'); -import * as bs58 from 'bs58'; +const bytes = Buffer.from('003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187', 'hex'); +const address = bs58.encode(bytes); +address; // $ExpectType string -{ - let encoded: string; - - encoded = bs58.encode([255]); - encoded = bs58.encode({0: 255, length: 1}); -} - -let decoded: number[] = bs58.decode('5Q'); +bs58.decode(address); // $ExpectType Buffer +bs58.decodeUnsafe(address); // $ExpectType Buffer | undefined diff --git a/types/bs58/index.d.ts b/types/bs58/index.d.ts index 1539910e12..2915e15dfe 100644 --- a/types/bs58/index.d.ts +++ b/types/bs58/index.d.ts @@ -1,14 +1,11 @@ -// Type definitions for bs58 3.0.0 +// Type definitions for bs58 4.0 // Project: https://github.com/cryptocoinjs/bs58 // Definitions by: Ilya Mochalov +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import { BaseConverter } from 'base-x'; -import * as BaseX from 'base-x'; - -declare namespace base58 { } - -declare let base58: BaseX.BaseConverter; +declare const base58: BaseConverter; export = base58; diff --git a/types/bs58/tsconfig.json b/types/bs58/tsconfig.json index 9e0ed25701..1f9d6fcc87 100644 --- a/types/bs58/tsconfig.json +++ b/types/bs58/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", "bs58-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/bs58/tslint.json b/types/bs58/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/bs58/tslint.json +++ b/types/bs58/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/bs58/v3/bs58-tests.ts b/types/bs58/v3/bs58-tests.ts new file mode 100644 index 0000000000..4b2f7891e7 --- /dev/null +++ b/types/bs58/v3/bs58-tests.ts @@ -0,0 +1,10 @@ +import * as bs58 from 'bs58'; + +{ + let encoded: string; + + encoded = bs58.encode([255]); + encoded = bs58.encode({0: 255, length: 1}); +} + +const decoded: number[] = bs58.decode('5Q'); diff --git a/types/bs58/v3/index.d.ts b/types/bs58/v3/index.d.ts new file mode 100644 index 0000000000..c976588bc1 --- /dev/null +++ b/types/bs58/v3/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for bs58 3.0 +// Project: https://github.com/cryptocoinjs/bs58 +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as BaseX from 'base-x'; + +declare namespace base58 { } + +declare let base58: BaseX.BaseConverter; + +export = base58; diff --git a/types/bs58/v3/tsconfig.json b/types/bs58/v3/tsconfig.json new file mode 100644 index 0000000000..e7f77ce6b4 --- /dev/null +++ b/types/bs58/v3/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "bs58": [ + "bs58/v3" + ], + "base-x": [ + "base-x/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bs58-tests.ts" + ] +} diff --git a/types/bs58/v3/tslint.json b/types/bs58/v3/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/bs58/v3/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/btoa/btoa-tests.ts b/types/btoa/btoa-tests.ts index d09cdad23a..7ce230fcf7 100644 --- a/types/btoa/btoa-tests.ts +++ b/types/btoa/btoa-tests.ts @@ -1,3 +1,3 @@ -import btoa from 'btoa'; +import btoa = require('btoa'); btoa('foo'); diff --git a/types/btoa/index.d.ts b/types/btoa/index.d.ts index cc311ed836..bdb02b5b59 100644 --- a/types/btoa/index.d.ts +++ b/types/btoa/index.d.ts @@ -1,7 +1,10 @@ // Type definitions for btoa 1.2 // Project: https://git.coolaj86.com/coolaj86/btoa.js // Definitions by: John Wright +// Alex Brick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -export default function(str: string): string; +declare function btoa(str: string): string; + +export = btoa; diff --git a/types/buble/buble-tests.ts b/types/buble/buble-tests.ts new file mode 100644 index 0000000000..cebb373415 --- /dev/null +++ b/types/buble/buble-tests.ts @@ -0,0 +1,77 @@ +import * as buble from 'buble'; + +const input = 'const answer = () => 42;'; + +// Simple transform +(() => { + const output = buble.transform(input); + + console.log(output.code); + console.log(output.map.toString()); + console.log(output.map.toUrl()); +})(); + +// Transform for Chrome & Firefox +(() => { + const output = buble.transform(input, { + target: { + chrome: 71, + firefox: 64, + }, + }); +})(); + +// Transform with sourcemaps support +(() => { + const output = buble.transform(input, { + source: 'input.js', + file: 'output.js', + includeContent: true, + }); +})(); + +// Transform for Preact +(() => { + const output = buble.transform(input, { + jsx: 'h' + }); +})(); + +// Transform with Object assign/spread support +(() => { + let output = buble.transform(input, { + objectAssign: true, + }); + output = buble.transform(input, { + objectAssign: 'MyCustomObjectAssign', + }); +})(); + +// Transform with every transforms +(() => { + const output = buble.transform(input, { + transforms: { + arrow: true, + classes: false, + collections: true, + computedProperty: false, + conciseMethodProperty: true, + constLoop: false, + dangerousForOf: true, + dangerousTaggedTemplateString: false, + defaultParameter: true, + destructuring: false, + forOf: true, + generator: false, + letConst: true, + modules: false, + numericLiteral: true, + parameterDestructuring: false, + reservedProperties: true, + spreadRest: false, + stickyRegExp: true, + templateString: false, + unicodeRegExp: true, + } + }); +})(); diff --git a/types/buble/index.d.ts b/types/buble/index.d.ts new file mode 100644 index 0000000000..db3cb0a7b7 --- /dev/null +++ b/types/buble/index.d.ts @@ -0,0 +1,65 @@ +// Type definitions for buble 0.19 +// Project: https://github.com/Rich-Harris/buble#README +// Definitions by: Hugo Alliaume +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { SourceMap } from "magic-string"; + +export interface TransformOptions { + // source: https://github.com/Rich-Harris/buble/blob/master/src/support.js + target?: { + chrome?: 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71; + firefox?: 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64; + safari?: 8 | 9 | 10 | 10.1 | 11 | 11.1 | 12; + ie?: 8 | 9 | 10 | 11; + edge?: 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19; + node?: 0.10 | 0.12 | 4 | 5 | 6 | 8 | 8.3 | 8.7 | 8.10; + }; + + // used for sourcemaps + source?: string; // input + file?: string; // output + includeContent?: boolean; + + // custom JSX pragma (https://buble.surge.sh/guide/#jsx) + jsx?: string; // default: 'React.createElement' + + // custom `Object.assign` (https://buble.surge.sh/guide/#object-spread-and-rest) + objectAssign?: string | boolean; + + // transforms + transforms?: { + arrow?: boolean; + classes?: boolean; + collections?: boolean; + computedProperty?: boolean; + conciseMethodProperty?: boolean; + constLoop?: boolean; + dangerousForOf?: boolean; + dangerousTaggedTemplateString?: boolean; + defaultParameter?: boolean; + destructuring?: boolean; + forOf?: boolean; + generator?: boolean; + letConst?: boolean; + modules?: boolean; + numericLiteral?: boolean; + parameterDestructuring?: boolean; + reservedProperties?: boolean; + spreadRest?: boolean; + stickyRegExp?: boolean; + templateString?: boolean; + unicodeRegExp?: boolean; + }; + + // others + namedFunctionExpressions?: boolean; +} + +export interface TransformOutput { + code: string; + map: SourceMap; +} + +export function transform(content: string, options?: TransformOptions): TransformOutput; diff --git a/types/universal-router/package.json b/types/buble/package.json similarity index 60% rename from types/universal-router/package.json rename to types/buble/package.json index 0ab257c45a..d2f8119c0a 100644 --- a/types/universal-router/package.json +++ b/types/buble/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "path-to-regexp": "^2.2.0" + "magic-string": "^0.25.0" } } diff --git a/types/sip.js/tsconfig.json b/types/buble/tsconfig.json similarity index 94% rename from types/sip.js/tsconfig.json rename to types/buble/tsconfig.json index ea3b5a009c..0196ebd845 100644 --- a/types/sip.js/tsconfig.json +++ b/types/buble/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "sip.js-tests.ts" + "buble-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/buble/tslint.json b/types/buble/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/buble/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/buffer-crc32/buffer-crc32-tests.ts b/types/buffer-crc32/buffer-crc32-tests.ts new file mode 100644 index 0000000000..979d70215c --- /dev/null +++ b/types/buffer-crc32/buffer-crc32-tests.ts @@ -0,0 +1,11 @@ +import crc32 = require('buffer-crc32'); + +const buf = new Buffer([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]); +crc32(buf); // $ExpectType Buffer +crc32('自動販売機'); // $ExpectType Buffer + +crc32.signed(buf); // $ExpectType number +crc32.unsigned(buf); // $ExpectType number + +const partialCrc = crc32('hey'); +crc32(' ', partialCrc); // $ExpectType Buffer diff --git a/types/buffer-crc32/index.d.ts b/types/buffer-crc32/index.d.ts new file mode 100644 index 0000000000..f2857e36a8 --- /dev/null +++ b/types/buffer-crc32/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for buffer-crc32 0.2 +// Project: https://github.com/brianloveswords/buffer-crc32 +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = crc32; + +declare function crc32(input: string | Buffer, partialCrc?: Buffer): Buffer; + +declare namespace crc32 { + function signed(buffer: Buffer): number; + function unsigned(buffer: Buffer): number; +} diff --git a/types/buffer-crc32/tsconfig.json b/types/buffer-crc32/tsconfig.json new file mode 100644 index 0000000000..cbcb036b91 --- /dev/null +++ b/types/buffer-crc32/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", + "buffer-crc32-tests.ts" + ] +} diff --git a/types/buffer-crc32/tslint.json b/types/buffer-crc32/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/buffer-crc32/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/build-output-script/build-output-script-tests.ts b/types/build-output-script/build-output-script-tests.ts new file mode 100644 index 0000000000..719c6301d5 --- /dev/null +++ b/types/build-output-script/build-output-script-tests.ts @@ -0,0 +1,11 @@ +import buildOutputScript = require('build-output-script'); + +// $ExpectType string +buildOutputScript([{ address: '1LukeQU5jwebXbMLDVydeH4vFSobRV9rkj', value: 100000000 }]); +// $ExpectType string +buildOutputScript([ + { address: '1LukeQU5jwebXbMLDVydeH4vFSobRV9rkj', value: 100000000 }, + { address: '1BitcoinEaterAddressDontSendf59kuE', value: 100000000 }, +]); +// $ExpectError +buildOutputScript([]); diff --git a/types/build-output-script/index.d.ts b/types/build-output-script/index.d.ts new file mode 100644 index 0000000000..5c90083e34 --- /dev/null +++ b/types/build-output-script/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for build-output-script 1.0 +// Project: https://github.com/lukechilds/build-output-script#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +export = buildOutputScript; + +/** + * Builds a P2PKH Bitcoin transaction output script from an array of P2PKH addresses and amounts. + * Will also work with any Bitcoin derived cryptocurrencies with a single byte pubkey hash address prefix. + * + * The output script is returned as a hex string and can be passed directly in to ledgerjs. + * + * @param outputs An array of one or more output objects. + * @returns A (hex string) P2PKH transaction output script. + */ +declare function buildOutputScript( + outputs: [buildOutputScript.Output, ...buildOutputScript.Output[]] +): string; + +declare namespace buildOutputScript { + interface Output { + /** + * A valid P2PKH address. + */ + address: string; + /** + * Value to send to `address` in satoshis. + */ + value: number; + } +} diff --git a/types/build-output-script/tsconfig.json b/types/build-output-script/tsconfig.json new file mode 100644 index 0000000000..1fc0da7de0 --- /dev/null +++ b/types/build-output-script/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", + "build-output-script-tests.ts" + ] +} diff --git a/types/build-output-script/tslint.json b/types/build-output-script/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/build-output-script/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..46c146272e 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -98,11 +98,17 @@ const pdfQueue = new Queue('pdf transcoding', { // ////////////////////////////////////////////////////////////////////////////////// -pdfQueue.process((job) => { +pdfQueue.process((job: Queue.Job) => { // Processors can also return promises instead of using the done callback return Promise.resolve(); }); +async function pfdPromise(job: Queue.Job) { + return Promise.resolve(); +} + +pdfQueue.process(1, pfdPromise); + videoQueue.add({ video: 'http://example.com/video1.mov' }, { jobId: 1 }) .then((video1Job) => { // When job has successfully be placed in the queue the job is returned @@ -125,6 +131,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 +139,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..bbafa0301c 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.5 // Project: https://github.com/OptimalBits/bull // Definitions by: Bruno Grieder // Cameron Crothers @@ -10,11 +10,13 @@ // Bond Akinmade // Wuha Team // Alec Brunelle +// Dan Manastireanu +// Kjell-Morten Bratsberg Thorsen +// Christian D. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as Redis from "ioredis"; -import * as Promise from "bluebird"; /** * This is the Queue constructor. @@ -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 { @@ -34,6 +36,8 @@ declare namespace Bull { max: number; /** Per duration in milliseconds */ duration: number; + /** When jobs get rate limited, they stay in the waiting queue and are not moved to the delayed queue */ + bounceBack?: boolean; } interface QueueOptions { @@ -66,6 +70,11 @@ declare namespace Bull { */ lockDuration?: number; + /** + * Interval in milliseconds on which to acquire the job lock. + */ + lockRenewTime?: number; + /** * How often check for stalled jobs (use 0 for never checking) */ @@ -90,8 +99,14 @@ declare namespace Bull { * Define a custom backoff strategy */ backoffStrategies?: { - [key: string]: (attemptsMade: number, err: typeof Error) => number; + [key: string]: (attemptsMade: number, err: 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; @@ -111,6 +126,35 @@ declare namespace Bull { */ attemptsMade: number; + /** + * When this job was started (unix milliseconds) + */ + processedOn?: number; + + /** + * When this job was completed (unix milliseconds) + */ + finishedOn?: number; + + /** + * Which queue this job was part of + */ + queue: Queue; + + timestamp: number; + + /** + * The named processor name + */ + name: string; + + /** + * The stacktrace for any errors + */ + stacktrace: string[]; + + returnvalue: any; + /** * Report progress on a job */ @@ -141,6 +185,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 +197,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 +231,7 @@ declare namespace Bull { } type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; + type JobStatusClean = 'completed' | 'wait' | 'active' | 'delayed' | 'failed'; interface BackoffOptions { /** @@ -205,6 +267,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 +340,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 { @@ -294,6 +366,11 @@ declare namespace Bull { } interface Queue { + /** + * The name of the queue + */ + name: string; + /** * Returns a promise that resolves when Redis is connected and the queue is ready to accept jobs. * This replaces the `ready` event emitted on Queue in previous verisons. @@ -306,50 +383,39 @@ declare namespace Bull { * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. * + * If the callback signature contains the second optional done argument, + * the callback will be passed a done callback to be called after the job has been completed. * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. - */ - process(callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. + * or with a result as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; results, as a second argument to the "completed" event. * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * The callback can also be defined as the string path to a module - * exporting the callback function. Using a path has several advantages: - * - The process is sandboxed so if it crashes it does not affect the worker. - * - You can run blocking code without affecting the queue (jobs will not stall). - * - Much better utilization of multi-core CPUs. - * - Less connections to redis. - * - * A promise must be returned to signal job completion. + * If, however, the callback signature does not contain the done argument, + * a promise must be returned to signal job completion. * If the promise is rejected, the error will be passed as a second argument to the "failed" event. * If it is resolved, its value will be the "completed" event's second argument. */ - process(callback: ((job: Job) => void) | string): Promise; + process(callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; /** * Defines a processing function for the jobs placed into a given Queue. * * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. - * The callback can also be defined as the string path to a module - * exporting the callback function. Using a path has several advantages: - * - The process is sandboxed so if it crashes it does not affect the worker. - * - You can run blocking code without affecting the queue (jobs will not stall). - * - Much better utilization of multi-core CPUs. - * - Less connections to redis. * - * A promise must be returned to signal job completion. + * If the callback signature contains the second optional done argument, + * the callback will be passed a done callback to be called after the job has been completed. + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; results, as a second argument to the "completed" event. + * + * If, however, the callback signature does not contain the done argument, + * a promise must be returned to signal job completion. * If the promise is rejected, the error will be passed as a second argument to the "failed" event. * If it is resolved, its value will be the "completed" event's second argument. * - * @param concurrency Bull will then call you handler in parallel respecting this max number. + * @param concurrency Bull will then call your handler in parallel respecting this maximum value. */ - process(concurrency: number, callback: ((job: Job) => void) | string): Promise; + process(concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -357,35 +423,21 @@ declare namespace Bull { * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. * + * If the callback signature contains the second optional done argument, + * the callback will be passed a done callback to be called after the job has been completed. * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. + * or with a result as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; results, as a second argument to the "completed" event. * - * @param concurrency Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a named processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * The callback can also be defined as the string path to a module - * exporting the callback function. Using a path has several advantages: - * - The process is sandboxed so if it crashes it does not affect the worker. - * - You can run blocking code without affecting the queue (jobs will not stall). - * - Much better utilization of multi-core CPUs. - * - Less connections to redis. - * - * A promise must be returned to signal job completion. + * If, however, the callback signature does not contain the done argument, + * a promise must be returned to signal job completion. * If the promise is rejected, the error will be passed as a second argument to the "failed" event. * If it is resolved, its value will be the "completed" event's second argument. * * @param name Bull will only call the handler if the job name matches */ // tslint:disable-next-line:unified-signatures - process(name: string, callback: ((job: Job) => void) | string): Promise; + process(name: string, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -393,52 +445,21 @@ declare namespace Bull { * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. * + * If the callback signature contains the second optional done argument, + * the callback will be passed a done callback to be called after the job has been completed. * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. + * or with a result as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; results, as a second argument to the "completed" event. * - * @param name Bull will only call the handler if the job name matches - */ - // tslint:disable-next-line:unified-signatures - process(name: string, callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a named processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * The callback can also be defined as the string path to a module - * exporting the callback function. Using a path has several advantages: - * - The process is sandboxed so if it crashes it does not affect the worker. - * - You can run blocking code without affecting the queue (jobs will not stall). - * - Much better utilization of multi-core CPUs. - * - Less connections to redis. - * - * A promise must be returned to signal job completion. + * If, however, the callback signature does not contain the done argument, + * a promise must be returned to signal job completion. * If the promise is rejected, the error will be passed as a second argument to the "failed" event. * If it is resolved, its value will be the "completed" event's second argument. * * @param name Bull will only call the handler if the job name matches - * @param concurrency Bull will then call you handler in parallel respecting this max number. + * @param concurrency Bull will then call your handler in parallel respecting this maximum value. */ - process(name: string, concurrency: number, callback: ((job: Job) => void) | string): Promise; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. - * - * @param name Bull will only call the handler if the job name matches - * @param concurrency Bull will then call you handler in parallel respecting this max number. - */ - process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + process(name: string, concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; /** * Creates a new job and adds it to the queue. @@ -564,6 +585,11 @@ declare namespace Bull { */ getJobCounts(): Promise; + /** + * Returns a promise that resolves with the job counts for the given queue of the given types. + */ + getJobCountByTypes(types: string[] | string): Promise; + /** * Returns a promise that resolves with the quantity of completed jobs. */ @@ -601,12 +627,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 +644,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 +685,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 +697,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 +726,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/byte-range/byte-range-tests.ts b/types/byte-range/byte-range-tests.ts new file mode 100644 index 0000000000..150d6b0fc2 --- /dev/null +++ b/types/byte-range/byte-range-tests.ts @@ -0,0 +1,10 @@ +import byteRange = require('byte-range'); + +byteRange(1); // $ExpectType [number, number] +byteRange(1, { signed: false }); // $ExpectType [number, number] +byteRange.uint8; // $ExpectType [number, number] +byteRange.uint16; // $ExpectType [number, number] +byteRange.uint32; // $ExpectType [number, number] +byteRange.int8; // $ExpectType [number, number] +byteRange.int16; // $ExpectType [number, number] +byteRange.int32; // $ExpectType [number, number] diff --git a/types/byte-range/index.d.ts b/types/byte-range/index.d.ts new file mode 100644 index 0000000000..120889ad90 --- /dev/null +++ b/types/byte-range/index.d.ts @@ -0,0 +1,49 @@ +// Type definitions for byte-range 1.0 +// Project: https://github.com/lukechilds/byte-range#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = byteRange; + +/** + * Calculates integer ranges for a given number of bytes. + * + * @param bytes Number of bytes to return the integer range for. Must be a positive integer. + */ +declare function byteRange(bytes: number, options?: byteRange.Options): byteRange.ByteRange; + +declare namespace byteRange { + /** + * Precomputed byte range for an unsigned 8 bit integer. + */ + const uint8: ByteRange; + /** + * Precomputed byte range for an unsigned 16 bit integer. + */ + const uint16: ByteRange; + /** + * Precomputed byte range for an unsigned 32 bit integer. + */ + const uint32: ByteRange; + /** + * Precomputed byte range for an signed 8 bit integer. + */ + const int8: ByteRange; + /** + * Precomputed byte range for an signed 16 bit integer. + */ + const int16: ByteRange; + /** + * Precomputed byte range for an signed 32 bit integer. + */ + const int32: ByteRange; + + interface Options { + /** + * @default false + */ + signed?: boolean; + } + + type ByteRange = [number, number]; +} diff --git a/types/byte-range/tsconfig.json b/types/byte-range/tsconfig.json new file mode 100644 index 0000000000..13d4b78f5d --- /dev/null +++ b/types/byte-range/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", + "byte-range-tests.ts" + ] +} diff --git a/types/byte-range/tslint.json b/types/byte-range/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/byte-range/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bytebuffer/index.d.ts b/types/bytebuffer/index.d.ts index 285948dc24..eaa1a509d5 100644 --- a/types/bytebuffer/index.d.ts +++ b/types/bytebuffer/index.d.ts @@ -127,7 +127,7 @@ declare class ByteBuffer * Calculates the number of UTF8 characters of a string.JavaScript itself uses UTF- 16, so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF. */ static calculateUTF8Chars( str: string ): number; - + /** * Calculates the number of UTF8 bytes of a string. This is an alias of ByteBuffer#calculateUTF8Bytes. */ @@ -146,7 +146,7 @@ declare class ByteBuffer /** * Concatenates multiple ByteBuffers into one. */ - static concat( buffers: Array, encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer; + static concat( buffers: Array, encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer; /** * Decodes a base64 encoded string to a ByteBuffer. @@ -185,7 +185,7 @@ declare class ByteBuffer * @param littleEndian Whether to use little or big endian byte order. Defaults to ByteBuffer.DEFAULT_ENDIAN. * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteBuffer.DEFAULT_NOASSERT. */ - static wrap( buffer: ByteBuffer | ArrayBuffer | Uint8Array | string, enc?: string | boolean, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; + static wrap( buffer: ByteBuffer | Buffer | ArrayBuffer | Uint8Array | string, enc?: string | boolean, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; /** * Decodes a zigzag encoded signed 32bit integer. @@ -220,7 +220,7 @@ declare class ByteBuffer /** * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended data's length. */ - append( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; + append( source: ByteBuffer | Buffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; /** * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified offset up to the length of this ByteBuffer's data. @@ -291,7 +291,7 @@ declare class ByteBuffer /** * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly. */ - prepend( source: ByteBuffer | string | ArrayBuffer, encoding?: string | number, offset?: number ): ByteBuffer; + prepend( source: ByteBuffer | string | ArrayBuffer | Buffer, encoding?: string | number, offset?: number ): ByteBuffer; /** * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly. @@ -480,7 +480,7 @@ declare class ByteBuffer /** * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will transparently ByteBuffer#flip this ByteBuffer if offset > limit but the actual offsets remain untouched. */ - toBuffer( forceCopy?: boolean ): ArrayBuffer; + toBuffer( forceCopy?: boolean ): Buffer; /** *Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are: @@ -517,7 +517,7 @@ declare class ByteBuffer /** * Writes an array of bytes. This is an alias for append */ - writeBytes( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; + writeBytes( source: ByteBuffer | Buffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; /** * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL characters itself. @@ -574,15 +574,20 @@ declare class ByteBuffer */ writeInt8( value: number, offset?: number ): ByteBuffer; + /** + * Write a 64bit signed integer. This is an alias of ByteBuffer#writeInt64. + */ + writeLong( value: number | Long, offset?: number ): ByteBuffer; + /** * Writes a 16bit signed integer. This is an alias of ByteBuffer#writeInt16. */ writeShort( value: number, offset?: number ): ByteBuffer; /** - * Writes an UTF8 encoded string.This is an alias of ByteBuffer#writeUTF8String. + * Writes an UTF8 encoded string. This is an alias of ByteBuffer#writeUTF8String. */ - WriteString( str: string, offset?: number ): ByteBuffer | number; + writeString( str: string, offset?: number ): ByteBuffer | number; /** * Writes an UTF8 encoded string. diff --git a/types/cacheable-request/cacheable-request-tests.ts b/types/cacheable-request/cacheable-request-tests.ts new file mode 100644 index 0000000000..95458c14b7 --- /dev/null +++ b/types/cacheable-request/cacheable-request-tests.ts @@ -0,0 +1,28 @@ +import * as http from 'http'; +import * as https from 'https'; +import CacheableRequest = require('cacheable-request'); +import QuickLRU = require('quick-lru'); + +// You can do +let cacheableRequest = new CacheableRequest(http.request); +const cacheReq = cacheableRequest('http://example.com', res => { + res; // $ExpectType ServerResponse | ResponseLike +}); +cacheReq.on('request', req => req.end()); + +cacheableRequest = new CacheableRequest(https.request); + +cacheableRequest = new CacheableRequest(http.request, 'redis://user:pass@localhost:6379'); +cacheableRequest = new CacheableRequest(http.request, new Map()); +cacheableRequest = new CacheableRequest(http.request, new QuickLRU({ maxSize: 1000 })); + +cacheableRequest('example.com', res => { + res; // $ExpectType ServerResponse | ResponseLike +}) + .on('error', err => { + err; // $ExpectType RequestErrorCls | CacheErrorCls + }) + .on('request', req => { + req.on('error', () => {}); + req.end(); + }); diff --git a/types/cacheable-request/index.d.ts b/types/cacheable-request/index.d.ts new file mode 100644 index 0000000000..98d858d3f6 --- /dev/null +++ b/types/cacheable-request/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for cacheable-request 6.0 +// Project: https://github.com/lukechilds/cacheable-request#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { request, RequestOptions, ClientRequest, ServerResponse } from 'http'; +import { URL } from 'url'; +import { EventEmitter } from 'events'; +import { Store } from 'keyv'; +import { Options as CacheSemanticsOptions } from 'http-cache-semantics'; +import ResponseLike = require('responselike'); + +export = CacheableRequest; + +declare const CacheableRequest: CacheableRequest; + +type RequestFn = typeof request; + +interface CacheableRequest { + new (requestFn: RequestFn, storageAdapter?: string | Store): ( + opts: string | URL | (RequestOptions & CacheSemanticsOptions), + cb?: (response: ServerResponse | ResponseLike) => void + ) => CacheableRequest.Emitter; + + RequestError: typeof RequestErrorCls; + CacheError: typeof CacheErrorCls; +} + +declare namespace CacheableRequest { + interface Options { + /** + * If the cache should be used. Setting this to `false` will completely bypass the cache for the current request. + * @default true + */ + cache?: boolean; + + /** + * If set to `true` once a cached resource has expired it is deleted and will have to be re-requested. + * + * If set to `false`, after a cached resource's TTL expires it is kept in the cache and will be revalidated + * on the next request with `If-None-Match`/`If-Modified-Since` headers. + * @default false + */ + strictTtl?: boolean; + + /** + * Limits TTL. The `number` represents milliseconds. + * @default undefined + */ + maxTtl?: number; + + /** + * When set to `true`, if the DB connection fails we will automatically fallback to a network request. + * DB errors will still be emitted to notify you of the problem even though the request callback may succeed. + * @default false + */ + automaticFailover?: boolean; + + /** + * Forces refreshing the cache. If the response could be retrieved from the cache, it will perform a + * new request and override the cache instead. + * @default false + */ + forceRefresh?: boolean; + } + + interface Emitter extends EventEmitter { + addListener(event: 'request', listener: (request: ClientRequest) => void): this; + addListener( + event: 'response', + listener: (response: ServerResponse | ResponseLike) => void + ): this; + addListener(event: 'error', listener: (error: RequestError | CacheError) => void): this; + on(event: 'request', listener: (request: ClientRequest) => void): this; + on(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this; + on(event: 'error', listener: (error: RequestError | CacheError) => void): this; + once(event: 'request', listener: (request: ClientRequest) => void): this; + once(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this; + once(event: 'error', listener: (error: RequestError | CacheError) => void): this; + prependListener(event: 'request', listener: (request: ClientRequest) => void): this; + prependListener( + event: 'response', + listener: (response: ServerResponse | ResponseLike) => void + ): this; + prependListener(event: 'error', listener: (error: RequestError | CacheError) => void): this; + prependOnceListener(event: 'request', listener: (request: ClientRequest) => void): this; + prependOnceListener( + event: 'response', + listener: (response: ServerResponse | ResponseLike) => void + ): this; + prependOnceListener( + event: 'error', + listener: (error: RequestError | CacheError) => void + ): this; + removeListener(event: 'request', listener: (request: ClientRequest) => void): this; + removeListener( + event: 'response', + listener: (response: ServerResponse | ResponseLike) => void + ): this; + removeListener(event: 'error', listener: (error: RequestError | CacheError) => void): this; + off(event: 'request', listener: (request: ClientRequest) => void): this; + off(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this; + off(event: 'error', listener: (error: RequestError | CacheError) => void): this; + removeAllListeners(event?: 'request' | 'response' | 'error'): this; + listeners(event: 'request'): Array<(request: ClientRequest) => void>; + listeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>; + listeners(event: 'error'): Array<(error: RequestError | CacheError) => void>; + rawListeners(event: 'request'): Array<(request: ClientRequest) => void>; + rawListeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>; + rawListeners(event: 'error'): Array<(error: RequestError | CacheError) => void>; + emit(event: 'request', request: ClientRequest): boolean; + emit(event: 'response', response: ServerResponse | ResponseLike): boolean; + emit(event: 'error', error: RequestError | CacheError): boolean; + eventNames(): Array<'request' | 'response' | 'error'>; + listenerCount(type: 'request' | 'response' | 'error'): number; + } + + type RequestError = RequestErrorCls; + type CacheError = CacheErrorCls; +} + +declare class RequestErrorCls extends Error { + readonly name: 'RequestError'; + + constructor(error: Error); +} +declare class CacheErrorCls extends Error { + readonly name: 'CacheError'; + + constructor(error: Error); +} diff --git a/types/cacheable-request/tsconfig.json b/types/cacheable-request/tsconfig.json new file mode 100644 index 0000000000..635a5b1689 --- /dev/null +++ b/types/cacheable-request/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", + "cacheable-request-tests.ts" + ] +} diff --git a/types/cacheable-request/tslint.json b/types/cacheable-request/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cacheable-request/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cached-path-relative/cached-path-relative-tests.ts b/types/cached-path-relative/cached-path-relative-tests.ts new file mode 100644 index 0000000000..22e6af97df --- /dev/null +++ b/types/cached-path-relative/cached-path-relative-tests.ts @@ -0,0 +1,7 @@ +import cachedPathRelative = require("cached-path-relative"); + +function browserifyTest() { + const file = "file.txt"; + const m1: string = cachedPathRelative("./", file).replace(/\\/g, '/'); + return m1; +} diff --git a/types/cached-path-relative/index.d.ts b/types/cached-path-relative/index.d.ts new file mode 100644 index 0000000000..b2af5ea81c --- /dev/null +++ b/types/cached-path-relative/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for cached-path-relative 1.0 +// Project: https://github.com/ashaffer/cached-path-relative +// Definitions by: TeamworkGuy2 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Memoize the results of the path.relative function. path.relative can be an expensive operation + * if it happens a lot, and its results shouldn't change for the same arguments. + * Use it just like your normal path.relative, but it's memoized. + */ +declare function cachedPathRelative(from: string, to: string): string; + +export = cachedPathRelative; diff --git a/types/cached-path-relative/tsconfig.json b/types/cached-path-relative/tsconfig.json new file mode 100644 index 0000000000..e69970c325 --- /dev/null +++ b/types/cached-path-relative/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", + "cached-path-relative-tests.ts" + ] +} \ No newline at end of file diff --git a/types/cached-path-relative/tslint.json b/types/cached-path-relative/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cached-path-relative/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cadesplugin/index.d.ts b/types/cadesplugin/index.d.ts new file mode 100644 index 0000000000..6b93a9514d --- /dev/null +++ b/types/cadesplugin/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for cadesplugin 2.1 +// Project: https://www.npmjs.com/package/cadesplugin +// Definitions by: Delagen , +// kvmi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +declare const cadesplugin: any; diff --git a/types/cadesplugin/package.json b/types/cadesplugin/package.json new file mode 100644 index 0000000000..bb80441dc0 --- /dev/null +++ b/types/cadesplugin/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { "*": ["ts3.1/*"] } + } +} diff --git a/types/cadesplugin/ts3.1/cadescom.d.ts b/types/cadesplugin/ts3.1/cadescom.d.ts new file mode 100644 index 0000000000..a721b54d97 --- /dev/null +++ b/types/cadesplugin/ts3.1/cadescom.d.ts @@ -0,0 +1,97 @@ +declare namespace CAdESCOM { + interface CPSigner { + Certificate: CAPICOM.Certificate; + CheckCertificate: boolean; + + KeyPin: string; + Options: CADES_Common.ValuesOf; + readonly SignatureTimeStampTime: CADES_Common.VarDate; + readonly SigningTime: CADES_Common.VarDate; + TSAAddress: string; + + Display(hwndParent?: number, title?: string): void; + + Load(fileName: string, password?: string): void; + } + + interface CadesSignedData { + readonly Certificates: CAPICOM.Certificates; + Content: string; + ContentEncoding: CADES_Common.ValuesOf; + + DisplayData: CADES_Common.ValuesOf; + + Display(hwndParent?: number, title?: string): void; + + EnhanceCades(cadesType?: CADES_Common.ValuesOf, TSAAddress?: string, encodingType?: CADES_Common.ValuesOf): string; + + SignCades(signer?: CPSigner, CadesType?: CADES_Common.ValuesOf, bDetached?: boolean, EncodingType?: CADES_Common.ValuesOf): string; + + VerifyCades(SignedMessage: string, CadesType?: CADES_Common.ValuesOf, bDetached?: boolean): void; + } + + interface Version { + readonly BuildVersion: number; + readonly MajorVersion: number; + readonly MinorVersion: number; + readonly toStringDefault: string; + + toString(): string; + } + + interface About { + readonly BuildVersion: number; + readonly MajorVersion: number; + readonly MinorVersion: number; + readonly PluginVersion: Version; + readonly Version: string; + + CSPName(ProviderType?: number): string; + + CSPVersion(ProviderName?: string, ProviderType?: number): Version; + + ProviderVersion(ProviderName?: string, ProviderType?: number): string; + + toString(): string; + } + + interface CPSigners { + readonly Count: number; + + Item(index: number): CPSigner; + } + + interface SignedXML { + Content: string; + DigestMethod: string; + SignatureMethod: string; + SignatureType: CADES_Common.ValuesOf; + readonly Signers: CAPICOM.Signers; + + Sign(signer?: CPSigner, XPath?: string): string; + + Verify(SignedMessage: string, XPath?: string): void; + } + + interface CPHashedData { + Algorithm: CADES_Common.ValuesOf; + DataEncoding: CADES_Common.ValuesOf; + Value: string; + + Hash(newVal: string): void; + + SetHashValue(newVal: string): void; + } + + interface CPAttribute { + Name: CADES_Common.ValuesOf; + Value: any; + ValueEncoding: CADES_Common.ValuesOf; + } + + interface RawSignature { + SignHash(hash: CPHashedData, certificate?: string): string; + + VerifyHash(hash: CPHashedData, certificate: CAPICOM.Certificate, signature: string): void; + } +} diff --git a/types/cadesplugin/ts3.1/cadescom_async.d.ts b/types/cadesplugin/ts3.1/cadescom_async.d.ts new file mode 100644 index 0000000000..94e95b2acc --- /dev/null +++ b/types/cadesplugin/ts3.1/cadescom_async.d.ts @@ -0,0 +1,57 @@ +declare namespace CAdESCOM { + interface CPSignerAsync extends CADES_Common.Async { + propset_Certificate(certificate: CAPICOM.CertificateAsync): Promise; + + propset_CheckCertificate(checkCertificate: boolean): Promise; + + propset_KeyPin(keyPin: string): Promise; + + propset_Options(options: CADES_Common.ValuesOf): Promise; + + propset_TSAAddress(TSAAddress: string): Promise; + } + + interface CadesSignedDataAsync extends CADES_Common.Async { + propset_DisplayData(displayData: CADES_Common.ValuesOf): Promise; + + propset_Content(content: string): Promise; + + propset_ContentEncoding(contentEncoding: CADES_Common.ValuesOf): Promise; + } + + interface VersionAsync extends CADES_Common.Async { + } + + interface AboutAsync extends CADES_Common.Async { + } + + interface CPSignersAsync extends CADES_Common.Async { + } + + interface SignedXMLAsync extends CADES_Common.Async { + propset_Content(content: string): Promise; + + propset_DigestMethod(digestMethod: string): Promise; + + propset_SignatureMethod(signatureMethod: string): Promise; + + propset_SignatureType(signatureType: CADES_Common.ValuesOf): Promise; + } + + interface CPHashedDataAsync extends CADES_Common.Async { + propset_Algorithm(algorithm: CADES_Common.ValuesOf): Promise; + + propset_DataEncoding(dataEncoding: CADES_Common.ValuesOf): Promise; + } + + interface CPAttributeAsync extends CADES_Common.Async { + propset_Name(name: CADES_Common.ValuesOf): Promise; + + propset_Value(value: any): Promise; + + propset_ValueEncoding(valueEncoding: CADES_Common.ValuesOf): Promise; + } + + interface RawSignatureAsync extends CADES_Common.Async { + } +} diff --git a/types/cadesplugin/ts3.1/cadescom_enums.d.ts b/types/cadesplugin/ts3.1/cadescom_enums.d.ts new file mode 100644 index 0000000000..918803a47d --- /dev/null +++ b/types/cadesplugin/ts3.1/cadescom_enums.d.ts @@ -0,0 +1,74 @@ +declare namespace CAdESCOM { + interface StoreLocationPlugin { + readonly CADESCOM_LOCAL_MACHINE_STORE: 1; + readonly CADESCOM_CURRENT_USER_STORE: 2; + readonly CADESCOM_CONTAINER_STORE: 100; + } + + interface CADESCOM_STORE_LOCATION extends StoreLocationPlugin { + readonly CADESCOM_MEMORY_STORE: 0; + readonly CADESCOM_ACTIVE_DIRECTORY_USER_STORE: 3; + readonly CADESCOM_SMART_CARD_USER_STORE: 4; + } + + interface CADESCOM_CADES_TYPE { + readonly CADESCOM_CADES_BES: 1; + readonly CADESCOM_CADES_DEFAULT: 0; + readonly CADESCOM_CADES_T: 5; + readonly CADESCOM_CADES_X_LONG_TYPE_1: 93; + } + + interface CADESCOM_CONTENT_ENCODING_TYPE { + readonly CADESCOM_BASE64_TO_BINARY: 1; + readonly CADESCOM_STRING_TO_UCS2LE: 0; + } + + interface CADESCOM_XML_SIGNATURE_TYPE { + readonly CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED: 0; + readonly CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING: 1; + readonly CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE: 2; + } + + interface CADESCOM_ENCRYPTION_ALGORITHM { + readonly CADESCOM_ENCRYPTION_ALGORITHM_RC2: 0; + readonly CADESCOM_ENCRYPTION_ALGORITHM_RC4: 1; + readonly CADESCOM_ENCRYPTION_ALGORITHM_DES: 2; + readonly CADESCOM_ENCRYPTION_ALGORITHM_3DES: 3; + readonly CADESCOM_ENCRYPTION_ALGORITHM_AES: 4; + readonly CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89: 25; + } + + interface CADESCOM_HASH_ALGORITHM { + readonly CADESCOM_HASH_ALGORITHM_SHA1: 0; + readonly CADESCOM_HASH_ALGORITHM_MD2: 1; + readonly CADESCOM_HASH_ALGORITHM_MD4: 2; + readonly CADESCOM_HASH_ALGORITHM_MD5: 3; + readonly CADESCOM_HASH_ALGORITHM_SHA_256: 4; + readonly CADESCOM_HASH_ALGORITHM_SHA_384: 5; + readonly CADESCOM_HASH_ALGORITHM_SHA_512: 6; + readonly CADESCOM_HASH_ALGORITHM_CP_GOST_3411: 100; + readonly CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256: 101; + readonly CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512: 102; + } + + interface CADESCOM_ATTRIBUTE { + readonly CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME: 0; + readonly CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME: 1; + readonly CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION: 2; + readonly CADESCOM_ATTRIBUTE_OTHER: -1; + } + + interface CADESCOM_DISPLAY_DATA { + readonly CADESCOM_DISPLAY_DATA_NONE: 0; + readonly CADESCOM_DISPLAY_DATA_CONTENT: 1; + readonly CADESCOM_DISPLAY_DATA_ATTRIBUTE: 2; + } + + interface CADESCOM_InstallResponseRestrictionFlags { + readonly CADESCOM_AllowNone: 0; + readonly CADESCOM_AllowNoOutstandingRequest: 1; + readonly CADESCOM_AllowUntrustedCertificate: 2; + readonly CADESCOM_AllowUntrustedRoot: 4; + readonly CADESCOM_SkipInstallToStore: 0x10000000; + } +} diff --git a/types/cadesplugin/ts3.1/cadesplugin-tests.ts b/types/cadesplugin/ts3.1/cadesplugin-tests.ts new file mode 100644 index 0000000000..c9784f1671 --- /dev/null +++ b/types/cadesplugin/ts3.1/cadesplugin-tests.ts @@ -0,0 +1,12 @@ +cadesplugin.then(async () => { + if ("CreateObjectAsync" in cadesplugin) { + const pluginAsync: CADESPluginAsync = cadesplugin; + const oAbout = await pluginAsync.CreateObjectAsync("CAdESCOM.About"); + const oVersion = await oAbout.CSPVersion(); + await oVersion.toString(); + } + if ("CreateObject" in cadesplugin) { + const pluginSync: CADESPluginSync = cadesplugin; + pluginSync.CreateObject("CAdESCOM.About").CSPVersion().toString(); + } +}); diff --git a/types/cadesplugin/ts3.1/cadesplugin.d.ts b/types/cadesplugin/ts3.1/cadesplugin.d.ts new file mode 100644 index 0000000000..53bba7e1bd --- /dev/null +++ b/types/cadesplugin/ts3.1/cadesplugin.d.ts @@ -0,0 +1,80 @@ +declare namespace CADES_Plugin { + interface ObjectNames { + "CAPICOM.Store": CAPICOM.Store; + "CAdESCOM.CPSigner": CAdESCOM.CPSigner; + "CAdESCOM.About": CAdESCOM.About; + "CAdESCOM.SignedXML": CAdESCOM.SignedXML; + "CAdESCOM.HashedData": CAdESCOM.CPHashedData; + "CAdESCOM.CadesSignedData": CAdESCOM.CadesSignedData; + "CAdESCOM.CPAttribute": CAdESCOM.CPAttribute; + "CAdESCOM.RawSignature": CAdESCOM.RawSignature; + } + + interface ObjectNamesAsync { + "CAdESCOM.Store": CAPICOM.StoreAsync; + "CAdESCOM.CPSigner": CAdESCOM.CPSignerAsync; + "CAdESCOM.About": CAdESCOM.AboutAsync; + "CAdESCOM.SignedXML": CAdESCOM.SignedXMLAsync; + "CAdESCOM.HashedData": CAdESCOM.CPHashedDataAsync; + "CAdESCOM.CadesSignedData": CAdESCOM.CadesSignedDataAsync; + "CAdESCOM.CPAttribute": CAdESCOM.CPAttributeAsync; + "CAdESCOM.RawSignature": CAdESCOM.RawSignatureAsync; + } + + interface LogLevel { + readonly LOG_LEVEL_DEBUG: 4; + readonly LOG_LEVEL_INFO: 2; + readonly LOG_LEVEL_ERROR: 1; + } + + interface SignedXmlUrls { + readonly XmlDsigGost3410Url: "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411"; + readonly XmlDsigGost3410UrlObsolete: "http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411"; + readonly XmlDsigGost3411Url: "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411"; + readonly XmlDsigGost3411UrlObsolete: "http://www.w3.org/2001/04/xmldsig-more#gostr3411"; + } + + interface EncodingType { + readonly CADESCOM_ENCODE_ANY: -1; + readonly CADESCOM_ENCODE_BASE64: 0; + readonly CADESCOM_ENCODE_BINARY: 1; + } +} + +interface CADESPluginBase extends Promise, + CAPICOM.StoreLocationPlugin, CAdESCOM.StoreLocationPlugin, CAPICOM.StoreNamePlugin, + CAPICOM.StoreOpenModePlugin, CAPICOM.CAPICOM_CERTIFICATE_FIND_TYPE, + CADES_Plugin.LogLevel, CAdESCOM.CADESCOM_XML_SIGNATURE_TYPE, + CADES_Plugin.SignedXmlUrls, CAdESCOM.CADESCOM_CADES_TYPE, + CADES_Plugin.EncodingType, CAPICOM.CAPICOM_CERTIFICATE_INCLUDE_OPTION, + CAPICOM.CertIntoTypePlugin, CAPICOM.KeyUsagePlugin, + CAPICOM.PropIDPlugin, CAPICOM.OIDPlugin, CAPICOM.EKUPlugin, + CAPICOM.CAPICOM_ATTRIBUTE, CAdESCOM.CADESCOM_ATTRIBUTE, + CAdESCOM.CADESCOM_CONTENT_ENCODING_TYPE, CAdESCOM.CADESCOM_DISPLAY_DATA, + CAdESCOM.CADESCOM_ENCRYPTION_ALGORITHM, CAdESCOM.CADESCOM_HASH_ALGORITHM, + CAdESCOM.CADESCOM_InstallResponseRestrictionFlags { + readonly JSModuleVersion: string; + readonly current_log_level: number; + + async_spawn(generatorFun: (...args: any[]) => Iterator): T; + + set(obj: CADESPluginBase): void; + + set_log_level(level: CADES_Common.ValuesOf): void; + + getLastError(exception: Error): string; + + is_capilite_enabled(): boolean; +} + +interface CADESPluginAsync extends CADESPluginBase { + CreateObjectAsync(objName: T): Promise; + + ReleasePluginObjects(): Promise; +} + +interface CADESPluginSync extends CADESPluginBase { + CreateObject(objName: T): CADES_Plugin.ObjectNames[T]; +} + +type CADESPlugin = CADESPluginAsync | CADESPluginSync; diff --git a/types/cadesplugin/ts3.1/capicom.d.ts b/types/cadesplugin/ts3.1/capicom.d.ts new file mode 100644 index 0000000000..02bb6f05b5 --- /dev/null +++ b/types/cadesplugin/ts3.1/capicom.d.ts @@ -0,0 +1,83 @@ +declare namespace CAPICOM { + interface EncodedData { + readonly Format: string; + + Value(EncodingType?: CAPICOM_ENCODING_TYPE): string; + } + + interface OID { + FriendlyName: string; + Name: CAPICOM_OID; + Value: string; + } + + interface PublicKey { + readonly Algorithm: OID; + readonly EncodedKey: EncodedData; + readonly EncodedParameters: EncodedData; + readonly Length: number; + } + + interface Certificate { + readonly Version: number; + readonly Thumbprint: string; + readonly SubjectName: string; + readonly SerialNumber: string; + readonly IssuerName: string; + readonly ValidFromDate: CADES_Common.VarDate; + readonly ValidToDate: CADES_Common.VarDate; + + HasPrivateKey(): boolean; + + GetInfo(infoType: CAPICOM_CERT_INFO_TYPE): string; + + IsValid(): CertificateStatus; + + Display(): void; + + PublicKey(): PublicKey; + + Export(EncodingType: CADES_Common.ValuesOf): string; + } + + interface CertificateStatus { + Result: boolean; + } + + interface Certificates { + readonly Count: number; + + Item(index: number): Certificate; + + Find(findType: CADES_Common.ValuesOf, varCriteria?: any, bFindValidOnly?: boolean): Certificates; + + Select(title?: string, displayString?: string, bMultiSelect?: boolean): Certificates; + } + + interface Store { + readonly Certificates: Certificates; + readonly Location: CADES_Common.ValuesOf; + readonly Name: string; + + Open(location?: CADES_Common.ValuesOf, name?: CADES_Common.ValuesOf, openMode?: CADES_Common.ValuesOf): void; + + Close(): void; + + Delete(): boolean; + + Import(encodedStore: string): void; + } + + interface Signers { + readonly Count: number; + + Item(index: number): Signer; + } + + interface Signer { + Certificate: Certificate; + Options: CAPICOM_CERTIFICATE_INCLUDE_OPTION; + + Load(fileName: string, password?: string): void; + } +} diff --git a/types/cadesplugin/ts3.1/capicom_async.d.ts b/types/cadesplugin/ts3.1/capicom_async.d.ts new file mode 100644 index 0000000000..5ab775aba2 --- /dev/null +++ b/types/cadesplugin/ts3.1/capicom_async.d.ts @@ -0,0 +1,19 @@ +declare namespace CAPICOM { + interface CertificateAsync extends CADES_Common.Async { + } + + interface CertificatesAsync extends CADES_Common.Async { + } + + interface StoreAsync extends CADES_Common.Async { + } + + interface EncodedDataAsync extends CADES_Common.Async { + } + + interface OIDAsync extends CADES_Common.Async { + } + + interface PublicKeyAsync extends CADES_Common.Async { + } +} diff --git a/types/cadesplugin/ts3.1/capicom_enums.d.ts b/types/cadesplugin/ts3.1/capicom_enums.d.ts new file mode 100644 index 0000000000..aada08bfe2 --- /dev/null +++ b/types/cadesplugin/ts3.1/capicom_enums.d.ts @@ -0,0 +1,226 @@ +declare namespace CAPICOM { + interface StoreLocationPlugin { + readonly CAPICOM_LOCAL_MACHINE_STORE: 1; + readonly CAPICOM_CURRENT_USER_STORE: 2; + } + + interface CAPICOM_STORE_LOCATION { + readonly CAPICOM_MEMORY_STORE: 0; + readonly CAPICOM_LOCAL_MACHINE_STORE: 1; + readonly CAPICOM_CURRENT_USER_STORE: 2; + readonly CAPICOM_ACTIVE_DIRECTORY_USER_STORE: 3; + readonly CAPICOM_SMART_CARD_USER_STORE: 4; + } + + interface StoreNamePlugin { + readonly CAPICOM_MY_STORE: "My"; + } + + interface CAPICOM_STORE_NAME extends StoreNamePlugin { + readonly CAPICOM_CA_STORE: "Ca"; + readonly CAPICOM_OTHER_STORE: "AddressBook"; + readonly CAPICOM_ROOT_STORE: "Root"; + } + + interface StoreOpenModePlugin { + readonly CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED: 2; + } + + interface CAPICOM_STORE_OPEN_MODE extends StoreOpenModePlugin { + readonly CAPICOM_STORE_OPEN_READ_ONLY: 0; + readonly CAPICOM_STORE_OPEN_READ_WRITE: 1; + readonly CAPICOM_STORE_OPEN_EXISTING_ONLY: 128; + readonly CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED: 256; + } + + interface CAPICOM_CERTIFICATE_FIND_TYPE { + readonly CAPICOM_CERTIFICATE_FIND_SHA1_HASH: 0; + readonly CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME: 1; + readonly CAPICOM_CERTIFICATE_FIND_ISSUER_NAME: 2; + readonly CAPICOM_CERTIFICATE_FIND_ROOT_NAME: 3; + readonly CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME: 4; + readonly CAPICOM_CERTIFICATE_FIND_EXTENSION: 5; + readonly CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY: 6; + readonly CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY: 7; + readonly CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY: 8; + readonly CAPICOM_CERTIFICATE_FIND_TIME_VALID: 9; + readonly CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID: 10; + readonly CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED: 11; + readonly CAPICOM_CERTIFICATE_FIND_KEY_USAGE: 12; + } + + interface CAPICOM_CERTIFICATE_INCLUDE_OPTION { + readonly CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT: 0; + readonly CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY: 2; + readonly CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN: 1; + } + + interface CertIntoTypePlugin { + readonly CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME: 0; + readonly CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME: 1; + } + + interface CAPICOM_CERT_INFO_TYPE extends CertIntoTypePlugin { + readonly CAPICOM_CERT_INFO_SUBJECT_EMAIL_NAME: 2; + readonly CAPICOM_CERT_INFO_ISSUER_EMAIL_NAME: 3; + readonly CAPICOM_CERT_INFO_SUBJECT_UPN: 4; + readonly CAPICOM_CERT_INFO_ISSUER_UPN: 5; + readonly CAPICOM_CERT_INFO_SUBJECT_DNS_NAME: 6; + readonly CAPICOM_CERT_INFO_ISSUER_DNS_NAME: 7; + } + + interface KeyUsagePlugin { + readonly CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE: 128; + } + + interface CAPICOM_KEY_USAGE extends KeyUsagePlugin { + readonly CAPICOM_NON_REPUDIATION_KEY_USAGE: 64; + readonly CAPICOM_KEY_ENCIPHERMENT_KEY_USAGE: 32; + readonly CAPICOM_DATA_ENCIPHERMENT_KEY_USAGE: 16; + readonly CAPICOM_KEY_AGREEMENT_KEY_USAGE: 8; + readonly CAPICOM_KEY_CERT_SIGN_KEY_USAGE: 4; + readonly CAPICOM_OFFLINE_CRL_SIGN_KEY_USAGE: 2; + readonly CAPICOM_CRL_SIGN_KEY_USAGE: 2; + readonly CAPICOM_ENCIPHER_ONLY_KEY_USAGE: 1; + readonly CAPICOM_DECIPHER_ONLY_KEY_USAGE: 32768; + } + + interface PropIDPlugin { + readonly CAPICOM_PROPID_ENHKEY_USAGE: 9; + } + + interface CAPICOM_PROPID extends PropIDPlugin { + readonly CAPICOM_PROPID_UNKNOWN: 0; + readonly CAPICOM_PROPID_KEY_PROV_HANDLE: 1; + readonly CAPICOM_PROPID_KEY_PROV_INFO: 2; + readonly CAPICOM_PROPID_SHA1_HASH: 3; + readonly CAPICOM_PROPID_HASH_PROP: 3; + readonly CAPICOM_PROPID_MD5_HASH: 4; + readonly CAPICOM_PROPID_KEY_CONTEXT: 5; + readonly CAPICOM_PROPID_KEY_SPEC: 6; + readonly CAPICOM_PROPID_IE30_RESERVED: 7; + readonly CAPICOM_PROPID_PUBKEY_HASH_RESERVED: 8; + readonly CAPICOM_PROPID_CTL_USAGE: 9; + readonly CAPICOM_PROPID_NEXT_UPDATE_LOCATION: 10; + readonly CAPICOM_PROPID_FRIENDLY_NAME: 11; + readonly CAPICOM_PROPID_PVK_FILE: 12; + readonly CAPICOM_PROPID_DESCRIPTION: 13; + readonly CAPICOM_PROPID_ACCESS_STATE: 14; + readonly CAPICOM_PROPID_SIGNATURE_HASH: 15; + readonly CAPICOM_PROPID_SMART_CARD_DATA: 16; + readonly CAPICOM_PROPID_EFS: 17; + readonly CAPICOM_PROPID_FORTEZZA_DATA: 18; + readonly CAPICOM_PROPID_ARCHIVED: 19; + readonly CAPICOM_PROPID_KEY_IDENTIFIER: 20; + readonly CAPICOM_PROPID_AUTO_ENROLL: 21; + readonly CAPICOM_PROPID_PUBKEY_ALG_PARA: 22; + readonly CAPICOM_PROPID_CROSS_CERT_DIST_POINTS: 23; + readonly CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH: 24; + readonly CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH: 25; + readonly CAPICOM_PROPID_ENROLLMENT: 26; + readonly CAPICOM_PROPID_DATE_STAMP: 27; + readonly CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH: 28; + readonly CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH: 29; + readonly CAPICOM_PROPID_EXTENDED_ERROR_INFO: 30; + readonly CAPICOM_PROPID_RENEWAL: 64; + readonly CAPICOM_PROPID_ARCHIVED_KEY_HASH: 65; + readonly CAPICOM_PROPID_FIRST_RESERVED: 66; + readonly CAPICOM_PROPID_LAST_RESERVED: 32767; + readonly CAPICOM_PROPID_FIRST_USER: 32768; + readonly CAPICOM_PROPID_LAST_USER: 65535; + } + + interface OIDPlugin { + readonly CAPICOM_OID_OTHER: 0; + readonly CAPICOM_OID_KEY_USAGE_EXTENSION: 10; + } + + interface CAPICOM_OID extends OIDPlugin { + readonly CAPICOM_OID_AUTHORITY_KEY_IDENTIFIER_EXTENSION: 1; + readonly CAPICOM_OID_KEY_ATTRIBUTES_EXTENSION: 2; + readonly CAPICOM_OID_CERT_POLICIES_95_EXTENSION: 3; + readonly CAPICOM_OID_KEY_USAGE_RESTRICTION_EXTENSION: 4; + readonly CAPICOM_OID_LEGACY_POLICY_MAPPINGS_EXTENSION: 5; + readonly CAPICOM_OID_SUBJECT_ALT_NAME_EXTENSION: 6; + readonly CAPICOM_OID_ISSUER_ALT_NAME_EXTENSION: 7; + readonly CAPICOM_OID_BASIC_CONSTRAINTS_EXTENSION: 8; + readonly CAPICOM_OID_SUBJECT_KEY_IDENTIFIER_EXTENSION: 9; + readonly CAPICOM_OID_PRIVATEKEY_USAGE_PERIOD_EXTENSION: 11; + readonly CAPICOM_OID_SUBJECT_ALT_NAME2_EXTENSION: 12; + readonly CAPICOM_OID_ISSUER_ALT_NAME2_EXTENSION: 13; + readonly CAPICOM_OID_BASIC_CONSTRAINTS2_EXTENSION: 14; + readonly CAPICOM_OID_NAME_CONSTRAINTS_EXTENSION: 15; + readonly CAPICOM_OID_CRL_DIST_POINTS_EXTENSION: 16; + readonly CAPICOM_OID_CERT_POLICIES_EXTENSION: 17; + readonly CAPICOM_OID_POLICY_MAPPINGS_EXTENSION: 18; + readonly CAPICOM_OID_AUTHORITY_KEY_IDENTIFIER2_EXTENSION: 19; + readonly CAPICOM_OID_POLICY_CONSTRAINTS_EXTENSION: 20; + readonly CAPICOM_OID_ENHANCED_KEY_USAGE_EXTENSION: 21; + readonly CAPICOM_OID_CERTIFICATE_TEMPLATE_EXTENSION: 22; + readonly CAPICOM_OID_APPLICATION_CERT_POLICIES_EXTENSION: 23; + readonly CAPICOM_OID_APPLICATION_POLICY_MAPPINGS_EXTENSION: 24; + readonly CAPICOM_OID_APPLICATION_POLICY_CONSTRAINTS_EXTENSION: 25; + readonly CAPICOM_OID_AUTHORITY_INFO_ACCESS_EXTENSION: 26; + readonly CAPICOM_OID_SERVER_AUTH_EKU: 100; + readonly CAPICOM_OID_CLIENT_AUTH_EKU: 101; + readonly CAPICOM_OID_CODE_SIGNING_EKU: 102; + readonly CAPICOM_OID_EMAIL_PROTECTION_EKU: 103; + readonly CAPICOM_OID_IPSEC_END_SYSTEM_EKU: 104; + readonly CAPICOM_OID_IPSEC_TUNNEL_EKU: 105; + readonly CAPICOM_OID_IPSEC_USER_EKU: 106; + readonly CAPICOM_OID_TIME_STAMPING_EKU: 107; + readonly CAPICOM_OID_CTL_USAGE_SIGNING_EKU: 108; + readonly CAPICOM_OID_TIME_STAMP_SIGNING_EKU: 109; + readonly CAPICOM_OID_SERVER_GATED_CRYPTO_EKU: 110; + readonly CAPICOM_OID_ENCRYPTING_FILE_SYSTEM_EKU: 111; + readonly CAPICOM_OID_EFS_RECOVERY_EKU: 112; + readonly CAPICOM_OID_WHQL_CRYPTO_EKU: 113; + readonly CAPICOM_OID_NT5_CRYPTO_EKU: 114; + readonly CAPICOM_OID_OEM_WHQL_CRYPTO_EKU: 115; + readonly CAPICOM_OID_EMBEDED_NT_CRYPTO_EKU: 116; + readonly CAPICOM_OID_ROOT_LIST_SIGNER_EKU: 117; + readonly CAPICOM_OID_QUALIFIED_SUBORDINATION_EKU: 118; + readonly CAPICOM_OID_KEY_RECOVERY_EKU: 119; + readonly CAPICOM_OID_DIGITAL_RIGHTS_EKU: 120; + readonly CAPICOM_OID_LICENSES_EKU: 121; + readonly CAPICOM_OID_LICENSE_SERVER_EKU: 122; + readonly CAPICOM_OID_SMART_CARD_LOGON_EKU: 123; + readonly CAPICOM_OID_PKIX_POLICY_QUALIFIER_CPS: 124; + readonly CAPICOM_OID_PKIX_POLICY_QUALIFIER_USERNOTICE: 125; + } + + interface EKUPlugin { + readonly CAPICOM_EKU_OTHER: 0; + readonly CAPICOM_EKU_CLIENT_AUTH: 2; + readonly CAPICOM_EKU_SMARTCARD_LOGON: 5; + } + + interface CAPICOM_EKU { + readonly CAPICOM_EKU_SERVER_AUTH: 1; + readonly CAPICOM_EKU_CODE_SIGNING: 3; + readonly CAPICOM_EKU_EMAIL_PROTECTION: 4; + readonly CAPICOM_EKU_ENCRYPTING_FILE_SYSTEM: 6; + } + + interface CAPICOM_ATTRIBUTE { + readonly CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME: 0; + readonly CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME: 1; + readonly CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION: 2; + } + + interface CAPICOM_HASH_ALGORITHM { + readonly CAPICOM_HASH_ALGORITHM_SHA1: 0; + readonly CAPICOM_HASH_ALGORITHM_MD2: 1; + readonly CAPICOM_HASH_ALGORITHM_MD4: 2; + readonly CAPICOM_HASH_ALGORITHM_MD5: 3; + readonly CAPICOM_HASH_ALGORITHM_SHA_256: 4; + readonly CAPICOM_HASH_ALGORITHM_SHA_384: 5; + readonly CAPICOM_HASH_ALGORITHM_SHA_512: 6; + } + + interface CAPICOM_ENCODING_TYPE { + readonly CAPICOM_ENCODE_ANY: -1; + readonly CAPICOM_ENCODE_BASE64: 0; + readonly CAPICOM_ENCODE_BINARY: 1; + } +} diff --git a/types/cadesplugin/ts3.1/common.d.ts b/types/cadesplugin/ts3.1/common.d.ts new file mode 100644 index 0000000000..315b0490a3 --- /dev/null +++ b/types/cadesplugin/ts3.1/common.d.ts @@ -0,0 +1,25 @@ +declare namespace CADES_Common { + type ValuesOf = T[keyof T]; + type VarDate = object; + + // Extracts the type if wrapped by a Promise + type Unpacked = T extends Promise ? U : + T extends CAPICOM.Certificate ? CAPICOM.CertificateAsync : + T extends CAPICOM.Certificates ? CAPICOM.CertificatesAsync : + T extends CAdESCOM.CPSigner ? CAdESCOM.CPSignerAsync : + T extends CAdESCOM.CPHashedData ? CAdESCOM.CPHashedDataAsync : + T extends CAdESCOM.Version ? CAdESCOM.VersionAsync : + T extends CAPICOM.OID ? CAPICOM.OIDAsync : + T extends CAPICOM.EncodedData ? CAPICOM.EncodedDataAsync : + T extends CAPICOM.PublicKey ? CAPICOM.PublicKeyAsync : + T; + + type PromisifiedFunction = // tslint:disable-line ban-types + T extends (...args: infer A) => infer U ? (...args: { [K in keyof A]: Unpacked }) => Promise> : + T; + + type Async = { + readonly [K in keyof T]: T[K] extends Function ? PromisifiedFunction : // tslint:disable-line ban-types + Promise>; + }; +} diff --git a/types/cadesplugin/ts3.1/index.d.ts b/types/cadesplugin/ts3.1/index.d.ts new file mode 100644 index 0000000000..13fdba4187 --- /dev/null +++ b/types/cadesplugin/ts3.1/index.d.ts @@ -0,0 +1,13 @@ +/// + +/// +/// +/// + +/// +/// +/// + +/// + +declare const cadesplugin: CADESPlugin; diff --git a/types/cadesplugin/ts3.1/tsconfig.json b/types/cadesplugin/ts3.1/tsconfig.json new file mode 100644 index 0000000000..dbc37d117b --- /dev/null +++ b/types/cadesplugin/ts3.1/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../tsconfig", + "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", + "cadesplugin-tests.ts" + ] +} diff --git a/types/cadesplugin/ts3.1/tslint.json b/types/cadesplugin/ts3.1/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/cadesplugin/ts3.1/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/cadesplugin/tsconfig.json b/types/cadesplugin/tsconfig.json new file mode 100644 index 0000000000..71e6b79545 --- /dev/null +++ b/types/cadesplugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "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" + ] +} diff --git a/types/cadesplugin/tslint.json b/types/cadesplugin/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/cadesplugin/tslint.json @@ -0,0 +1,3 @@ +{ + "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/caniuse-lite/caniuse-lite-tests.ts b/types/caniuse-lite/caniuse-lite-tests.ts new file mode 100644 index 0000000000..38b09230de --- /dev/null +++ b/types/caniuse-lite/caniuse-lite-tests.ts @@ -0,0 +1,48 @@ +import { + agents, features, feature, Agent, Feature, PackedFeature, StatsByAgentID, SupportStatusByVersion, SupportStatus +} from "caniuse-lite"; + +const chrome: Agent | undefined = agents.chrome; +if (chrome !== undefined) { + const browser: string = chrome.browser; + const prefix: string = chrome.prefix; + const prefixExceptions: any = chrome.prefix_exceptions; + const usageGlobal: { [version: string]: number | undefined } = chrome.usage_global; + const releaseDate: { [version: string]: number | undefined } = chrome.release_date; + const versions: Array = chrome.versions; + consume(browser, prefix, prefixExceptions, usageGlobal, releaseDate, versions); +} + +const unpackedFeatures = Object.keys(features).map((id: string) => { + const packed: PackedFeature = features[id]; + const unpacked: Feature = feature(packed); + + const status: string = unpacked.status; + const title: string = unpacked.title; + const stats: StatsByAgentID = unpacked.stats; + Object.keys(stats).forEach((agentID: string) => { + const byVersion: SupportStatusByVersion = stats[agentID]; + Object.keys(byVersion).forEach(version => { + const supportStatus: SupportStatus = byVersion[version]; + consume(supportStatus); + }); + + const supportStatusByVersion: SupportStatusByVersion = stats[agentID]; + const agent: Agent = agents[agentID]!; + return { + feature: unpacked, + agent, + versions: Object.keys(supportStatusByVersion).map(version => { + return { + version, + releaseDate: agent.release_date[version], + [`feature_${id}`]: supportStatusByVersion[version] + }; + }) + }; + }); +}); + +function consume(...anything: any[]): void { + // ... +} diff --git a/types/caniuse-lite/index.d.ts b/types/caniuse-lite/index.d.ts new file mode 100644 index 0000000000..ce4f91a35f --- /dev/null +++ b/types/caniuse-lite/index.d.ts @@ -0,0 +1,159 @@ +// Type definitions for caniuse-lite 1.0 +// Project: https://github.com/ben-eb/caniuse-lite#readme +// Definitions by: Michael Utech +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/** + * Information about user agents (browsers, platforms) indexed by their ID. + */ +export const agents: AgentsByID; + +/** + * Features index by their ID. The feature ID is a human readable identifier. The + * associated value is a packed version of information about the feature that + * can be unpacked using the function `feature(packed)` + */ +export const features: { [featureID: string]: PackedFeature; }; + +/** + * @param packedFeature a packed feature obtained from `features[key]` for some valid key. + * @return the unpacked information as `Feature`. + */ +export function feature(packedFeature: PackedFeature): Feature; + +/** + * @param packedRegion a packed version of regional usage data by agent OD. + * @return the unpacked usage data indexed by agent ID and then version. + */ +export function region(packedRegion: PackedRegion): { [agentID: string]: UsageByVersion }; + +/** + * Agents indexed by their ID. . + */ +export type AgentsByID = Readonly<{ [id: string]: Readonly | undefined }>; + +/** + * Feature support status by version indexed by agent ID. + */ +export type StatsByAgentID = Readonly<{ [agentID: string]: SupportStatusByVersion }>; + +/** + * Feature support status indexed by an agent's versions. + */ +export type SupportStatusByVersion = Readonly<{ [version: string]: SupportStatus }>; + +/** + * Usage (percentage/market share) indexed by an agent's versions. + */ +export type UsageByVersion = Readonly<{ [version: string]: number | undefined }>; + +/** + * The standardization status of a feature: + * * ls - WHATWG living standard + * * rec - W3C recommendation + * * pr - W3C proposed recommendation + * * cr - W3C candidate recommendation + * * wd - W3C working draft + * * other - Non-W3C, but reputable + * * unoff - Unofficial + */ +export type FeatureStatus = "ls" | "rec" | "pr" | "cr" | "wd" | "other" | "unoff" | string; + +/** + * Encoded support status: + * * `n` - not supported + * * `p` - not supported, polyfill available + * * `u` - unknown + * * `a x` - partially supported, vendor prefix + * * `a` - partially supported + * * `y x` - fully supported, vendor prefix + * * `y` - fully supported + * + * The support status can additionally have one or more footnote references as `#`, f.e. + * `a x #1 #3`. + */ +export type SupportStatus = 'n' | 'p' | 'u' | "a x" | 'a' | "y x" | 'y' | string; + +/** + * Provides information about the Agent. + */ +export interface Agent { + /** + * Global agent usage by version + */ + usage_global: UsageByVersion; + + /** + * The agents vendor prefix + */ + prefix: string; + + /** + * Version matrix. See [caniuse](https://caniuse.com) + */ + versions: [ // Tuple of 70 version slots: + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null, + string|null, string|null, string|null, string|null, string|null ]; + + /** + * The agent's name + */ + browser: string; + + /** + * Release dates as seconds since epoch by version. + */ + release_date: { [version: string]: number | undefined }; + + /** + * Exceptions to vendor prefix use. + */ + prefix_exceptions?: { [version: string]: string | undefined }; +} + +/** + * Specifies a feature and its support status in all known agent versions. + */ +export interface Feature { + /** + * Specification status of the feature. + */ + status: FeatureStatus; + + /** + * Descriptive title of the feature. + */ + title: string; + + /** + * Agent support matrix for this feature. + */ + stats: StatsByAgentID; +} + +/** + * A space optimized version of Feature that can be unpacked using `feature(PackedFeature)`. + */ +export interface PackedFeature { + [encodedKey: string]: any; +} + +/** + * A space optimized version of Region that can be unpacked using `region(PackedFeature)`. + */ +export interface PackedRegion { + [encodedKey: string]: any; +} diff --git a/types/caniuse-lite/tsconfig.json b/types/caniuse-lite/tsconfig.json new file mode 100644 index 0000000000..adcea4d555 --- /dev/null +++ b/types/caniuse-lite/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", + "caniuse-lite-tests.ts" + ] +} diff --git a/types/caniuse-lite/tslint.json b/types/caniuse-lite/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/caniuse-lite/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cassandra-driver/cassandra-driver-tests.ts b/types/cassandra-driver/cassandra-driver-tests.ts index 891c5a0167..ad8a7426fe 100644 --- a/types/cassandra-driver/cassandra-driver-tests.ts +++ b/types/cassandra-driver/cassandra-driver-tests.ts @@ -7,11 +7,15 @@ const client = new cassandra.Client({ keyspace: 'ks1', sslOptions: { cert: fs.readFileSync('certFilePath') + }, + encoding: { + map: Map, + set: Set } }); const query = 'SELECT email, last_name FROM user_profiles WHERE key=?'; -client.execute(query, ['guy'], function(err, result) { +client.execute(query, ['guy'], (err, result) => { console.log('got user profile with email ' + result.rows[0].email); }); diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index 33a9f5988f..df95e386b6 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 3.6 // Project: https://github.com/datastax/nodejs-driver // Definitions by: Marc Fisher // Christian D @@ -6,7 +6,6 @@ // TypeScript Version: 2.2 /// -/// export type Callback = Function; export type ResultCallback = (err: Error, result: types.ResultSet) => void; @@ -50,8 +49,8 @@ export namespace policies { } interface DCAwareRoundRobinPolicy extends LoadBalancingPolicy { - localHostsArray: Array; - remoteHostsArray: Array; + localHostsArray: Host[]; + remoteHostsArray: Host[]; } interface RoundRobinPolicyStatic { @@ -67,7 +66,7 @@ export namespace policies { interface TokenAwarePolicy extends LoadBalancingPolicy { } interface WhiteListPolicyStatic { - new (childPolicy: LoadBalancingPolicy, whiteList: Array): WhiteListPolicy; + new (childPolicy: LoadBalancingPolicy, whiteList: string[]): WhiteListPolicy; } interface WhiteListPolicy extends LoadBalancingPolicy { } @@ -78,7 +77,9 @@ export namespace policies { let ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic; interface ReconnectionPolicy { - newSchedule(): { next: Function }; + newSchedule(): { + next(): { delay: number; done: boolean; } + }; } interface ConstantReconnectionPolicyStatic { @@ -103,8 +104,8 @@ export namespace policies { } interface RequestInfo { - request: any, - nbRetry: number + request: any; + nbRetry: number; } enum retryDecision { @@ -133,41 +134,41 @@ export namespace policies { } namespace speculativeExecution { - let NoSpeculativeExecutionPolicy: NoSpeculativeExecutionPolicyStatic + let NoSpeculativeExecutionPolicy: NoSpeculativeExecutionPolicyStatic; interface SpeculativeExecutionPolicy { init(client: Client): void; - newPlan(keyspace: string, queryInfo: string | Array): { - nextExecution: Function - } + newPlan(keyspace: string, queryInfo: string | string[]): { + nextExecution: () => number; + }; } interface NoSpeculativeExecutionPolicyStatic { - new (): NoSpeculativeExecutionPolicy + new (): NoSpeculativeExecutionPolicy; } interface NoSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } - + interface ConstantSpeculativeExecutionPolicyStatic { - new (delay: number, maxSpeculativeExecutions: number): ConstantSpeculativeExecutionPolicy + new (delay: number, maxSpeculativeExecutions: number): ConstantSpeculativeExecutionPolicy; } interface ConstantSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } } namespace timestampGeneration { - let MonotonicTimestampGenerator: MonotonicTimestampGeneratorStatic + let MonotonicTimestampGenerator: MonotonicTimestampGeneratorStatic; interface TimestampGenerator { - next(client: Client): null | number | _Long + next(client: Client): null | number | _Long; } interface MonotonicTimestampGeneratorStatic { - new (warningThreshold?: number, minLogInterval?: number): MonotonicTimestampGeneratorStatic + new (warningThreshold?: number, minLogInterval?: number): MonotonicTimestampGeneratorStatic; } interface MonotonicTimestampGenerator extends TimestampGenerator { - getDate(): number + getDate(): number; } } } @@ -297,11 +298,11 @@ export namespace types { } interface IntegerStatic { - new (bits: Array, sign: number): Integer; + new (bits: number[], sign: number): Integer; fromInt(value: number): Integer; fromNumber(value: number): Integer; - fromBits(bits: Array): Integer; + fromBits(bits: number[]): Integer; fromString(str: string, opt_radix?: number): Integer; fromBuffer(bits: Buffer): Integer; toBuffer(value: Integer): Buffer; @@ -404,16 +405,16 @@ export namespace types { speculativeExecutions: number, achievedConsistency: consistencies, traceId: Uuid, - warnings: Array, + warnings: string[], customPayload: any }; - rows: Array; + rows: Row[]; rowLength: number; columns: Array<{ [key: string]: string; }>; pageState: string; - nextPage: Function; + nextPage: () => void; - first(): Row; + first(): Row | null; getPageState(): string; getColumns(): Array<{ [key: string]: string; }>; wasApplied(): boolean; @@ -428,7 +429,7 @@ export namespace types { buffer: Buffer; paused: boolean; - _valve(readNext: Function): void; + _valve(readNext: () => void): void; add(chunk: Buffer): void; } @@ -439,7 +440,7 @@ export namespace types { interface Row { get(columnName: string | number): { [key: string]: any; }; values(): Array<{ [key: string]: any; }>; - keys(): Array; + keys(): string[]; forEach(callback: Callback): void; [key: string]: any; } @@ -462,19 +463,19 @@ export namespace types { } interface TupleStatic { - new (...args: Array): Tuple; + new (...args: any[]): Tuple; - fromArray(elements: Array): Tuple; + fromArray(elements: any[]): Tuple; } interface Tuple { - elements: Array; + elements: any[]; length: number; get(index: number): any; toString(): string; toJSON(): string; - values(): Array; + values(): any[]; } interface UuidStatic { @@ -488,6 +489,7 @@ export namespace types { buffer: Buffer; getBuffer(): Buffer; + // tslint:disable-next-line:no-unnecessary-qualifier equals(other: types.Uuid): boolean; toString(): string; inspect(): string; @@ -501,52 +503,53 @@ export let HostMap: HostMapStatic; export let Encoder: EncoderStatic; export interface ClientOptions { - contactPoints: Array, - keyspace?: string, - refreshSchemaDelay?: number, - isMetadataSyncEnabled?: boolean, - prepareOnAllHosts?: boolean, - rePrepareOnUp?: boolean, - maxPrepared?: number, + contactPoints: string[]; + keyspace?: string; + refreshSchemaDelay?: number; + isMetadataSyncEnabled?: boolean; + prepareOnAllHosts?: boolean; + rePrepareOnUp?: boolean; + maxPrepared?: number; policies?: { - loadBalancing?: policies.loadBalancing.LoadBalancingPolicy, - retry?: policies.retry.RetryPolicy, - reconnection?: policies.reconnection.ReconnectionPolicy, - addressResolution?: policies.addressResolution.AddressTranslator, - speculativeExecution?: policies.speculativeExecution.SpeculativeExecutionPolicy, - timestampGeneration?: policies.timestampGeneration.TimestampGenerator, - }, - queryOptions?: QueryOptions, + loadBalancing?: policies.loadBalancing.LoadBalancingPolicy; + retry?: policies.retry.RetryPolicy; + reconnection?: policies.reconnection.ReconnectionPolicy; + addressResolution?: policies.addressResolution.AddressTranslator; + speculativeExecution?: policies.speculativeExecution.SpeculativeExecutionPolicy; + timestampGeneration?: policies.timestampGeneration.TimestampGenerator; + }; + queryOptions?: QueryOptions; pooling?: { - heartBeatInterval?: number, - coreConnectionsPerHost?: { [key: number]: number; }, - maxRequestsPerConnection?: number, + heartBeatInterval?: number; + coreConnectionsPerHost?: { [key: number]: number; }; + maxRequestsPerConnection?: number; warmup?: boolean; - }, + }; protocolOptions?: { - port?: number, - maxSchemaAgreementWaitSeconds?: number, - maxVersion?: number - }, + port?: number; + maxSchemaAgreementWaitSeconds?: number; + maxVersion?: number; + noCompact?: boolean; + }; socketOptions?: { - connectTimeout?: number, - defunctReadTimeoutThreshold?: number, - keepAlive?: boolean, - keepAliveDelay?: number, - readTimeout?: number, - tcpNoDelay?: boolean, - coalescingThreshold?: number - }, - authProvider?: auth.AuthProvider, - sslOptions?: tls.ConnectionOptions, + connectTimeout?: number; + defunctReadTimeoutThreshold?: number; + keepAlive?: boolean; + keepAliveDelay?: number; + readTimeout?: number; + tcpNoDelay?: boolean; + coalescingThreshold?: number; + }; + authProvider?: auth.AuthProvider; + sslOptions?: tls.ConnectionOptions; encoding?: { - map?: Function, - set?: Function, - copyBuffer?: boolean, - useUndefinedAsUnset?: boolean - }, - profiles?: Array, - promiseFactory?: Function, + map?: typeof Map | ((...args: any[]) => any); + set?: typeof Set | ((...args: any[]) => any); + copyBuffer?: boolean; + useUndefinedAsUnset?: boolean; + }; + profiles?: ExecutionProfile[]; + promiseFactory?: (handler: (callback: (err?: any, result?: any) => void) => void) => Promise; } export interface QueryOptions { @@ -556,7 +559,7 @@ export interface QueryOptions { customPayload?: any; executionProfile?: string | ExecutionProfile; fetchSize?: number; - hints?: Array | Array>; + hints?: string[] | string[][]; isIdempotent?: boolean; keyspace?: string; logged?: boolean; @@ -565,12 +568,13 @@ export interface QueryOptions { readTimeout?: number; retry?: policies.retry.RetryPolicy; retryOnTimeout?: boolean; - routingIndexes?: Array; - routingKey?: Buffer | Array; - routingNames?: Array; + routingIndexes?: number[]; + routingKey?: Buffer | Buffer[]; + routingNames?: string[]; serialConsistency?: number; timestamp?: number | _Long; traceQuery?: boolean; + host?: Host; } export interface ClientStatic { @@ -582,9 +586,9 @@ export interface Client extends events.EventEmitter { keyspace: string; metadata: metadata.Metadata; - batch(queries: Array | Array<{ query: string, params?: any }>, options: QueryOptions, callback: ResultCallback): void; - batch(queries: Array | Array<{ query: string, params?: any }>, callback: ResultCallback): void; - batch(queries: Array | Array<{ query: string, params?: any }>, options?: QueryOptions): Promise; + batch(queries: string[] | Array<{ query: string, params?: any }>, options: QueryOptions, callback: ResultCallback): void; + batch(queries: string[] | Array<{ query: string, params?: any }>, callback: ResultCallback): void; + batch(queries: string[] | Array<{ query: string, params?: any }>, options?: QueryOptions): Promise; connect(callback: Callback): void; connect(): Promise; @@ -593,7 +597,7 @@ export interface Client extends events.EventEmitter { execute(query: string, params: any, callback: ResultCallback): void; execute(query: string, callback: ResultCallback): void; execute(query: string, params?: any, options?: QueryOptions): Promise; - getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return? + getReplicas(keyspace: string, token: Buffer): any[]; // TODO: Should this be a more explicit return? getState(): metadata.ClientState; shutdown(callback?: Callback): void; shutdown(): Promise; @@ -609,10 +613,10 @@ export interface Host extends events.EventEmitter { cassandraVersion: string; dataCenter: string; rack: string; - tokens: Array; + tokens: string[]; canBeConsideredAsUp(): boolean; - getCassandraVersion(): Array; + getCassandraVersion(): number[]; isUp(): boolean; } @@ -623,14 +627,14 @@ export interface HostMapStatic { export interface HostMap extends events.EventEmitter { length: number; - clear(): Array; + clear(): Host[]; forEach(callback: Callback): void; get(key: string): Host; - keys(): Array; + keys(): string[]; remove(key: string): void; - removeMultiple(keys: Array): void; + removeMultiple(keys: string[]): void; set(key: string, value: Host): void; - values(): Array; + values(): Host[]; } export interface EncoderStatic { @@ -642,21 +646,20 @@ export interface Encoder { encode(value: any, typeInfo?: string | number | { code: number, info?: any }): Buffer; } -interface ExecutionProfileOptions { - consistency: number, - loadBalancing: policies.loadBalancing.LoadBalancingPolicy, - name: string, - readTimeout: number, - retry: policies.retry.RetryPolicy, - serialConsistency: number +export interface ExecutionProfileOptions { + consistency: number; + loadBalancing: policies.loadBalancing.LoadBalancingPolicy; + name: string; + readTimeout: number; + retry: policies.retry.RetryPolicy; + serialConsistency: number; } export interface ExecutionProfileStatic { - new (name: string, options: ExecutionProfileOptions): ExecutionProfile + new (name: string, options: ExecutionProfileOptions): ExecutionProfile; } -export interface ExecutionProfile extends ExecutionProfileOptions { -} +export interface ExecutionProfile extends ExecutionProfileOptions {} export namespace auth { let Authenticator: AuthenticatorStatic; @@ -686,8 +689,10 @@ export namespace auth { } export namespace errors { - abstract class DriverError { + abstract class DriverError extends Error { constructor(message: string, constructor?: any); + + info: string; } class ArgumentError extends DriverError { @@ -704,16 +709,28 @@ export namespace errors { class NoHostAvailableError extends DriverError { constructor(innerErrors: any, message?: string); + + innerErrors: any; } class NotSupportedError extends DriverError { constructor(message: string); } - class OperationTimedOutError extends DriverError { } + class OperationTimedOutError extends DriverError { + constructor(message: string, host?: string); + + host?: string; + } class ResponseError extends DriverError { constructor(code: number, message: string); + + code: number; + } + + class BusyConnectionError extends DriverError { + constructor(address: string, maxRequestsPerConnection: number, connectionLength: number); } } @@ -735,44 +752,44 @@ export namespace metadata { argumentTypes: Array<{ code: number, info: any }>; finalFunction: string; initCondition: string; - keyspaceName: string, + keyspaceName: string; returnType: string; - signature: Array; + signature: string[]; stateFunction: string; stateType: string; } - + interface ClientStateStatic { new (): ClientState; } - + interface ClientState { - getConnectedHosts(): Array; + getConnectedHosts(): Host[]; getInFlightQueries(host: Host): number; getOpenConnections(host: Host): number; toString(): string; } interface DataTypeInfo { - code: number, - info: string | DataTypeInfo | Array, + code: number; + info: string | DataTypeInfo | DataTypeInfo[]; options: { - frozen: boolean, - reversed: boolean - } + frozen: boolean; + reversed: boolean; + }; } interface ColumnInfo { - name: string, - type: DataTypeInfo + name: string; + type: DataTypeInfo; } interface DataCollection { bloomFilterFalsePositiveChance: number; caching: caching; clusterKeys: Array<{ c: ColumnInfo, index: number, order: string }>; - clusteringOrder: Array; - columns: Array; + clusteringOrder: string[]; + columns: ColumnInfo[]; columnsByName: { [key: string]: ColumnInfo }; comment: string; compactionClass: string; @@ -786,7 +803,7 @@ export namespace metadata { maxIndexInterval?: number; minIndexInterval?: number; name: string; - partitionKeys: Array<{ c: ColumnInfo, index: number }> + partitionKeys: Array<{ c: ColumnInfo, index: number }>; populateCacheOnFlush: boolean; readRepairChance: number; speculateRetry: string; @@ -799,16 +816,16 @@ export namespace metadata { } interface IndexStatic { - new (name: string, target: string, kind: IndexType, options: Object): Index; + new (name: string, target: string, kind: string | IndexType, options: object): Index; - fromRows(indexRows: Array): Array; - fromColumnRows(columnRows: Array, columnsByName: { [key: string]: ColumnInfo }): Array; + fromRows(indexRows: types.Row[]): Index[]; + fromColumnRows(columnRows: types.Row[], columnsByName: { [key: string]: ColumnInfo }): Index[]; } interface Index { kind: IndexType; name: string; - options: Object; + options: object; target: string; isCompositesKind(): boolean; @@ -829,12 +846,12 @@ export namespace metadata { interface Metadata { clearPrepared(): void; - getAggregate(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void; + getAggregate(keyspaceName: string, name: string, signature: string[] | Array<{ code: number, info: any }>, callback: Callback): void; getAggregates(keyspaceName: string, name: string, callback: Callback): void; - getFunction(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void; + getFunction(keyspaceName: string, name: string, signature: string[] | Array<{ code: number, info: any }>, callback: Callback): void; getFunctions(keyspaceName: string, name: string, callback: Callback): void; getMaterializedView(keyspaceName: string, name: string, callback: Callback): void; - getReplicas(keyspaceName: string, tokenBuffer: Buffer): Array; + getReplicas(keyspaceName: string, tokenBuffer: Buffer): any[]; getTable(keyspaceName: string, name: string, callback: Callback): void; getTrace(traceId: types.Uuid, callback: Callback): void; getUdt(keyspaceName: string, name: string, callback: Callback): void; @@ -847,15 +864,15 @@ export namespace metadata { } interface SchemaFunction { - argumentNames: Array; + argumentNames: string[]; argumentTypes: Array<{ code: number, info: any }>; body: string; calledOnNullInput: boolean; - keyspaceName: string, + keyspaceName: string; language: string; name: string; returnType: string; - signature: Array; + signature: string[]; } interface TableMetadataStatic { @@ -863,10 +880,12 @@ export namespace metadata { } interface TableMetadata extends DataCollection { - indexes: Array; + indexes: Index[]; indexInterval?: number; isCompact: boolean; memtableFlushPeriod: number; replicateOnWrite: boolean; + cdc?: boolean; + virtual: boolean; } } diff --git a/types/cassandra-driver/tsconfig.json b/types/cassandra-driver/tsconfig.json index e47bfd4444..59e0316c6a 100644 --- a/types/cassandra-driver/tsconfig.json +++ b/types/cassandra-driver/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "cassandra-driver-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/cassandra-driver/tslint.json b/types/cassandra-driver/tslint.json index a41bf5d19a..ec0272c64c 100644 --- a/types/cassandra-driver/tslint.json +++ b/types/cassandra-driver/tslint.json @@ -1,79 +1,8 @@ { "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-misused-new": false } } 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..bd41889e07 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,71 @@ export interface ClientOptions { partition: string; } +export type PolicyOptionVariants = PolicyOptions | DecoratedPolicyOptions; + +export type Id = string | { id: string }; + /** - * 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: Id): 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: Id, 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: Id): Promise; + /** + * given a created timestamp in milliseconds, returns the time-to-live left + * based on the configured rules. */ - 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. */ + /** 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 +192,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 +222,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 | undefined; +} + export interface GenerateFuncFlags { ttl: number; } @@ -262,7 +249,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: Id, flags: GenerateFuncFlags) => Promise; /** * An object with logging information about the generation operation containing the following keys (as relevant): diff --git a/types/cfn-response/cfn-response-tests.ts b/types/cfn-response/cfn-response-tests.ts new file mode 100644 index 0000000000..b9633c17aa --- /dev/null +++ b/types/cfn-response/cfn-response-tests.ts @@ -0,0 +1,12 @@ +import * as cfn from "cfn-response"; +import { CloudFormationCustomResourceEvent, Context } from "aws-lambda"; + +declare const event: CloudFormationCustomResourceEvent; +declare const context: Context; + +// $ExpectType void +cfn.send(event, context, cfn.SUCCESS, { sample: 123 }, "abc"); +// $ExpectType void +cfn.send(event, context, "SUCCESS"); +// $ExpectError +cfn.send(event, context, "", {}); diff --git a/types/cfn-response/index.d.ts b/types/cfn-response/index.d.ts new file mode 100644 index 0000000000..54cb63dfef --- /dev/null +++ b/types/cfn-response/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for cfn-response 1.0 +// Project: https://github.com/LukeMizuhashi/cfn-response +// Definitions by: Ivo Murrell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { CloudFormationCustomResourceEvent, Context } from "aws-lambda"; + +export type ResponseStatus = "SUCCESS" | "FAILED"; +export const SUCCESS: ResponseStatus; +export const FAILED: ResponseStatus; + +export function send( + event: CloudFormationCustomResourceEvent, + context: Context, + responseStatus: ResponseStatus, + responseData?: object, + physicalResourceId?: string +): void; diff --git a/types/cfn-response/tsconfig.json b/types/cfn-response/tsconfig.json new file mode 100644 index 0000000000..0aff9f9071 --- /dev/null +++ b/types/cfn-response/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", + "cfn-response-tests.ts" + ] +} diff --git a/types/cfn-response/tslint.json b/types/cfn-response/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cfn-response/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chai-almost/chai-almost-tests.ts b/types/chai-almost/chai-almost-tests.ts new file mode 100644 index 0000000000..07e84f7a62 --- /dev/null +++ b/types/chai-almost/chai-almost-tests.ts @@ -0,0 +1,32 @@ +import { expect, use } from 'chai'; +import chaiAlmost = require('chai-almost'); + +// Normally, call use(chaiAlmost(...)) only once, this is just to check that TypeScript correctly handles both. +use(chaiAlmost(0.01)); // custom tolerance 0.01 +use(chaiAlmost()); // default tolerance 1e-6 (= 0.000001) + +expect(1.0000001).to.almost.equal(1); +expect(1.0000001).to.be.almost(1); +expect(1.0000001).almost.equals(1); + +expect(1.0001).to.not.almost.equal(1); +expect(1.0001).to.not.be.almost(1); +expect(1.0001).not.almost.equals(1); + +// Note the "not" in the following. +// Use deep equality checks to compare values inside of arrays and objects. +expect([1]).to.not.be.almost([1]); + +const arrA = [1, [{ num: 2, name: "Douglas" }, 3]]; +const arrB = [1.0000001, [{ num: 1.9999999, name: "Douglas" }, 2.9999996]]; + +expect(arrA).to.deep.almost.equal(arrB); +expect(arrA).to.be.deep.almost(arrB); +expect(arrA).deep.almost.equals(arrB); +expect(arrA).to.almost.eql(arrB); +expect(arrA).to.be.almost.eql(arrB); +expect(arrA).almost.eqls(arrB); + +expect(1.001).to.be.almost(1, 0.01); +expect(1.001).to.not.be.almost(1, 0.0001); +expect([42]).to.be.deep.almost([42.3145], 0.5); diff --git a/types/chai-almost/index.d.ts b/types/chai-almost/index.d.ts new file mode 100644 index 0000000000..2f7a3ffdc7 --- /dev/null +++ b/types/chai-almost/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for chai-almost 1.0 +// Project: https://github.com/nmuldavin/chai-almost#readme +// Definitions by: Lennard Schulz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare global { + namespace Chai { + interface Assertion { + almost: ChaiAlmost.Almost; + } + interface Deep { + almost: ChaiAlmost.DeepAlmost; + } + + namespace ChaiAlmost { + interface DeepAlmost { + (value: any, toleranceOverride?: number): Assertion; + equal: Equal; + equals: Equal; + eq: Equal; + } + interface Almost extends DeepAlmost { + eql: Equal; + eqls: Equal; + } + } + } +} + +declare function chaiAlmost(tolerance?: number): ((chai: any, utils: any) => void); +export = chaiAlmost; diff --git a/types/chai-almost/tsconfig.json b/types/chai-almost/tsconfig.json new file mode 100644 index 0000000000..e97d3ea722 --- /dev/null +++ b/types/chai-almost/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-almost-tests.ts" + ] +} diff --git a/types/chai-almost/tslint.json b/types/chai-almost/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-almost/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/babel__parser/package.json b/types/chai-webdriverio/package.json similarity index 56% rename from types/babel__parser/package.json rename to types/chai-webdriverio/package.json index c2ca8a8f9b..cd495fe983 100644 --- a/types/babel__parser/package.json +++ b/types/chai-webdriverio/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0-beta.54" + "@types/webdriverio": "^4.0.0" } } diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts index ae8a71766e..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 { diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index 72ebc0191d..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 { @@ -235,7 +235,7 @@ declare namespace Chai { interface Keys { (...keys: string[]): Assertion; - (keys: any[]|Object): Assertion; + (keys: ReadonlyArray|Object): Assertion; } interface Throw { @@ -252,7 +252,7 @@ declare namespace Chai { } interface Members { - (set: any[], message?: string): Assertion; + (set: ReadonlyArray, message?: string): Assertion; } interface PropertyChange { @@ -696,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. @@ -705,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. @@ -732,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/chalk-animation/chalk-animation-tests.ts b/types/chalk-animation/chalk-animation-tests.ts new file mode 100644 index 0000000000..e2f12e58b3 --- /dev/null +++ b/types/chalk-animation/chalk-animation-tests.ts @@ -0,0 +1,21 @@ +import * as chalkAnimation from 'chalk-animation'; + +const rainbow: chalkAnimation.Animation = chalkAnimation.rainbow('Lorem ipsum dolor sit amet'); +chalkAnimation.rainbow('Lorem ipsum dolor sit amet', 2); +chalkAnimation.pulse('Lorem ipsum dolor sit amet'); +chalkAnimation.pulse('Lorem ipsum dolor sit amet', 2); +chalkAnimation.glitch('Lorem ipsum dolor sit amet'); +chalkAnimation.glitch('Lorem ipsum dolor sit amet', 2); +chalkAnimation.radar('Lorem ipsum dolor sit amet'); +chalkAnimation.radar('Lorem ipsum dolor sit amet', 2); +chalkAnimation.neon('Lorem ipsum dolor sit amet'); +chalkAnimation.neon('Lorem ipsum dolor sit amet', 2); +chalkAnimation.karaoke('Lorem ipsum dolor sit amet'); +chalkAnimation.karaoke('Lorem ipsum dolor sit amet', 2); + +rainbow.stop(); +rainbow.start(); +rainbow.replace('.'); +rainbow.render(); +// $ExpectType string +rainbow.frame(); diff --git a/types/chalk-animation/index.d.ts b/types/chalk-animation/index.d.ts new file mode 100644 index 0000000000..9f08617bb3 --- /dev/null +++ b/types/chalk-animation/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for chalk-animation 1.6 +// Project: https://github.com/bokub/chalk-animation +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export const rainbow: AnimationFn; +export const pulse: AnimationFn; +export const glitch: AnimationFn; +export const radar: AnimationFn; +export const neon: AnimationFn; +export const karaoke: AnimationFn; + +export type AnimationFn = (text: string, speed?: number) => Animation; + +export interface Animation { + start(): void; + stop(): void; + replace(text: string): void; + render(): void; + frame(): string; +} diff --git a/types/chalk-animation/tsconfig.json b/types/chalk-animation/tsconfig.json new file mode 100644 index 0000000000..bf580a6e70 --- /dev/null +++ b/types/chalk-animation/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", + "chalk-animation-tests.ts" + ] +} diff --git a/types/chalk-animation/tslint.json b/types/chalk-animation/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chalk-animation/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 41ab453e0f..e35c556b56 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -9,7 +9,9 @@ const plugin = { } }; -const chart: Chart = new Chart(new CanvasRenderingContext2D(), { +const ctx = new CanvasRenderingContext2D(); + +const chart: Chart = new Chart(ctx, { type: "bar", plugins: [plugin, plugin], data: { @@ -17,9 +19,11 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { datasets: [ { backgroundColor: "#000000", + hoverBackgroundColor: ctx.createLinearGradient(0, 0, 0, 100), + hoverBorderColor: ctx.createLinearGradient(0, 0, 0, 100), borderWidth: 1, label: "test", - data: [1] + data: [1, null, 3] } ] }, @@ -36,6 +40,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, @@ -66,7 +71,11 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { padding: 40 } }, - devicePixelRatio: 2 + devicePixelRatio: 2, + plugins: { + bar: false, + foo: {} + } } }); chart.update(); @@ -125,6 +134,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 f779cdc57d..8e795ed77c 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; @@ -283,8 +284,7 @@ declare namespace Chart { circumference?: number; rotation?: number; devicePixelRatio?: number; - // Plugins can require any options - plugins?: { [pluginId: string]: any }; + plugins?: ChartPluginsOptions; } interface ChartFontOptions { @@ -331,7 +331,7 @@ declare namespace Chart { interface ChartTooltipOptions { enabled?: boolean; custom?(a: any): void; - mode?: string; + mode?: InteractionMode; intersect?: boolean; backgroundColor?: ChartColor; titleFontFamily?: string; @@ -366,6 +366,12 @@ declare namespace Chart { borderWidth?: number; } + // NOTE: declare plugin options as interface instead of inline '{ [plugin: string]: any }' + // to allow module augmentation in case some plugins want to strictly type their options. + interface ChartPluginsOptions { + [pluginId: string]: any; + } + interface ChartTooltipsStaticConfiguration { positioners: { [mode: string]: ChartTooltipPositioner }; } @@ -373,7 +379,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 +485,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; @@ -526,6 +537,7 @@ declare namespace Chart { interface LinearTickOptions extends TickOptions { maxTicksLimit?: number; stepSize?: number; + precision?: number; suggestedMin?: number; suggestedMax?: number; } @@ -541,15 +553,15 @@ 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[]; + hoverBackgroundColor?: ChartColor | ChartColor[]; + hoverBorderColor?: ChartColor | ChartColor[]; hoverBorderWidth?: number | number[]; label?: string; lineTension?: number; @@ -566,7 +578,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..863fdb33be 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) => { @@ -484,3 +485,53 @@ new Chartist.Candle('.ct-chart', { } } }); + + +// Create a simple bar chart and line chart with two dimensional arrays +new Chartist.Bar('.ct-chart', { + labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], + series: [ + [ + {value: 1}, + {value: 2}, + {value: 3}, + {value: 4}, + {value: 5}, + {value: 6}, + {value: 7} + ], + [ + {value: 7}, + {value: 6}, + {value: 5}, + {value: 4}, + {value: 3}, + {value: 2}, + {value: 1} + ] + ] +}, {}) + +new Chartist.Line('.ct-chart', { + labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], + series: [ + [ + {value: 1}, + {value: 2}, + {value: 3}, + {value: 4}, + {value: 5}, + {value: 6}, + {value: 7} + ], + [ + {value: 7}, + {value: 6}, + {value: 5}, + {value: 4}, + {value: 3}, + {value: 2}, + {value: 1} + ] + ] +}, {}) diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index 3d72210c73..8d700703c9 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -93,7 +93,7 @@ declare namespace Chartist { // TODO: come in and tidy this up and make it fit better interface IChartistData { labels?: Array | Array | Array; - series: Array | Array> | Array | Array>; + series: Array | Array> | Array> | Array | Array>; } interface IChartistSeriesData { @@ -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/cheerio/index.d.ts b/types/cheerio/index.d.ts index cb8031705e..6c893021a3 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Cheerio v0.22.0 // Project: https://github.com/cheeriojs/cheerio -// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao , Chennakrishna +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao , Chennakrishna , AzSiAz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Cheerio { @@ -111,9 +111,8 @@ interface Cheerio { eq(index: number): Cheerio; - get(): string[]; - get(): CheerioElement[]; - get(index: number): CheerioElement; + get(): any[]; + get(index: number): any; index(): number; index(selector: string): number; 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 f1709dd31a..d9027a8801 100644 --- a/types/chroma-js/chroma-js-tests.ts +++ b/types/chroma-js/chroma-js-tests.ts @@ -110,6 +110,9 @@ function test_color() { chroma('teal').alpha(0.5).css(); chroma('teal').css('hsl'); chroma('orange').rgb(); + chroma('orange').rgb(true); + chroma('orange').rgba(); + chroma('orange').rgba(true); chroma('#000000').num(); chroma('#0000ff').num(); diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index 162a318dc8..b73f572371 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -21,6 +21,8 @@ declare namespace chroma { gl: [number, number, number, number]; } + type InterpolationMode = "rgb" | "hsl" | "hsv" | "hsi" | "lab" | "lch" | "hcl"; + interface ChromaStatic { /** * Creates a color from a string representation (as supported in CSS). @@ -209,7 +211,7 @@ declare namespace chroma { css(col: string): Color; } - type Color = { + interface Color { /** * Get and set the color opacity. */ @@ -300,9 +302,109 @@ declare namespace chroma { * chroma('#ff0000').num() === 16711680 */ num(): number; - } & { - [K in keyof ColorSpaces]: () => ColorSpaces[K]; - }; + + /** + * Returns an array with the red, green, and blue component, each as + * number within the range 0..255. Chroma internally stores RGB + * channels as floats but rounds the numbers before returning them. + * You can pass false to prevent the rounding. + * + * @example + * chroma('orange').rgb() === [255,165,0] + * chroma('orange').darken().rgb() === [198,118,0] + * chroma('orange').darken().rgb(false) === [198.05,118.11,0] + */ + rgb: (round?: boolean) => ColorSpaces['rgb']; + + /** + * Just like color.rgb but adds the alpha channel to the returned array. + * + * @example + * chroma('orange').rgba() === [255,165,0,1] + * chroma('hsla(20, 100%, 40%, 0.5)').rgba() === [204,68,0,0.5] + */ + rgba: (round?: boolean) => ColorSpaces['rgba']; + + /** + * Returns an array with the `hue`, `saturation`, and `lightness` + * component. Hue is the color angle in degree (`0..360`), saturation + * and lightness are within `0..1`. Note that for hue-less colors + * (black, white, and grays), the hue component will be NaN. + * + * @example + * chroma('orange').hsl() === [38.82,1,0.5,1] + * chroma('white').hsl() === [NaN,0,1,1] + */ + hsl: () => ColorSpaces['hsl']; + + /** + * Returns an array with the `hue`, `saturation`, and `value` + * components. Hue is the color angle in degree (`0..360`), + * saturation and value are within `0..1`. Note that for hue-less + * colors (black, white, and grays), the hue component will be NaN. + * + * @example + * chroma('orange').hsv() === [38.82,1,1] + * chroma('white').hsv() === [NaN,0,1] + */ + hsv: () => ColorSpaces['hsv']; + + /** + * Returns an array with the `hue`, `saturation`, and `intensity` + * components, each as number between 0 and 255. Note that for hue-less + * colors (black, white, and grays), the hue component will be NaN. + * + * @example + * chroma('orange').hsi() === [39.64,1,0.55] + * chroma('white').hsi() === [NaN,0,1] + */ + hsi: () => ColorSpaces['hsi']; + + /** + * Returns an array with the **L**, **a**, and **b** components. + * + * @example + * chroma('orange').lab() === [74.94,23.93,78.95] + */ + lab: () => ColorSpaces['lab']; + + /** + * Returns an array with the **Lightness**, **chroma**, and **hue** + * components. + * + * @example + * chroma('skyblue').lch() === [79.21,25.94,235.11] + */ + lch: () => ColorSpaces['lch']; + + /** + * Alias of [lch](#color-lch), but with the components in reverse + * order. + * + * @example + * chroma('skyblue').hcl() === [235.11,25.94,79.21] + */ + hcl: () => ColorSpaces['hcl']; + + /** + * Just like color.rgb but adds the alpha channel to the returned + * array. + * + * @example + * chroma('orange').rgba() === [255,165,0,1] + * chroma('hsla(20, 100%, 40%, 0.5)').rgba() === [204,68,0,0.5] + */ + cmyk: () => ColorSpaces['cmyk']; + + /** + * Returns an array with the cyan, magenta, yellow, and key (black) + * components, each as a normalized value between 0 and 1. + * + * @example + * chroma('33cc00').gl() === [0.2,0.8,0,1] + */ + gl: () => ColorSpaces['gl']; + } interface Scale { (c: string[]): Scale; @@ -311,7 +413,7 @@ declare namespace chroma { domain(d?: number[], n?: number, mode?: string): this; - mode(mode: keyof ColorSpaces): this; + mode(mode: InterpolationMode): this; gamma(g: number): this; diff --git a/types/chrome-apps/index.d.ts b/types/chrome-apps/index.d.ts index 33b760ce82..c947a8d12c 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, @@ -13235,7 +13274,7 @@ interface HTMLElement { /** * ❗ Unprefixed version are not available as of Chrome 68, in Chrome apps ❗ */ - requestFullscreen(): void; + requestFullscreen(): Promise; /** * ❗ Unprefixed version are not available as of Chrome 68, in Chrome apps ❗ */ diff --git a/types/chrome-apps/test/index.ts b/types/chrome-apps/test/index.ts index 93864d107b..6dbbabc263 100644 --- a/types/chrome-apps/test/index.ts +++ b/types/chrome-apps/test/index.ts @@ -917,7 +917,7 @@ chrome.app.runtime.onLaunched.addListener(() => { // #region chrome.gcm -const gcmMessage = {}; +const gcmMessage = {} as chrome.gcm.OutgoingMessage; gcmMessage.data = { /*goog: 'any', should not be allowed, and it is not :) */ test: true @@ -1078,8 +1078,7 @@ chrome.networking.config.finishAuthentication(filter.HexSSID || '', 'rejected'); // #region chrome.networking.onc const TLSFormatExample = { - NetworkConfigurations: - { + NetworkConfigurations: { GUID: '{00f79111-51e0-e6e0-76b3b55450d80a1b}', Name: 'MyTTLSNetwork', Type: 'WiFi', @@ -1103,7 +1102,7 @@ const TLSFormatExample = { 'SSID': 'MyTTLSNetwork', 'Security': 'WPA-EAP' } - } + } as chrome.networking.onc.NetworkConfigProperties } chrome.networking.onc.getNetworks({ 'networkType': 'All' }, (networkList) => { @@ -1114,6 +1113,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 +1124,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; + } + } + }); } }); @@ -1998,5 +2011,8 @@ appview.connect('id of app'); document.appendChild(appview); //#endregion +// #region HTMLElement correctly subtypes Element in TS3.1. +const htmlElement = document.querySelector('zzzzzz') as HTMLElement; +//#endregion diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 49f079e159..528ab91be7 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Chrome extension development // Project: http://developer.chrome.com/extensions/ -// Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 +// Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 , MatCarlson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -762,6 +762,9 @@ declare namespace chrome.commands { * Permissions: "contentSettings" */ declare namespace chrome.contentSettings { + + type ScopeEnum = 'regular' | 'incognito_session_only'; + export interface ClearDetails { /** * Optional. @@ -770,7 +773,7 @@ declare namespace chrome.contentSettings { * * regular: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere), * * incognito_session_only: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings). */ - scope?: string; + scope?: ScopeEnum; } export interface SetDetails { @@ -781,11 +784,63 @@ declare namespace chrome.contentSettings { /** Optional. The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see Content Setting Patterns. */ secondaryPattern?: string; /** Optional. Where to set the setting (default: regular). */ - scope?: string; + scope?: ScopeEnum; /** The pattern for the primary URL. For details on the format of a pattern, see Content Setting Patterns. */ primaryPattern: string; } + export interface CookieSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'session_only'; + } + + export interface ImagesSetDetails extends SetDetails { + setting: 'allow' | 'block'; + } + + export interface JavascriptSetDetails extends SetDetails { + setting: 'allow' | 'block'; + } + + export interface LocationSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface PluginsSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'detect_important_content'; + } + + export interface PopupsSetDetails extends SetDetails { + setting: 'allow' | 'block'; + } + + export interface NotificationsSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface FullscreenSetDetails extends SetDetails { + setting: 'allow'; + } + + export interface MouselockSetDetails extends SetDetails { + setting: 'allow'; + } + + export interface MicrophoneSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface CameraSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface PpapiBrokerSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface MultipleAutomaticDownloadsSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + export interface GetDetails { /** Optional. The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs. */ secondaryUrl?: string; @@ -829,6 +884,58 @@ declare namespace chrome.contentSettings { get(details: GetDetails, callback: (details: ReturnedDetails) => void): void; } + export interface CookieContentSetting extends ContentSetting{ + set(details: CookieSetDetails, callback?: () => void): void; + } + + export interface PopupsContentSetting extends ContentSetting{ + set(details: PopupsSetDetails, callback?: () => void): void; + } + + export interface JavascriptContentSetting extends ContentSetting{ + set(details: JavascriptSetDetails, callback?: () => void): void; + } + + export interface NotificationsContentSetting extends ContentSetting{ + set(details: NotificationsSetDetails, callback?: () => void): void; + } + + export interface PluginsContentSetting extends ContentSetting{ + set(details: PluginsSetDetails, callback?: () => void): void; + } + + export interface ImagesContentSetting extends ContentSetting{ + set(details: ImagesSetDetails, callback?: () => void): void; + } + + export interface LocationContentSetting extends ContentSetting{ + set(details: LocationSetDetails, callback?: () => void): void; + } + + export interface FullscreenContentSetting extends ContentSetting{ + set(details: FullscreenSetDetails, callback?: () => void): void; + } + + export interface MouselockContentSetting extends ContentSetting{ + set(details: MouselockSetDetails, callback?: () => void): void; + } + + export interface MicrophoneContentSetting extends ContentSetting{ + set(details: MicrophoneSetDetails, callback?: () => void): void; + } + + export interface CameraContentSetting extends ContentSetting{ + set(details: CameraSetDetails, callback?: () => void): void; + } + + export interface PpapiBrokerContentSetting extends ContentSetting{ + set(details: PpapiBrokerSetDetails, callback?: () => void): void; + } + + export interface MultipleAutomaticDownloadsContentSetting extends ContentSetting{ + set(details: MultipleAutomaticDownloadsSetDetails, callback?: () => void): void; + } + /** The only content type using resource identifiers is contentSettings.plugins. For more information, see Resource Identifiers. */ export interface ResourceIdentifier { /** The resource identifier for the given content type. */ @@ -845,7 +952,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame. */ - export var cookies: ContentSetting; + export var cookies: CookieContentSetting; /** * Whether to allow sites to show pop-ups. One of * allow: Allow sites to show pop-ups, @@ -853,7 +960,7 @@ declare namespace chrome.contentSettings { * Default is block. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var popups: ContentSetting; + export var popups: PopupsContentSetting; /** * Whether to run JavaScript. One of * allow: Run JavaScript, @@ -861,7 +968,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var javascript: ContentSetting; + export var javascript: JavascriptContentSetting; /** * Whether to allow sites to show desktop notifications. One of * allow: Allow sites to show desktop notifications, @@ -870,7 +977,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used. */ - export var notifications: ContentSetting; + export var notifications: NotificationsContentSetting; /** * Whether to run plugins. One of * allow: Run plugins automatically, @@ -879,7 +986,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var plugins: ContentSetting; + export var plugins: PluginsContentSetting; /** * Whether to show images. One of * allow: Show images, @@ -887,7 +994,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image. */ - export var images: ContentSetting; + export var images: ImagesContentSetting; /** * Since Chrome 42. * Whether to allow Geolocation. One of @@ -897,7 +1004,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). */ - export var location: ContentSetting; + export var location: LocationContentSetting; /** * Since Chrome 42. * Whether to allow sites to toggle the fullscreen mode. One of @@ -906,7 +1013,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). */ - export var fullscreen: ContentSetting; + export var fullscreen: FullscreenContentSetting; /** * Since Chrome 42. * Whether to allow sites to disable the mouse cursor. One of @@ -916,7 +1023,29 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var mouselock: ContentSetting; + export var mouselock: MouselockContentSetting; + /** + * Since Chrome 46. + * Whether to allow sites to access the microphone. One of + * allow: Allow sites to access the microphone, + * block: Don't allow sites to access the microphone, + * ask: Ask when a site wants to access the microphone. + * Default is ask. + * The primary URL is the URL of the document which requested microphone access. The secondary URL is not used. + * NOTE: The 'allow' setting is not valid if both patterns are ''. + */ + export var microphone: MicrophoneContentSetting; + /** + * Since Chrome 46. + * Whether to allow sites to access the camera. One of + * allow: Allow sites to access the camera, + * block: Don't allow sites to access the camera, + * ask: Ask when a site wants to access the camera. + * Default is ask. + * The primary URL is the URL of the document which requested camera access. The secondary URL is not used. + * NOTE: The 'allow' setting is not valid if both patterns are ''. + */ + export var camera: CameraContentSetting; /** * Since Chrome 42. * Whether to allow sites to run plugins unsandboxed. One of @@ -926,7 +1055,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var unsandboxedPlugins: ContentSetting; + export var unsandboxedPlugins: PpapiBrokerContentSetting; /** * Since Chrome 42. * Whether to allow sites to download multiple files automatically. One of @@ -936,7 +1065,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var automaticDownloads: ContentSetting; + export var automaticDownloads: MultipleAutomaticDownloadsContentSetting; } //////////////////// @@ -966,6 +1095,13 @@ declare namespace chrome.contextMenus { * The ID of the menu item that was clicked. */ menuItemId: any; + /** + * Optional. + * Since Chrome 35. + * The ID of the frame of the element where the context menu was + * clicked, if it was in a frame. + */ + frameId?: number; /** * Optional. * Since Chrome 35. @@ -1048,6 +1184,12 @@ declare namespace chrome.contextMenus { * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. */ id?: string; + /** + * Optional. + * Since Chrome 62. + * Whether the item is visible in the menu. + */ + visible?: boolean; } export interface UpdateProperties { @@ -4447,7 +4589,10 @@ declare namespace chrome.omnibox { description: string; } - export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> { } + /** The window disposition for the omnibox query. This is the recommended context to display results. */ + export type OnInputEnteredDisposition = 'currentTab' | 'newForegroundTab' | 'newBackgroundTab'; + + export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string, disposition: OnInputEnteredDisposition) => void> { } export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> { } @@ -4455,6 +4600,8 @@ declare namespace chrome.omnibox { export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> { } + export interface OmniboxSuggestionDeletedEvent extends chrome.events.Event<(text: string) => void> { } + /** * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar. * @param suggestion A partial SuggestResult object, without the 'content' parameter. @@ -4469,6 +4616,11 @@ declare namespace chrome.omnibox { export var onInputStarted: OmniboxInputStartedEvent; /** User has ended the keyword input session without accepting the input. */ export var onInputCancelled: OmniboxInputCancelledEvent; + /** + * User has deleted a suggested result + * @since Chrome 63. + */ + export var onDeleteSuggestion: OmniboxSuggestionDeletedEvent; } //////////////////// @@ -4525,12 +4677,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/chromecast-caf-receiver/cast.framework.breaks.d.ts b/types/chromecast-caf-receiver/cast.framework.breaks.d.ts index 21adf13fb0..bce1d6b71d 100644 --- a/types/chromecast-caf-receiver/cast.framework.breaks.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.breaks.d.ts @@ -1,92 +1,89 @@ import { Break, BreakClip } from "./cast.framework.messages"; -export = cast.framework.breaks; +export as namespace breaks +export class BreakSeekData { + constructor(seekFrom: number, seekTo: number, breaks: Break[]); -declare namespace cast.framework.breaks { - class BreakSeekData { - constructor(seekFrom: number, seekTo: number, breaks: Break[]); + /** + * List of breaks + */ + breaks: Break[]; - /** - * List of breaks - */ - breaks: Break[]; + /** + * Current playback time + */ + seekFrom: number; - /** - * Current playback time - */ - seekFrom: number; - - /** - * The time to seek to - */ - seekTo: number; - } - - /** Provide context information for break clip load interceptor. */ - class BreakClipLoadInterceptorContext { - constructor(brk: Break); - - /** - * The container break for the break clip - */ - break: Break; - } - - /** Interface to manage breaks */ - interface BreakManager { - /** - * Get current media break by id. - */ - getBreakById(id: string): Break; - - /** - * Get current media break clip by id - */ - getBreakClipById(id: string): BreakClip; - - /** Get current media break clips. */ - getBreakClips(): BreakClip[]; - - /** Get current media breaks. */ - getBreaks(): Break[]; - - /** Returns true if watched breaks should be played. */ - getPlayWatchedBreak(): boolean; - - /** - * Provide an interceptor to allow developer to insert more break clips or modify current break clip before a break is started. - * If interceptor is null it will reset the interceptor to default one. - * By default VAST fetching and parsing logic in default interceptor. - * So if customized interceptor is set by developer; - * the VAST logic will be overridden and developers should implement their own VAST fetching and parsing logic in the provided interceptor. - */ - setBreakClipLoadInterceptor( - interceptor: ( - breakClip: BreakClip, - breakClipLoaderContext?: BreakClipLoadInterceptorContext - ) => void - ): void; - - /** - * Provide an interceptor for developer to specify what breaks they want to play after seek. - */ - setBreakSeekInterceptor( - seekInterceptor: (breakSeekData: BreakSeekData) => void - ): void; - - /** - * Set a flag to control if the watched client stitching break should be played. - */ - setPlayWatchedBreak(playWatchedBreak: boolean): void; - - /** - * Provide an interceptor to modify VAST tracking URL before it is being sent to server. - * The input of the interceptor is a string of the tracking URL. - * The interceptor can either return a modified string of URL or a Promise of modified string of URL. - * The interceptor can also return null if you want to send the tracking URL by your own code instead of by CAF. - */ - setVastTrackingInterceptor( - interceptor?: (trackingUrl: string) => void - ): void; - } + /** + * The time to seek to + */ + seekTo: number; +} + +/** Provide context information for break clip load interceptor. */ +export class BreakClipLoadInterceptorContext { + constructor(brk: Break); + + /** + * The container break for the break clip + */ + break: Break; +} + +/** Interface to manage breaks */ +export interface BreakManager { + /** + * Get current media break by id. + */ + getBreakById(id: string): Break; + + /** + * Get current media break clip by id + */ + getBreakClipById(id: string): BreakClip; + + /** Get current media break clips. */ + getBreakClips(): BreakClip[]; + + /** Get current media breaks. */ + getBreaks(): Break[]; + + /** Returns true if watched breaks should be played. */ + getPlayWatchedBreak(): boolean; + + /** + * Provide an interceptor to allow developer to insert more break clips or modify current break clip before a break is started. + * If interceptor is null it will reset the interceptor to default one. + * By default VAST fetching and parsing logic in default interceptor. + * So if customized interceptor is set by developer; + * the VAST logic will be overridden and developers should implement their own VAST fetching and parsing logic in the provided interceptor. + */ + setBreakClipLoadInterceptor( + interceptor: ( + breakClip: BreakClip, + breakClipLoaderContext?: BreakClipLoadInterceptorContext + ) => void + ): void; + + /** + * Provide an interceptor for developer to specify what breaks they want to play after seek. + */ + setBreakSeekInterceptor( + seekInterceptor: (breakSeekData: BreakSeekData) => void + ): void; + + /** + * Set a flag to control if the watched client stitching break should be played. + */ + setPlayWatchedBreak(playWatchedBreak: boolean): void; + + /** + * Provide an interceptor to modify VAST tracking URL before it is being sent to server. + * The input of the interceptor is a string of the tracking URL. + * The interceptor can either return a modified string of URL or a Promise of modified string of URL. + * The interceptor can also return null if you want to send the tracking URL by your own code instead of by CAF. + */ + setVastTrackingInterceptor( + interceptor?: (trackingUrl: string) => void + ): void; } diff --git a/types/chromecast-caf-receiver/cast.framework.d.ts b/types/chromecast-caf-receiver/cast.framework.d.ts index 28b0c69e2d..13d2e52ce0 100644 --- a/types/chromecast-caf-receiver/cast.framework.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.d.ts @@ -1,783 +1,764 @@ -import { EventType } from "./cast.framework.events"; -import { - PlayerState, - PlayStringId, - ErrorType, - ErrorReason, - IdleReason, - MessageType, - Track, - TextTrackStyle, - QueueItem, - LoadRequestData, - QueueData, - Break, - LiveSeekableRange, - MediaInformation, - ErrorData, - RequestData -} from "./cast.framework.messages"; -import { BreakManager } from "./cast.framework.breaks"; -import { EventHandler, RequestHandler, BinaryHandler } from "./index"; -import { - EventType as SystemEventType, - ApplicationData, - Sender, - StandbyState, - SystemState -} from "./cast.framework.system"; +import * as breaks from "./cast.framework.breaks"; +import * as events from "./cast.framework.events"; +import * as messages from "./cast.framework.messages"; +import * as system from "./cast.framework.system"; +import * as ui from "./cast.framework.ui"; -export = cast.framework; -type HTMLMediaElement = any; -declare namespace cast.framework { - type LoggerLevel = - | "DEBUG" - | "VERBOSE" - | "INFO" - | "WARNING" - | "ERROR" - | "NONE"; +export import breaks = breaks; +export import events = events; +export import ui = ui; +export import system = system; +export import messages = messages; - type ContentProtection = "NONE" | "CLEARKEY" | "PLAYREADY" | "WIDEVINE"; +export type HTMLMediaElement = any; +export as namespace framework +export type LoggerLevel = + | "DEBUG" + | "VERBOSE" + | "INFO" + | "WARNING" + | "ERROR" + | "NONE"; + +export type ContentProtection = "NONE" | "CLEARKEY" | "PLAYREADY" | "WIDEVINE"; + +/** + * Manages text tracks. + */ +export class TextTracksManager { + constructor(params?: any); /** - * Manages text tracks. + * Adds text tracks to the list. */ - class TextTracksManager { - constructor(params?: any); - - /** - * Adds text tracks to the list. - */ - addTracks(tracks: Track[]): void; - - /** - * Creates a text track. - */ - createTrack(): Track; - - /** - * Gets all active text ids. - */ - getActiveIds(): number[]; - - /** - * Gets all active text tracks. - */ - getActiveTracks(): Track[]; - - /** - * Returns the current text track style. - */ - getTextTracksStyle(): TextTrackStyle; - - /** - * Gets text track by id. - */ - getTrackById(id: number): Track; - - /** - * Returns all text tracks. - */ - getTracks(): Track[]; - - /** - * Gets text tracks by language. - */ - getTracksByLanguage(language: string): Track[]; - - /** - * Sets text tracks to be active by id. - */ - setActiveByIds(newIds: number[]): void; - - /** - * Sets text tracks to be active by language. - */ - setActiveByLanguage(language: string): void; - - /** - * Sets text track style. - */ - setTextTrackStyle(style: TextTrackStyle): void; - } + addTracks(tracks: messages.Track[]): void; /** - * QueueManager exposes several queue manipulation APIs to developers. + * Creates a text track. */ - class QueueManager { - constructor(params?: any); - - /** - * Returns the current queue item. - */ - getCurrentItem(): QueueItem; - - /** - * Returns the index of the current queue item. - */ - getCurrentItemIndex(): number; - - /** - * Returns the queue items. - */ - getItems(): QueueItem[]; - - /** - * Inserts items into the queue. - */ - insertItems(items: QueueItem[], insertBefore?: number): void; - - /** - * Removes items from the queue. - */ - removeItems(itemIds: number[]): void; - - /** - * Sets whether to limit the number of queue items to be reported in Media Status (default is true). - */ - setQueueStatusLimit(limitQueueItemsInStatus: boolean): void; - - /** - * Updates existing queue items by matching itemId. - */ - updateItems(items: QueueItem[]): void; - } + createTrack(): messages.Track; /** - * Base implementation of a queue. + * Gets all active text ids. */ - class QueueBase { - /** - * Fetches a window of items using the specified item id as reference; called by the receiver MediaManager when it needs more queue items; - * often as a request from senders. If only one of nextCount and prevCount is non-zero; fetchItems should only return items after or before - * the reference item; if both nextCount and prevCount are non-zero; a window of items including the reference item should be returned. - */ - fetchItems( - itemId: number, - nextCount: number, - prevCount: number - ): QueueItem[] | Promise; - - /** - * Initializes the queue with the requestData. This is called when a new LOAD request comes in to the receiver. - * If this returns or resolves to null; our default queueing implementation will create a queue based on queueData.items or the single media - * in the load request data. - */ - initialize( - requestData: LoadRequestData - ): QueueData | Promise; - - /** - * Returns next items after the reference item; often the end of the current queue; called by the receiver MediaManager. - */ - nextItems(itemId?: number): QueueItem[] | Promise; - - /** - * Sets the current item with the itemId; called by the receiver MediaManager when it changes the current playing item. - */ - onCurrentItemIdChanged(itemId: number): void; - - /** - * A callback for informing the following items have been inserted into the receiver queue in this session. - * A cloud based implementation can optionally choose to update its queue based on the new information. - */ - onItemsInserted(items: QueueItem[], insertBefore?: number): void; - - /** - * A callback for informing the following items have been removed from the receiver queue in this session. - * A cloud based implementation can optionally choose to update its queue based on the new information. - */ - onItemsRemoved(itemIds: number[]): void; - - /** - * Returns previous items before the reference item; often at the beginning of the queue; called by the receiver MediaManager. - */ - prevItems(itemId?: number): QueueItem[] | Promise; - - /** - * Shuffles the queue and returns new queue items. Returns null if the operation is not supported. - */ - shuffle(): QueueItem[] | Promise; - } + getActiveIds(): number[]; /** - * Controls and monitors media playback. + * Gets all active text tracks. */ - class PlayerManager { - constructor(params?: any); - - /** - * Adds an event listener for player event. - */ - addEventListener: ( - eventType: EventType | EventType[], - eventListener: EventHandler - ) => void; - - /** - * Sends a media status message to all senders (broadcast). Applications use this to send a custom state change. - */ - broadcastStatus( - includeMedia?: boolean, - requestId?: number, - customData?: any, - includeQueueItems?: boolean - ): void; - - getAudioTracksManager(): AudioTracksManager; - - /** - * Returns current time in sec in currently-playing break clip. - */ - getBreakClipCurrentTimeSec(): number; - - /** - * Returns duration in sec of currently-playing break clip. - */ - getBreakClipDurationSec(): number; - - /** - * Obtain the breaks (Ads) manager. - */ - getBreakManager(): BreakManager; - - /** - * Returns list of breaks. - */ - getBreaks(): Break[]; - - /** - * Gets current time in sec of current media. - */ - getCurrentTimeSec(): number; - - /** - * Gets duration in sec of currently playing media. - */ - getDurationSec(): number; - - /** - * Returns live seekable range with start and end time in seconds. The values are media time based. - */ - getLiveSeekableRange(): LiveSeekableRange; - - /** - * Gets media information of current media. - */ - getMediaInformation(): MediaInformation; - - /** - * Returns playback configuration. - */ - getPlaybackConfig(): PlaybackConfig; - - /** - * Returns current playback rate. - */ - getPlaybackRate(): number; - - /** - * Gets player state. - */ - getPlayerState(): PlayerState; - - /** - * Get the preferred playback rate. (Can be used on shutdown event to save latest preferred playback rate to a persistent storage; - * so it can be used in next session in the cast options). - */ - getPreferredPlaybackRate(): number; - - /** - * Get the preferred text track language. - */ - getPreferredTextLanguage(): string; - - /** - * Obtain QueueManager API. - */ - getQueueManager(): QueueManager; - - getTextTracksManager(): TextTracksManager; - - /** - * Loads media. - */ - load(loadRequest: LoadRequestData): Promise; - - /** - * Pauses currently playing media. - */ - pause(): void; - - /** - * Plays currently paused media. - */ - play(): void; - - /** - * Requests a text string to be played back locally on the receiver device. - */ - playString(stringId: PlayStringId, args?: string[]): Promise; - - /** - * Request Google Assistant to refresh the credentials. Only works if the original credentials came from the assistant. - */ - refreshCredentials(): Promise; - - /** - * Removes the event listener added for given player event. If event listener is not added; it will be ignored. - */ - removeEventListener( - eventType: EventType | EventType[], - eventListener: EventHandler - ): void; - - /** - * Seeks in current media. - */ - seek(seekTime: number): void; - - /** - * Sends an error to a specific sender - */ - sendError( - senderId: string, - requestId: number, - type: ErrorType, - reason?: ErrorReason, - customData?: any - ): void; - - /** - * Send local media request. - */ - sendLocalMediaRequest(request: RequestData): void; - - /** - * Sends a media status message to a specific sender. - */ - sendStatus( - senderId: string, - requestId: number, - includeMedia?: boolean, - customData?: any, - includeQueueItems?: boolean - ): void; - - /** - * Sets the IDLE reason. This allows applications that want to force the IDLE state to indicate the reason that made the player going to IDLE state - * (a custom error; for example). The idle reason will be sent in the next status message. NOTE: Most applications do not need to set this value; - * it is only needed if they want to make the player go to IDLE in special circumstances and the default idleReason does not reflect their intended - * behavior. - */ - setIdleReason(idleReason: IdleReason): void; - - /** - * Sets MediaElement to use. If Promise of MediaElement is set; media begins playback after Promise is resolved. - */ - setMediaElement(mediaElement: HTMLMediaElement): void; - - /** - * Sets media information. - */ - setMediaInformation( - mediaInformation: MediaInformation, - opt_broadcast?: boolean - ): void; - - /** - * Sets a handler to return or modify PlaybackConfig; for a specific load request. The handler paramaters are the load request data - * and default playback config for the receiver (provided in the context options). The handler should returns a modified playback config; - * or null to prevent the media from playing. The return value can be a promise to allow waiting for data from the server. - */ - setMediaPlaybackInfoHandler( - handler: ( - loadRequestData: LoadRequestData, - playbackConfig: PlaybackConfig - ) => void - ): void; - - /** - * Sets a handler to return the media url for a load request. This handler can be used to avoid having the media content url published as part - * of the media status. By default the media contentId is used as the content url. - */ - setMediaUrlResolver( - resolver: (loadRequestData: LoadRequestData) => void - ): void; - - /** - * Provide an interceptor of incoming and outgoing messages. - * The interceptor can update the request data; and return updated data; a promise of - * updated data if need to get more data from the server; or null if the request should not be handled. - * Note that if load message interceptor is provided; and no interceptor is provided for preload - - * the load interceptor will be called for preload messages. - */ - setMessageInterceptor( - type: MessageType, - interceptor: (requestData: RequestData) => Promise - ): void; - - /** - * Sets playback configuration on the PlayerManager. - */ - setPlaybackConfig(playbackConfig: PlaybackConfig): void; - - /** - * Set the preferred playback rate for follow up load or media items. The preferred playback rate will be updated automatically to the latest - * playback rate that was provided by a load request or explicit set of playback rate. - */ - setPreferredPlaybackRate(preferredPlaybackRate: number): void; - - /** - * Set the preferred text track language. The preferred text track language will be updated automatically to the latest enabled language - * by a load request or explicit change to text tracks. (Should be called only in idle state; and Will only apply to next loaded media). - */ - setPreferredTextLanguage(preferredTextLanguage: string): void; - - /** - * Stops currently playing media. - */ - stop(): void; - } + getActiveTracks(): messages.Track[]; /** - * Configuration to customize playback behavior. + * Returns the current text track style. */ - class PlaybackConfig { - /** - * Duration of buffered media in seconds to start buffering. - */ - autoPauseDuration?: number; + getTextTracksStyle(): messages.TextTrackStyle; - /** - * Duration of buffered media in seconds to start/resume playback after auto-paused due to buffering. - */ - autoResumeDuration?: number; - - /** - * Minimum number of buffered segments to start/resume playback. - */ - autoResumeNumberOfSegments?: number; - - /** - * A function to customize request to get a caption segment. - */ - captionsRequestHandler?: RequestHandler; - - /** - * Initial bandwidth in bits in per second. - */ - initialBandwidth?: number; - - /** - * Custom license data. - */ - licenseCustomData?: string; - - /** - * Handler to process license data. The handler is passed the license data; and returns the modified license data. - */ - licenseHandler?: BinaryHandler; - - /** - * A function to customize request to get a license. - */ - licenseRequestHandler?: RequestHandler; - - /** - * Url for acquiring the license. - */ - licenseUrl?: string; - - /** - * Handler to process manifest data. The handler is passed the manifest; and returns the modified manifest. - */ - manifestHandler?: (manifest: string) => string; - - /** - * A function to customize request to get a manifest. - */ - manifestRequestHandler?: RequestHandler; - - /** - * Preferred protection system to use for decrypting content. - */ - protectionSystem: ContentProtection; - - /** - * Handler to process segment data. The handler is passed the segment data; and returns the modified segment data. - */ - segmentHandler?: BinaryHandler; - - /** - * A function to customize request information to get a media segment. - */ - segmentRequestHandler?: RequestHandler; - - /** - * Maximum number of times to retry a network request for a segment. - */ - segmentRequestRetryLimit?: number; - } /** - * HTTP(s) Request/Response information. + * Gets text track by id. */ - class NetworkRequestInfo { - /** - * The content of the request. Can be used to modify license request body. - */ - content: Uint8Array; + getTrackById(id: number): messages.Track; - /** - * An object containing properties that you would like to send in the header. - */ - headers: any; + /** + * Returns all text tracks. + */ + getTracks(): messages.Track[]; - /** - * The URL requested. - */ - url: string; + /** + * Gets text tracks by language. + */ + getTracksByLanguage(language: string): messages.Track[]; - /** - * Indicates whether CORS Access-Control requests should be made using credentials such as cookies or authorization headers. - */ - withCredentials: boolean; - } - /** Cast receiver context options. All options are optionals. */ - class CastReceiverOptions { - /** - * Optional map of custom messages namespaces to initialize and their types. - * Custom messages namespaces need to be initiated before the application started; - * so it is best to provide the namespaces in the receiver options. - * (The default type of a message bus is JSON; if not provided here). - */ - customNamespaces?: any; + /** + * Sets text tracks to be active by id. + */ + setActiveByIds(newIds: number[]): void; - /** - * Sender id used for local requests. Default value is 'local'. - */ - localSenderId?: string; + /** + * Sets text tracks to be active by language. + */ + setActiveByLanguage(language: string): void; - /** - * Maximum time in seconds before closing an idle sender connection. - * Setting this value enables a heartbeat message to keep the connection alive. - * Used to detect unresponsive senders faster than typical TCP timeouts. - * The minimum value is 5 seconds; there is no upper bound enforced but practically it's minutes before platform TCP timeouts come into play. - * Default value is 10 seconds. - */ - maxInactivity?: number; - - /** - * Optional media element to play content with. Default behavior is to use the first found media element in the page. - */ - mediaElement?: HTMLMediaElement; - - /** - * Optional playback configuration. - */ - playbackConfig?: PlaybackConfig; - - /** - * If this is true; the watched client stitching break will also be played. - */ - playWatchedBreak?: boolean; - - /** - * Preferred value for player playback rate. It is used if playback rate value is not provided in the load request. - */ - preferredPlaybackRate?: number; - - /** - * Preferred text track language. It is used if no active track is provided in the load request. - */ - preferredTextLanguage?: string; - - /** - * Optional queue implementation. - */ - queue?: QueueBase; - - /** - * Text that represents the application status. - * It should meet internationalization rules as may be displayed by the sender application. - */ - statusText?: string; - - /** - * A bitmask of media commands supported by the application. - * LOAD; PLAY; STOP; GET_STATUS must always be supported. - * If this value is not provided; then PAUSE; SEEK; STREAM_VOLUME; STREAM_MUTE are assumed to be supported too. - */ - supportedCommands?: number; - - /** - * Indicate that MPL should be used for DASH content. - */ - useLegacyDashSupport?: boolean; - - /** - * An integer used as an internal version number. - * This number is used only to distinguish between receiver releases and higher numbers do not necessarily have to represent newer releases. - */ - versionCode?: number; - } - - /** Manages loading of underlying libraries and initializes underlying cast receiver SDK. */ - class CastReceiverContext { - /** Returns the CastReceiverContext singleton instance. */ - static getInstance(): CastReceiverContext; - - constructor(params: any); - - /** - * Sets message listener on custom message channel. - */ - addCustomMessageListener( - namespace: string, - listener: EventHandler - ): void; - - /** - * Add listener to cast system events. - */ - addEventListener( - type: SystemEventType | SystemEventType[], - handler: EventHandler - ): void; - - /** - * Checks if the given media params of video or audio streams are supported by the platform. - */ - canDisplayType( - mimeType: string, - codecs?: string, - width?: number, - height?: number, - framerate?: number - ): boolean; - - /** - * Provides application information once the system is ready; otherwise it will be null. - */ - getApplicationData(): ApplicationData; - - /** - * Provides device capabilities information once the system is ready; otherwise it will be null. - * If an empty object is returned; the device does not expose any capabilities information. - */ - getDeviceCapabilities(): any; - - /** - * Get Player instance that can control and monitor media playback. - */ - getPlayerManager(): PlayerManager; - - /** - * Get a sender by sender id - */ - getSender(senderId: string): Sender; - - /** - * Gets a list of currently-connected senders. - */ - getSenders(): Sender[]; - - /** - * Reports if the cast application's HDMI input is in standby. - */ - getStandbyState(): StandbyState; - - /** - * Provides application information about the system state. - */ - getSystemState(): SystemState; - - /** - * Reports if the cast application is the HDMI active input. - */ - getVisibilityState(): any; - - /** - * When the application calls start; the system will send the ready event to indicate - * that the application information is ready and the application can send messages as soon as there is one sender connected. - */ - isSystemReady(): boolean; - - /** - * Start loading player js. This can be used to start loading the players js code in early stage of starting the receiver before calling start. - * This function is a no-op if players were already loaded (start was called). - */ - loadPlayerLibraries(useLegacyDashSupport?: boolean): void; - - /** - * Remove a message listener on custom message channel. - */ - removeCustomMessageListener( - namespace: string, - listener: EventHandler - ): void; - - /** - * Remove listener to cast system events. - */ - removeEventListener(type: EventType, handler: EventHandler): void; - - /** - * Sends a message to a specific sender. - */ - sendCustomMessage( - namespace: string, - senderId: string, - message: any - ): void; - - /** - * This function should be called in response to the feedbackstarted event if the application - * add debug state information to log in the feedback report. - * It takes in a parameter ‘message’ that is a string that represents the debug information that the application wants to log. - */ - sendFeedbackMessage(feedbackMessage: string): void; - - /** - * Sets the application state. The application should call this when its state changes. - * If undefined or set to an empty string; the value of the Application Name established during application - * registration is used for the application state by default. - */ - setApplicationState(statusText: string): void; - - /** - * Sets the receiver inactivity timeout. - * It is recommended to set the maximum inactivity value when calling Start and not changing it. - * This API is just provided for development/debugging purposes. - */ - setInactivityTimeout(maxInactivity: number): void; - - /** - * Sets the log verbosity level. - */ - setLoggerLevel(level: LoggerLevel): void; - - /** - * Initializes system manager and media manager; so that receiver app can receive requests from senders. - */ - start(options?: CastReceiverOptions): CastReceiverContext; - - /** - * Shutdown receiver application. - */ - stop(): void; - } - - /** Manages audio tracks. */ - class AudioTracksManager { - constructor(params: any); - getActiveId(): number; - getActiveTrack(): Track; - getTrackById(id: number): Track; - getTracks(): Track[]; - getTracksByLanguage(language: string): Track[]; - setActiveById(id: number): void; - setActiveByLanguage(language: string): void; - } + /** + * Sets text track style. + */ + setTextTrackStyle(style: messages.TextTrackStyle): void; +} + +/** + * QueueManager exposes several queue manipulation APIs to developers. + */ +export class QueueManager { + constructor(params?: any); + + /** + * Returns the current queue item. + */ + getCurrentItem(): messages.QueueItem; + + /** + * Returns the index of the current queue item. + */ + getCurrentItemIndex(): number; + + /** + * Returns the queue items. + */ + getItems(): messages.QueueItem[]; + + /** + * Inserts items into the queue. + */ + insertItems(items: messages.QueueItem[], insertBefore?: number): void; + + /** + * Removes items from the queue. + */ + removeItems(itemIds: number[]): void; + + /** + * Sets whether to limit the number of queue items to be reported in Media Status (default is true). + */ + setQueueStatusLimit(limitQueueItemsInStatus: boolean): void; + + /** + * Updates existing queue items by matching itemId. + */ + updateItems(items: messages.QueueItem[]): void; +} + +/** + * Base implementation of a queue. + */ +export class QueueBase { + /** + * Fetches a window of items using the specified item id as reference; called by the receiver MediaManager when it needs more queue items; + * often as a request from senders. If only one of nextCount and prevCount is non-zero; fetchItems should only return items after or before + * the reference item; if both nextCount and prevCount are non-zero; a window of items including the reference item should be returned. + */ + fetchItems( + itemId: number, + nextCount: number, + prevCount: number + ): messages.QueueItem[] | Promise; + + /** + * Initializes the queue with the requestData. This is called when a new LOAD request comes in to the receiver. + * If this returns or resolves to null; our default queueing implementation will create a queue based on queueData.items or the single media + * in the load request data. + */ + initialize( + requestData: messages.LoadRequestData + ): messages.QueueData | Promise; + + /** + * Returns next items after the reference item; often the end of the current queue; called by the receiver MediaManager. + */ + nextItems(itemId?: number): messages.QueueItem[] | Promise; + + /** + * Sets the current item with the itemId; called by the receiver MediaManager when it changes the current playing item. + */ + onCurrentItemIdChanged(itemId: number): void; + + /** + * A callback for informing the following items have been inserted into the receiver queue in this session. + * A cloud based implementation can optionally choose to update its queue based on the new information. + */ + onItemsInserted(items: messages.QueueItem[], insertBefore?: number): void; + + /** + * A callback for informing the following items have been removed from the receiver queue in this session. + * A cloud based implementation can optionally choose to update its queue based on the new information. + */ + onItemsRemoved(itemIds: number[]): void; + + /** + * Returns previous items before the reference item; often at the beginning of the queue; called by the receiver MediaManager. + */ + prevItems(itemId?: number): messages.QueueItem[] | Promise; + + /** + * Shuffles the queue and returns new queue items. Returns null if the operation is not supported. + */ + shuffle(): messages.QueueItem[] | Promise; +} + +/** + * Controls and monitors media playback. + */ +export class PlayerManager { + constructor(params?: any); + + /** + * Adds an event listener for player event. + */ + addEventListener: ( + eventType: events.EventType | events.EventType[], + eventListener: EventHandler + ) => void; + + /** + * Sends a media status message to all senders (broadcast). Applications use this to send a custom state change. + */ + broadcastStatus( + includeMedia?: boolean, + requestId?: number, + customData?: any, + includeQueueItems?: boolean + ): void; + + getAudioTracksManager(): AudioTracksManager; + + /** + * Returns current time in sec in currently-playing break clip. + */ + getBreakClipCurrentTimeSec(): number; + + /** + * Returns duration in sec of currently-playing break clip. + */ + getBreakClipDurationSec(): number; + + /** + * Obtain the breaks (Ads) manager. + */ + getBreakManager(): breaks.BreakManager; + + /** + * Returns list of breaks. + */ + getBreaks(): messages.Break[]; + + /** + * Gets current time in sec of current media. + */ + getCurrentTimeSec(): number; + + /** + * Gets duration in sec of currently playing media. + */ + getDurationSec(): number; + + /** + * Returns live seekable range with start and end time in seconds. The values are media time based. + */ + getLiveSeekableRange(): messages.LiveSeekableRange; + + /** + * Gets media information of current media. + */ + getMediaInformation(): messages.MediaInformation; + + /** + * Returns playback configuration. + */ + getPlaybackConfig(): PlaybackConfig; + + /** + * Returns current playback rate. + */ + getPlaybackRate(): number; + + /** + * Gets player state. + */ + getPlayerState(): messages.PlayerState; + + /** + * Get the preferred playback rate. (Can be used on shutdown event to save latest preferred playback rate to a persistent storage; + * so it can be used in next session in the cast options). + */ + getPreferredPlaybackRate(): number; + + /** + * Get the preferred text track language. + */ + getPreferredTextLanguage(): string; + + /** + * Obtain QueueManager API. + */ + getQueueManager(): QueueManager; + + getTextTracksManager(): TextTracksManager; + + /** + * Loads media. + */ + load(loadRequest: messages.LoadRequestData): Promise; + + /** + * Pauses currently playing media. + */ + pause(): void; + + /** + * Plays currently paused media. + */ + play(): void; + + /** + * Requests a text string to be played back locally on the receiver device. + */ + playString(stringId: messages.PlayStringId, args?: string[]): Promise; + + /** + * Request Google Assistant to refresh the credentials. Only works if the original credentials came from the assistant. + */ + refreshCredentials(): Promise; + + /** + * Removes the event listener added for given player event. If event listener is not added; it will be ignored. + */ + removeEventListener( + eventType: events.EventType | events.EventType[], + eventListener: EventHandler + ): void; + + /** + * Seeks in current media. + */ + seek(seekTime: number): void; + + /** + * Sends an error to a specific sender + */ + sendError( + senderId: string, + requestId: number, + type: messages.ErrorType, + reason?: messages.ErrorReason, + customData?: any + ): void; + + /** + * Send local media request. + */ + sendLocalMediaRequest(request: messages.RequestData): void; + + /** + * Sends a media status message to a specific sender. + */ + sendStatus( + senderId: string, + requestId: number, + includeMedia?: boolean, + customData?: any, + includeQueueItems?: boolean + ): void; + + /** + * Sets the IDLE reason. This allows applications that want to force the IDLE state to indicate the reason that made the player going to IDLE state + * (a custom error; for example). The idle reason will be sent in the next status message. NOTE: Most applications do not need to set this value; + * it is only needed if they want to make the player go to IDLE in special circumstances and the default idleReason does not reflect their intended + * behavior. + */ + setIdleReason(idleReason: messages.IdleReason): void; + + /** + * Sets MediaElement to use. If Promise of MediaElement is set; media begins playback after Promise is resolved. + */ + setMediaElement(mediaElement: HTMLMediaElement): void; + + /** + * Sets media information. + */ + setMediaInformation( + mediaInformation: messages.MediaInformation, + opt_broadcast?: boolean + ): void; + + /** + * Sets a handler to return or modify PlaybackConfig; for a specific load request. The handler paramaters are the load request data + * and default playback config for the receiver (provided in the context options). The handler should returns a modified playback config; + * or null to prevent the media from playing. The return value can be a promise to allow waiting for data from the server. + */ + setMediaPlaybackInfoHandler( + handler: ( + loadRequestData: messages.LoadRequestData, + playbackConfig: PlaybackConfig + ) => void + ): void; + + /** + * Sets a handler to return the media url for a load request. This handler can be used to avoid having the media content url published as part + * of the media status. By default the media contentId is used as the content url. + */ + setMediaUrlResolver( + resolver: (loadRequestData: messages.LoadRequestData) => void + ): void; + + /** + * Provide an interceptor of incoming and outgoing messages. + * The interceptor can update the request data; and return updated data; a promise of + * updated data if need to get more data from the server; or null if the request should not be handled. + * Note that if load message interceptor is provided; and no interceptor is provided for preload - + * the load interceptor will be called for preload messages. + */ + setMessageInterceptor( + type: messages.MessageType, + interceptor: (requestData: messages.RequestData) => Promise + ): void; + + /** + * Sets playback configuration on the PlayerManager. + */ + setPlaybackConfig(playbackConfig: PlaybackConfig): void; + + /** + * Set the preferred playback rate for follow up load or media items. The preferred playback rate will be updated automatically to the latest + * playback rate that was provided by a load request or explicit set of playback rate. + */ + setPreferredPlaybackRate(preferredPlaybackRate: number): void; + + /** + * Set the preferred text track language. The preferred text track language will be updated automatically to the latest enabled language + * by a load request or explicit change to text tracks. (Should be called only in idle state; and Will only apply to next loaded media). + */ + setPreferredTextLanguage(preferredTextLanguage: string): void; + + /** + * Stops currently playing media. + */ + stop(): void; +} + +/** + * Configuration to customize playback behavior. + */ +export class PlaybackConfig { + /** + * Duration of buffered media in seconds to start buffering. + */ + autoPauseDuration?: number; + + /** + * Duration of buffered media in seconds to start/resume playback after auto-paused due to buffering. + */ + autoResumeDuration?: number; + + /** + * Minimum number of buffered segments to start/resume playback. + */ + autoResumeNumberOfSegments?: number; + + /** + * A function to customize request to get a caption segment. + */ + captionsRequestHandler?: RequestHandler; + + /** + * Initial bandwidth in bits in per second. + */ + initialBandwidth?: number; + + /** + * Custom license data. + */ + licenseCustomData?: string; + + /** + * Handler to process license data. The handler is passed the license data; and returns the modified license data. + */ + licenseHandler?: BinaryHandler; + + /** + * A function to customize request to get a license. + */ + licenseRequestHandler?: RequestHandler; + + /** + * Url for acquiring the license. + */ + licenseUrl?: string; + + /** + * Handler to process manifest data. The handler is passed the manifest; and returns the modified manifest. + */ + manifestHandler?: (manifest: string) => string; + + /** + * A function to customize request to get a manifest. + */ + manifestRequestHandler?: RequestHandler; + + /** + * Preferred protection system to use for decrypting content. + */ + protectionSystem: ContentProtection; + + /** + * Handler to process segment data. The handler is passed the segment data; and returns the modified segment data. + */ + segmentHandler?: BinaryHandler; + + /** + * A function to customize request information to get a media segment. + */ + segmentRequestHandler?: RequestHandler; + + /** + * Maximum number of times to retry a network request for a segment. + */ + segmentRequestRetryLimit?: number; +} +/** + * HTTP(s) Request/Response information. + */ +export class NetworkRequestInfo { + /** + * The content of the request. Can be used to modify license request body. + */ + content: Uint8Array; + + /** + * An object containing properties that you would like to send in the header. + */ + headers: any; + + /** + * The URL requested. + */ + url: string; + + /** + * Indicates whether CORS Access-Control requests should be made using credentials such as cookies or authorization headers. + */ + withCredentials: boolean; +} +/** Cast receiver context options. All options are optionals. */ +export class CastReceiverOptions { + /** + * Optional map of custom messages namespaces to initialize and their types. + * Custom messages namespaces need to be initiated before the application started; + * so it is best to provide the namespaces in the receiver options. + * (The default type of a message bus is JSON; if not provided here). + */ + customNamespaces?: any; + + /** + * Sender id used for local requests. Default value is 'local'. + */ + localSenderId?: string; + + /** + * Maximum time in seconds before closing an idle sender connection. + * Setting this value enables a heartbeat message to keep the connection alive. + * Used to detect unresponsive senders faster than typical TCP timeouts. + * The minimum value is 5 seconds; there is no upper bound enforced but practically it's minutes before platform TCP timeouts come into play. + * Default value is 10 seconds. + */ + maxInactivity?: number; + + /** + * Optional media element to play content with. Default behavior is to use the first found media element in the page. + */ + mediaElement?: HTMLMediaElement; + + /** + * Optional playback configuration. + */ + playbackConfig?: PlaybackConfig; + + /** + * If this is true; the watched client stitching break will also be played. + */ + playWatchedBreak?: boolean; + + /** + * Preferred value for player playback rate. It is used if playback rate value is not provided in the load request. + */ + preferredPlaybackRate?: number; + + /** + * Preferred text track language. It is used if no active track is provided in the load request. + */ + preferredTextLanguage?: string; + + /** + * Optional queue implementation. + */ + queue?: QueueBase; + + /** + * Text that represents the application status. + * It should meet internationalization rules as may be displayed by the sender application. + */ + statusText?: string; + + /** + * A bitmask of media commands supported by the application. + * LOAD; PLAY; STOP; GET_STATUS must always be supported. + * If this value is not provided; then PAUSE; SEEK; STREAM_VOLUME; STREAM_MUTE are assumed to be supported too. + */ + supportedCommands?: number; + + /** + * Indicate that MPL should be used for DASH content. + */ + useLegacyDashSupport?: boolean; + + /** + * An integer used as an internal version number. + * This number is used only to distinguish between receiver releases and higher numbers do not necessarily have to represent newer releases. + */ + versionCode?: number; +} + +/** Manages loading of underlying libraries and initializes underlying cast receiver SDK. */ +export class CastReceiverContext { + /** Returns the CastReceiverContext singleton instance. */ + static getInstance(): CastReceiverContext; + + constructor(params: any); + + /** + * Sets message listener on custom message channel. + */ + addCustomMessageListener( + namespace: string, + listener: EventHandler + ): void; + + /** + * Add listener to cast system events. + */ + addEventListener( + type: system.EventType | system.EventType[], + handler: EventHandler + ): void; + + /** + * Checks if the given media params of video or audio streams are supported by the platform. + */ + canDisplayType( + mimeType: string, + codecs?: string, + width?: number, + height?: number, + framerate?: number + ): boolean; + + /** + * Provides application information once the system is ready; otherwise it will be null. + */ + getApplicationData(): system.ApplicationData; + + /** + * Provides device capabilities information once the system is ready; otherwise it will be null. + * If an empty object is returned; the device does not expose any capabilities information. + */ + getDeviceCapabilities(): any; + + /** + * Get Player instance that can control and monitor media playback. + */ + getPlayerManager(): PlayerManager; + + /** + * Get a sender by sender id + */ + getSender(senderId: string): system.Sender; + + /** + * Gets a list of currently-connected senders. + */ + getSenders(): system.Sender[]; + + /** + * Reports if the cast application's HDMI input is in standby. + */ + getStandbyState(): system.StandbyState; + + /** + * Provides application information about the system state. + */ + getSystemState(): system.SystemState; + + /** + * Reports if the cast application is the HDMI active input. + */ + getVisibilityState(): any; + + /** + * When the application calls start; the system will send the ready event to indicate + * that the application information is ready and the application can send messages as soon as there is one sender connected. + */ + isSystemReady(): boolean; + + /** + * Start loading player js. This can be used to start loading the players js code in early stage of starting the receiver before calling start. + * This function is a no-op if players were already loaded (start was called). + */ + loadPlayerLibraries(useLegacyDashSupport?: boolean): void; + + /** + * Remove a message listener on custom message channel. + */ + removeCustomMessageListener( + namespace: string, + listener: EventHandler + ): void; + + /** + * Remove listener to cast system events. + */ + removeEventListener(type: system.EventType, handler: EventHandler): void; + + /** + * Sends a message to a specific sender. + */ + sendCustomMessage( + namespace: string, + senderId: string, + message: any + ): void; + + /** + * This function should be called in response to the feedbackstarted event if the application + * add debug state information to log in the feedback report. + * It takes in a parameter ‘message’ that is a string that represents the debug information that the application wants to log. + */ + sendFeedbackMessage(feedbackMessage: string): void; + + /** + * Sets the application state. The application should call this when its state changes. + * If undefined or set to an empty string; the value of the Application Name established during application + * registration is used for the application state by default. + */ + setApplicationState(statusText: string): void; + + /** + * Sets the receiver inactivity timeout. + * It is recommended to set the maximum inactivity value when calling Start and not changing it. + * This API is just provided for development/debugging purposes. + */ + setInactivityTimeout(maxInactivity: number): void; + + /** + * Sets the log verbosity level. + */ + setLoggerLevel(level: LoggerLevel): void; + + /** + * Initializes system manager and media manager; so that receiver app can receive requests from senders. + */ + start(options?: CastReceiverOptions): CastReceiverContext; + + /** + * Shutdown receiver application. + */ + stop(): void; +} + +/** Manages audio tracks. */ +export class AudioTracksManager { + constructor(params: any); + getActiveId(): number; + getActiveTrack(): messages.Track; + getTrackById(id: number): messages.Track; + getTracks(): messages.Track[]; + getTracksByLanguage(language: string): messages.Track[]; + setActiveById(id: number): void; + setActiveByLanguage(language: string): void; } diff --git a/types/chromecast-caf-receiver/cast.framework.events.d.ts b/types/chromecast-caf-receiver/cast.framework.events.d.ts index 03b70ca459..468ed98158 100644 --- a/types/chromecast-caf-receiver/cast.framework.events.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.events.d.ts @@ -4,423 +4,421 @@ import { Track, MediaStatus } from "./cast.framework.messages"; -export = cast.framework.events; -declare namespace cast.framework.events { - type EventType = - | "ALL" - | "ABORT" - | "CAN_PLAY" - | "CAN_PLAY_THROUGH" - | "DURATION_CHANGE" - | "EMPTIED" - | "ENDED" - | "LOADED_DATA" - | "LOADED_METADATA" - | "LOAD_START" - | "PAUSE" - | "PLAY" - | "PLAYING" - | "PROGRESS" - | "RATE_CHANGE" - | "SEEKED" - | "SEEKING" - | "STALLED" - | "TIME_UPDATE" - | "SUSPEND" - | "WAITING" - | "BITRATE_CHANGED" - | "BREAK_STARTED" - | "BREAK_ENDED" - | "BREAK_CLIP_LOADING" - | "BREAK_CLIP_STARTED" - | "BREAK_CLIP_ENDED" - | "BUFFERING" - | "CACHE_LOADED" - | "CACHE_HIT" - | "CACHE_INSERTED" - | "CLIP_STARTED" - | "CLIP_ENDED" - | "EMSG" - | "ERROR" - | "ID3" - | "MEDIA_STATUS" - | "MEDIA_FINISHED" - | "PLAYER_PRELOADING" - | "PLAYER_PRELOADING_CANCELLED" - | "PLAYER_LOAD_COMPLETE" - | "PLAYER_LOADING" - | "SEGMENT_DOWNLOADED" - | "REQUEST_SEEK" - | "REQUEST_LOAD" - | "REQUEST_STOP" - | "REQUEST_PAUSE" - | "REQUEST_PLAY" - | "REQUEST_PLAY_AGAIN" - | "REQUEST_PLAYBACK_RATE_CHANGE" - | "REQUEST_SKIP_AD" - | "REQUEST_VOLUME_CHANGE" - | "REQUEST_EDIT_TRACKS_INFO" - | "REQUEST_EDIT_AUDIO_TRACKS" - | "REQUEST_SET_CREDENTIALS" - | "REQUEST_LOAD_BY_ENTITY" - | "REQUEST_USER_ACTION" - | "REQUEST_DISPLAY_STATUS" - | "REQUEST_CUSTOM_COMMAND" - | "REQUEST_FOCUS_STATE" - | "REQUEST_QUEUE_LOAD" - | "REQUEST_QUEUE_INSERT" - | "REQUEST_QUEUE_UPDATE" - | "REQUEST_QUEUE_REMOVE" - | "REQUEST_QUEUE_REORDER" - | "REQUEST_QUEUE_GET_ITEM_RANGE" - | "REQUEST_QUEUE_GET_ITEMS" - | "REQUEST_QUEUE_GET_ITEM_IDS" - | "REQUEST_PRECACHE"; +export as namespace events +export type EventType = + | "ALL" + | "ABORT" + | "CAN_PLAY" + | "CAN_PLAY_THROUGH" + | "DURATION_CHANGE" + | "EMPTIED" + | "ENDED" + | "LOADED_DATA" + | "LOADED_METADATA" + | "LOAD_START" + | "PAUSE" + | "PLAY" + | "PLAYING" + | "PROGRESS" + | "RATE_CHANGE" + | "SEEKED" + | "SEEKING" + | "STALLED" + | "TIME_UPDATE" + | "SUSPEND" + | "WAITING" + | "BITRATE_CHANGED" + | "BREAK_STARTED" + | "BREAK_ENDED" + | "BREAK_CLIP_LOADING" + | "BREAK_CLIP_STARTED" + | "BREAK_CLIP_ENDED" + | "BUFFERING" + | "CACHE_LOADED" + | "CACHE_HIT" + | "CACHE_INSERTED" + | "CLIP_STARTED" + | "CLIP_ENDED" + | "EMSG" + | "ERROR" + | "ID3" + | "MEDIA_STATUS" + | "MEDIA_FINISHED" + | "PLAYER_PRELOADING" + | "PLAYER_PRELOADING_CANCELLED" + | "PLAYER_LOAD_COMPLETE" + | "PLAYER_LOADING" + | "SEGMENT_DOWNLOADED" + | "REQUEST_SEEK" + | "REQUEST_LOAD" + | "REQUEST_STOP" + | "REQUEST_PAUSE" + | "REQUEST_PLAY" + | "REQUEST_PLAY_AGAIN" + | "REQUEST_PLAYBACK_RATE_CHANGE" + | "REQUEST_SKIP_AD" + | "REQUEST_VOLUME_CHANGE" + | "REQUEST_EDIT_TRACKS_INFO" + | "REQUEST_EDIT_AUDIO_TRACKS" + | "REQUEST_SET_CREDENTIALS" + | "REQUEST_LOAD_BY_ENTITY" + | "REQUEST_USER_ACTION" + | "REQUEST_DISPLAY_STATUS" + | "REQUEST_CUSTOM_COMMAND" + | "REQUEST_FOCUS_STATE" + | "REQUEST_QUEUE_LOAD" + | "REQUEST_QUEUE_INSERT" + | "REQUEST_QUEUE_UPDATE" + | "REQUEST_QUEUE_REMOVE" + | "REQUEST_QUEUE_REORDER" + | "REQUEST_QUEUE_GET_ITEM_RANGE" + | "REQUEST_QUEUE_GET_ITEMS" + | "REQUEST_QUEUE_GET_ITEM_IDS" + | "REQUEST_PRECACHE"; - type DetailedErrorCode = - | "MEDIA_UNKNOWN" - | "MEDIA_ABORTED" - | "MEDIA_DECODE" - | "MEDIA_NETWORK" - | "MEDIA_SRC_NOT_SUPPORTED" - | "SOURCE_BUFFER_FAILURE" - | "MEDIAKEYS_UNKNOWN" - | "MEDIAKEYS_NETWORK" - | "MEDIAKEYS_UNSUPPORTED" - | "MEDIAKEYS_WEBCRYPTO" - | "NETWORK_UNKNOWN" - | "SEGMENT_NETWORK" - | "HLS_NETWORK_MASTER_PLAYLIST" - | "HLS_NETWORK_PLAYLIST" - | "HLS_NETWORK_NO_KEY_RESPONSE" - | "HLS_NETWORK_KEY_LOAD" - | "HLS_NETWORK_INVALID_SEGMENT" - | "HLS_SEGMENT_PARSING" - | "DASH_NETWORK" - | "DASH_NO_INIT" - | "SMOOTH_NETWORK" - | "SMOOTH_NO_MEDIA_DATA" - | "MANIFEST_UNKNOWN" - | "HLS_MANIFEST_MASTER" - | "HLS_MANIFEST_PLAYLIST" - | "DASH_MANIFEST_UNKNOWN" - | "DASH_MANIFEST_NO_PERIODS" - | "DASH_MANIFEST_NO_MIMETYPE" - | "DASH_INVALID_SEGMENT_INFO" - | "SMOOTH_MANIFEST" - | "SEGMENT_UNKNOWN" - | "TEXT_UNKNOWN" - | "APP" - | "BREAK_CLIP_LOADING_ERROR" - | "BREAK_SEEK_INTERCEPTOR_ERROR" - | "IMAGE_ERROR" - | "LOAD_INTERRUPTED" - | "GENERIC"; +export type DetailedErrorCode = + | "MEDIA_UNKNOWN" + | "MEDIA_ABORTED" + | "MEDIA_DECODE" + | "MEDIA_NETWORK" + | "MEDIA_SRC_NOT_SUPPORTED" + | "SOURCE_BUFFER_FAILURE" + | "MEDIAKEYS_UNKNOWN" + | "MEDIAKEYS_NETWORK" + | "MEDIAKEYS_UNSUPPORTED" + | "MEDIAKEYS_WEBCRYPTO" + | "NETWORK_UNKNOWN" + | "SEGMENT_NETWORK" + | "HLS_NETWORK_MASTER_PLAYLIST" + | "HLS_NETWORK_PLAYLIST" + | "HLS_NETWORK_NO_KEY_RESPONSE" + | "HLS_NETWORK_KEY_LOAD" + | "HLS_NETWORK_INVALID_SEGMENT" + | "HLS_SEGMENT_PARSING" + | "DASH_NETWORK" + | "DASH_NO_INIT" + | "SMOOTH_NETWORK" + | "SMOOTH_NO_MEDIA_DATA" + | "MANIFEST_UNKNOWN" + | "HLS_MANIFEST_MASTER" + | "HLS_MANIFEST_PLAYLIST" + | "DASH_MANIFEST_UNKNOWN" + | "DASH_MANIFEST_NO_PERIODS" + | "DASH_MANIFEST_NO_MIMETYPE" + | "DASH_INVALID_SEGMENT_INFO" + | "SMOOTH_MANIFEST" + | "SEGMENT_UNKNOWN" + | "TEXT_UNKNOWN" + | "APP" + | "BREAK_CLIP_LOADING_ERROR" + | "BREAK_SEEK_INTERCEPTOR_ERROR" + | "IMAGE_ERROR" + | "LOAD_INTERRUPTED" + | "GENERIC"; - type EndedReason = - | "END_OF_STREAM" - | "ERROR" - | "STOPPED" - | "INTERRUPTED" - | "SKIPPED" - | "BREAK_SWITCH"; +export type EndedReason = + | "END_OF_STREAM" + | "ERROR" + | "STOPPED" + | "INTERRUPTED" + | "SKIPPED" + | "BREAK_SWITCH"; + +/** + * Event data for @see{@link EventType.SEGMENT_DOWNLOADED} event. + */ +export class SegmentDownloadedEvent extends Event { + constructor(downloadTime?: number, size?: number); /** - * Event data for @see{@link EventType.SEGMENT_DOWNLOADED} event. + * The time it took to download the segment; in milliseconds. */ - class SegmentDownloadedEvent extends Event { - constructor(downloadTime?: number, size?: number); - - /** - * The time it took to download the segment; in milliseconds. - */ - downloadTime?: number; - - /** - * The number of bytes in the segment. - */ - size?: number; - } + downloadTime?: number; /** - * Event data for all events that represent requests made to the receiver. + * The number of bytes in the segment. */ - class RequestEvent extends Event { - constructor( - type: EventType, - requestData?: RequestData, - senderId?: string - ); - - /** - * The data that was sent with the request. - */ - requestData?: RequestData; - - /** - * The sender id the request came from. - */ - senderId?: string; - } - - /** - * Event data superclass for all events dispatched by @see{@link PlayerManager} - */ - class Event { - constructor(type: EventType); - - /** - * Type of the event. - */ - type: EventType; - } - /** - * Event data for @see{@link EventType.MEDIA_STATUS} event. - */ - class MediaStatusEvent extends Event { - constructor(type: EventType, mediaStatus?: MediaStatus); - - /** - * The media status that was sent. - */ - mediaStatus?: MediaStatus; - } - /** - * Event data for pause events forwarded from the MediaElement. - */ - class MediaPauseEvent extends Event { - constructor(currentMediaTime?: number, ended?: boolean); - - /** - * Indicate if the media ended (indicates the pause was fired due to stream reached the end). - */ - ended?: boolean; - } - /** - * Event data for @see{@link EventType.MEDIA_FINISHED} event. - */ - class MediaFinishedEvent extends Event { - constructor(currentMediaTime?: number, endedReason?: EndedReason); - - /** - * The time when the media finished (in seconds). For an item in a queue; this value represents the time in the currently playing queue item ( where 0 means the queue item has just started). - */ - currentTime?: number; - - /** - * The reason the media finished. - */ - endedReason?: EndedReason; - } - /** - * Event data for all events forwarded from the MediaElement. - */ - class MediaElementEvent extends Event { - constructor(type: EventType, currentMediaTime?: number); - - /** - * The time in the currently playing clip when the event was fired (in seconds). Undefined if playback has not started yet. - */ - currentMediaTime?: number; - } - /** - * Event data for all events pertaining to processing a load / preload request. made to the player. - */ - class LoadEvent extends Event { - constructor(type: EventType, media?: MediaInformation); - - /** - * Information about the media being loaded. - */ - media: MediaInformation; - } - /** - * Event data for @see{@link EventType.INBAND_TRACK_ADDED} event. - */ - class InbandTrackAddedEvent { - constructor(track: Track); - - /** - * Added track. - */ - track: Track; - } - - /** Event data for @see{@link EventType.ID3} event. */ - class Id3Event extends Event { - constructor(segmentData: Uint8Array); - - /** - * The segment data. - */ - segmentData: Uint8Array; - } - /** - * Event data for @see{@link EventType.EMSG} event. - */ - class EmsgEvent extends Event { - constructor(emsgData: any); - - /** - * The time that the event ends (in presentation time). Undefined if using legacy Dash support. - */ - endTime: any; - - /** - * The duration of the event (in units of timescale). Undefined if using legacy Dash support. - */ - eventDuration: any; - - /** - * A field identifying this instance of the message. Undefined if using legacy Dash support. - */ - id: any; - - /** - * Body of the message. Undefined if using legacy Dash support. - */ - messageData: any; - - /** - * The offset that the event starts; relative to the start of the segment this is contained in (in units of timescale). Undefined if using legacy Dash support. - */ - presentationTimeDelta: any; - - /** - * Identifies the message scheme. Undefined if using legacy Dash support. - */ - schemeIdUri: any; - - /** - * The segment data. This is only defined if using legacy Dash support. - */ - segmentData: any; - - /** - * The time that the event starts (in presentation time). Undefined if using legacy Dash support. - */ - startTime: any; - - /** - * Provides the timescale; in ticks per second. Undefined if using legacy Dash support. - */ - timescale: any; - - /** - * Specifies the value for the event. Undefined if using legacy Dash support. - */ - value: any; - } - /** - * Event data for @see{@link EventType.CLIP_ENDED} event. - */ - class ClipEndedEvent extends Event { - constructor(currentMediaTime: number, endedReason?: EndedReason); - - /** - * The time in media (in seconds) when clip ended. - */ - currentMediaTime: number; - - /** - * The reason the clip ended. - */ - endedReason?: EndedReason; - } - - /** - * Event data for @see{@link EventType.CACHE_LOADED} event. - */ - class CacheLoadedEvent extends Event { - constructor(media?: MediaInformation); - - /** - * Information about the media being cached. - */ - media: MediaInformation; - } - - class CacheItemEvent extends Event { - constructor(type: EventType, url: string); - - /** - * The URL of data fetched from cache - */ - url: string; - } - - class BufferingEvent extends Event { - constructor(isBuffering: boolean); - - /** - * True if the player is entering a buffering state. - */ - isBuffering: boolean; - } - - class BreaksEvent extends Event { - constructor( - type: EventType, - currentMediaTime?: number, - index?: number, - total?: number, - whenSkippable?: number, - endedReason?: EndedReason, - breakClipId?: string, - breakId?: string - ); - - /** - * The break's id. Refer to Break.id - */ - breakId?: string; - - /** - * The break clip's id. Refer to BreakClip.id - */ - breakClipId?: string; - - /** - * The time in the currently playing media when the break event occurred. - */ - currentMediaTime?: number; - - /** - * The reason the break clip ended. - */ - endedReason?: EndedReason; - - /** - * Index of break clip; which starts from 1. - */ - index: number; - - /** - * Total number of break clips. - */ - total: number; - - /** - * When to skip current break clip in sec; after break clip begins to play. - */ - whenSkippable?: number; - } - - /** - * Event data for @see {@link EventType.BITRATE_CHANGED} event. - */ - class BitrateChangedEvent { - constructor(totalBitrate?: number); - - /** The bitrate of the media (audio and video) in bits per second. */ - totalBitrate: number; - } - - class ErrorEvent extends Event { - constructor(detailedErrorCode: DetailedErrorCode, error?: any); - - detailedErrorCode: DetailedErrorCode; - error?: any; - } + size?: number; +} + +/** + * Event data for all events that represent requests made to the receiver. + */ +export class RequestEvent extends Event { + constructor( + type: EventType, + requestData?: RequestData, + senderId?: string + ); + + /** + * The data that was sent with the request. + */ + requestData?: RequestData; + + /** + * The sender id the request came from. + */ + senderId?: string; +} + +/** + * Event data superexport class for all events dispatched by @see{@link PlayerManager} + */ +export class Event { + constructor(type: EventType); + + /** + * Type of the event. + */ + type: EventType; +} +/** + * Event data for @see{@link EventType.MEDIA_STATUS} event. + */ +export class MediaStatusEvent extends Event { + constructor(type: EventType, mediaStatus?: MediaStatus); + + /** + * The media status that was sent. + */ + mediaStatus?: MediaStatus; +} +/** + * Event data for pause events forwarded from the MediaElement. + */ +export class MediaPauseEvent extends Event { + constructor(currentMediaTime?: number, ended?: boolean); + + /** + * Indicate if the media ended (indicates the pause was fired due to stream reached the end). + */ + ended?: boolean; +} +/** + * Event data for @see{@link EventType.MEDIA_FINISHED} event. + */ +export class MediaFinishedEvent extends Event { + constructor(currentMediaTime?: number, endedReason?: EndedReason); + + /** + * The time when the media finished (in seconds). For an item in a queue; this value represents the time in the currently playing queue item ( where 0 means the queue item has just started). + */ + currentTime?: number; + + /** + * The reason the media finished. + */ + endedReason?: EndedReason; +} +/** + * Event data for all events forwarded from the MediaElement. + */ +export class MediaElementEvent extends Event { + constructor(type: EventType, currentMediaTime?: number); + + /** + * The time in the currently playing clip when the event was fired (in seconds). Undefined if playback has not started yet. + */ + currentMediaTime?: number; +} +/** + * Event data for all events pertaining to processing a load / preload request. made to the player. + */ +export class LoadEvent extends Event { + constructor(type: EventType, media?: MediaInformation); + + /** + * Information about the media being loaded. + */ + media: MediaInformation; +} +/** + * Event data for @see{@link EventType.INBAND_TRACK_ADDED} event. + */ +export class InbandTrackAddedEvent { + constructor(track: Track); + + /** + * Added track. + */ + track: Track; +} + +/** Event data for @see{@link EventType.ID3} event. */ +export class Id3Event extends Event { + constructor(segmentData: Uint8Array); + + /** + * The segment data. + */ + segmentData: Uint8Array; +} +/** + * Event data for @see{@link EventType.EMSG} event. + */ +export class EmsgEvent extends Event { + constructor(emsgData: any); + + /** + * The time that the event ends (in presentation time). Undefined if using legacy Dash support. + */ + endTime: any; + + /** + * The duration of the event (in units of timescale). Undefined if using legacy Dash support. + */ + eventDuration: any; + + /** + * A field identifying this instance of the message. Undefined if using legacy Dash support. + */ + id: any; + + /** + * Body of the message. Undefined if using legacy Dash support. + */ + messageData: any; + + /** + * The offset that the event starts; relative to the start of the segment this is contained in (in units of timescale). Undefined if using legacy Dash support. + */ + presentationTimeDelta: any; + + /** + * Identifies the message scheme. Undefined if using legacy Dash support. + */ + schemeIdUri: any; + + /** + * The segment data. This is only defined if using legacy Dash support. + */ + segmentData: any; + + /** + * The time that the event starts (in presentation time). Undefined if using legacy Dash support. + */ + startTime: any; + + /** + * Provides the timescale; in ticks per second. Undefined if using legacy Dash support. + */ + timescale: any; + + /** + * Specifies the value for the event. Undefined if using legacy Dash support. + */ + value: any; +} +/** + * Event data for @see{@link EventType.CLIP_ENDED} event. + */ +export class ClipEndedEvent extends Event { + constructor(currentMediaTime: number, endedReason?: EndedReason); + + /** + * The time in media (in seconds) when clip ended. + */ + currentMediaTime: number; + + /** + * The reason the clip ended. + */ + endedReason?: EndedReason; +} + +/** + * Event data for @see{@link EventType.CACHE_LOADED} event. + */ +export class CacheLoadedEvent extends Event { + constructor(media?: MediaInformation); + + /** + * Information about the media being cached. + */ + media: MediaInformation; +} + +export class CacheItemEvent extends Event { + constructor(type: EventType, url: string); + + /** + * The URL of data fetched from cache + */ + url: string; +} + +export class BufferingEvent extends Event { + constructor(isBuffering: boolean); + + /** + * True if the player is entering a buffering state. + */ + isBuffering: boolean; +} + +export class BreaksEvent extends Event { + constructor( + type: EventType, + currentMediaTime?: number, + index?: number, + total?: number, + whenSkippable?: number, + endedReason?: EndedReason, + breakClipId?: string, + breakId?: string + ); + + /** + * The break's id. Refer to Break.id + */ + breakId?: string; + + /** + * The break clip's id. Refer to BreakClip.id + */ + breakClipId?: string; + + /** + * The time in the currently playing media when the break event occurred. + */ + currentMediaTime?: number; + + /** + * The reason the break clip ended. + */ + endedReason?: EndedReason; + + /** + * Index of break clip; which starts from 1. + */ + index: number; + + /** + * Total number of break clips. + */ + total: number; + + /** + * When to skip current break clip in sec; after break clip begins to play. + */ + whenSkippable?: number; +} + +/** + * Event data for @see {@link EventType.BITRATE_CHANGED} event. + */ +export class BitrateChangedEvent { + constructor(totalBitrate?: number); + + /** The bitrate of the media (audio and video) in bits per second. */ + totalBitrate: number; +} + +export class ErrorEvent extends Event { + constructor(detailedErrorCode: DetailedErrorCode, error?: any); + + detailedErrorCode: DetailedErrorCode; + error?: any; } diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts index d6dda6d145..1846fd4840 100644 --- a/types/chromecast-caf-receiver/cast.framework.messages.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -1,1900 +1,1904 @@ import { Event, DetailedErrorCode } from "./cast.framework.events"; -export = cast.framework.messages; -declare namespace cast.framework.messages { - type UserAction = - | "LIKE" - | "DISLIKE" - | "FOLLOW" - | "UNFOLLOW" - | "FLAG" - | "SKIP_AD"; - - type UserActionContext = - | "UNKNOWN_CONTEXT" - | "ALBUM" - | "ARTIST" - | "PLAYLIST" - | "EPISODE" - | "SERIES" - | "MOVIE" - | "CHANNEL" - | "TEAM" - | "PLAYER" - | "COACH"; - - type TextTrackType = - | "SUBTITLES" - | "CAPTIONS" - | "DESCRIPTIONS" - | "CHAPTERS" - | "METADATA"; - - type TextTrackWindowType = "NONE" | "NORMAL" | "ROUNDED_CORNERS"; - - type TrackType = "TEXT" | "AUDIO" | "VIDEO"; - - type TextTrackFontGenericFamily = - | "SANS_SERIF" - | "MONOSPACED_SANS_SERIF" - | "SERIF" - | "MONOSPACED_SERIF" - | "CASUAL" - | "CURSIVE" - | "SMALL_CAPITALS"; - - type TextTrackFontStyle = "NORMAL" | "BOLD" | "BOLD_ITALIC" | "ITALIC"; - - type TextTrackEdgeType = - | "NONE" - | "OUTLINE" - | "DROP_SHADOW" - | "RAISED" - | "DEPRESSED"; - - type Command = - | "PAUSE" - | "SEEK" - | "STREAM_VOLUME" - | "STREAM_MUTE" - | "ALL_BASIC_MEDIA" - | "QUEUE_NEXT" - | "QUEUE_PREV" - | "QUEUE_SHUFFLE" - | "SKIP_AD"; - - type SeekResumeState = "PLAYBACK_START" | "PLAYBACK_PAUSE"; - - type StreamingProtocolType = - | "UNKNOWN" - | "MPEG_DASH" - | "HLS" - | "SMOOTH_STREAMING"; - - type StreamType = "BUFFERED" | "LIVE" | "NONE"; - - type FocusState = "IN_FOCUS" | "NOT_IN_FOCUS"; - - type ExtendedPlayerState = "LOADING"; - - type ErrorType = - | "INVALID_PLAYER_STATE" - | "LOAD_FAILED" - | "LOAD_CANCELLED" - | "INVALID_REQUEST" - | "ERROR"; - - type ErrorReason = - | "INVALID_COMMAND" - | "INVALID_PARAMS" - | "INVALID_MEDIA_SESSION_ID" - | "SKIP_LIMIT_REACHED" - | "NOT_SUPPORTED" - | "LANGUAGE_NOT_SUPPORTED" - | "END_OF_QUEUE" - | "APP_ERROR" - | "AUTHENTICATION_EXPIRED" - | "PREMIUM_ACCOUNT_REQUIRED" - | "CONCURRENT_STREAM_LIMIT" - | "PARENTAL_CONTROL_RESTRICTED" - | "NOT_AVAILABLE_IN_REGION" - | "CONTENT_ALREADY_PLAYING" - | "INVALID_REQUEST" - | "GENERIC_LOAD_ERROR"; - - type RepeatMode = - | "REPEAT_OFF" - | "REPEAT_ALL" - | "REPEAT_SINGLE" - | "REPEAT_ALL_AND_SHUFFLE"; - - type IdleReason = "CANCELLED" | "INTERRUPTED" | "FINISHED" | "ERROR"; - - type HlsSegmentFormat = "AAC" | "AC3" | "MP3" | "TS" | "TS_AAC"; - - type HdrType = "SDR" | "HDR" | "DV"; - - type PlayStringId = - | "FREE_TRIAL_ABOUT_TO_EXPIRE" - | "SUBSCRIPTION_ABOUT_TO_EXPIRE" - | "STREAM_HIJACKED"; - - type GetStatusOptions = "NO_METADATA" | "NO_QUEUE_ITEMS"; - - type MessageType = - | "MEDIA_STATUS" - | "CLOUD_STATUS" - | "QUEUE_CHANGE" - | "QUEUE_ITEMS" - | "QUEUE_ITEM_IDS" - | "GET_STATUS" - | "LOAD" - | "PAUSE" - | "STOP" - | "PLAY" - | "SKIP_AD" - | "PLAY_AGAIN" - | "SEEK" - | "SET_PLAYBACK_RATE" - | "SET_VOLUME" - | "EDIT_TRACKS_INFO" - | "EDIT_AUDIO_TRACKS" - | "PRECACHE" - | "PRELOAD" - | "QUEUE_LOAD" - | "QUEUE_INSERT" - | "QUEUE_UPDATE" - | "QUEUE_REMOVE" - | "QUEUE_REORDER" - | "QUEUE_NEXT" - | "QUEUE_PREV" - | "QUEUE_GET_ITEM_RANGE" - | "QUEUE_GET_ITEMS" - | "QUEUE_GET_ITEM_IDS" - | "QUEUE_SHUFFLE" - | "SET_CREDENTIALS" - | "LOAD_BY_ENTITY" - | "USER_ACTION" - | "DISPLAY_STATUS" - | "FOCUS_STATE" - | "CUSTOM_COMMAND"; - - type PlayerState = "IDLE" | "PLAYING" | "PAUSED" | "BUFFERING"; - - type QueueChangeType = - | "INSERT" - | "REMOVE" - | "ITEMS_CHANGE" - | "UPDATE" - | "NO_CHANGE"; - - type QueueType = - | "ALBUM" - | "PLAYLIST" - | "AUDIOBOOK" - | "RADIO_STATION" - | "PODCAST_SERIES" - | "TV_SERIES" - | "VIDEO_PLAYLIST" - | "LIVE_TV" - | "MOVIE"; - - type MetadataType = - | "GENERIC" - | "MOVIE" - | "TV_SHOW" - | "MUSIC_TRACK" - | "PHOTO"; - - /** - * RefreshCredentials request data. - */ - interface RefreshCredentialsRequestData { - [key: string]: any; - } - - /** - * Media event SET_VOLUME request data. - */ - interface VolumeRequestData extends RequestData { - /** - * The media stream volume - */ - volume?: Volume; - } - - /** - * Represents the volume of a media session stream. - */ - interface Volume { - /** - * Value from 0 to 1 that represents the current stream volume level. - */ - level?: number; - - /** - * Whether the stream is muted. - */ - muted?: boolean; - } - - /** - * Video information such as video resolution and High Dynamic Range (HDR). - */ - class VideoInformation { - constructor(width: number, height: number, hdrType: HdrType); - - width: number; - - height: number; - - hdrType: HdrType; - } - - /** - * VAST ad request configuration. - */ - interface VastAdsRequest { - /** - * Specifies a VAST document to be used as the ads response instead of making a - * request via an ad tag url. - * This can be useful for debugging and other situations where a VAST response is - * already available. - */ - adsResponse?: string; - - /** - * URL for VAST file. - */ - adTagUrl?: string; - } - - /** - * UserAction request data. - */ - interface UserActionRequestData { - /** - * Optional request source. - * It contain the assistent query that initiate the request. - */ - source?: string; - - /** - * User action to be handled by the application. - */ - userAction?: UserAction; - - /** - * Optional context information for the user action. - */ - userActionContext?: UserActionContext; - } - - /** - * A TV episode media description. - */ - interface TvShowMediaMetadata { - /** - * TV episode number. A positive integer. - */ - episode?: number; - - /** - * @deprecated use episode instead - */ - episodeNumber?: number; - - /** - * @deprecated use episode instead - */ - episodeTitle?: string; - - /** - * Content images. Examples would include cover art or a thumbnail of - * the currently playing media. - */ - images?: Image[]; - - /** - * ISO 8601 date when the episode originally aired; e.g. 2014-02-10. - */ - originalAirdate?: string; - - /** - * @deprecated use originalAirdate instead. - */ - releaseYear?: number; - - /** - * TV episode season. A positive integer. - */ - season?: number; - - /** - * @deprecated use season instead. - */ - seasonNumber?: number; - - /** - * TV series title. - */ - seriesTitle?: string; - - /** - * TV episode title. - */ - title?: string; - } - /** - * Describes track metadata information. - */ - class Track { - constructor(trackId: number, trackType: TrackType); - - /** - * Custom data set by the receiver application. - */ - customData?: string; - - /** - * Language tag as per RFC 5646 (If subtype is “SUBTITLES” it is mandatory). - */ - language?: string; - - /** - * A descriptive; human readable name for the track. For example "Spanish". - */ - name?: string; - - /** - * For text tracks; the type of text track. - */ - subtype?: string; - - /** - * It can be the url of the track or any other identifier that allows the receiver - * to find the content (when the track is not inband or included in the manifest). - * For example it can be the url of a vtt file. - */ - trackContentId?: string; - - /** - * It represents the MIME type of the track content. For example if the track - * is a vtt file it will be ‘text/vtt’. This field is needed for out of band tracks; - * so it is usually provided if a trackContentId has also been provided. - * It is not mandatory if the receiver has a way to identify the content from - * the trackContentId; but recommended. - * The track content type; if provided; must be consistent with the track type. - */ - trackContentType?: string; - - /** - * Unique identifier of the track within the context of a MediaInformation object. - */ - trackId?: number; - - /** - * The type of track. - */ - type: TrackType; - } - /** - * Describes style information for a text track. - */ - interface TextTrackStyle { - /** - * The background 32 bit RGBA color. The alpha channel should be used for transparent backgrounds. - */ - backgroundColor?: string; - - /** - * Custom data set by the receiver application. - */ - customData?: any; - - /** - * RGBA color for the edge; this value will be ignored if edgeType is NONE. - */ - edgeColor?: string; - - edgeType?: TextTrackEdgeType; - - /** - * If the font is not available in the receiver the fontGenericFamily will be used. - */ - fontFamily?: string; - - /** - * The text track generic family. - */ - fontGenericFamily?: TextTrackFontGenericFamily; - - /** - * The font scaling factor for the text track (the default is 1). - */ - fontScale?: number; - - /** - * The text track font style. - */ - fontStyle?: TextTrackFontStyle; - - /** - * The foreground 32 bit RGBA color. - */ - foregroundColor?: string; - - /** - * 32 bit RGBA color for the window. This value will be ignored if windowType is NONE. - */ - windowColor?: string; - - /** - * Rounded corner radius absolute value in pixels (px). This value will be ignored - * if windowType is not ROUNDED_CORNERS. - */ - windowRoundedCornerRadius?: number; - - /** - * The window concept is defined in CEA-608 and CEA-708. In WebVTT is called a region. - */ - windowType?: TextTrackWindowType; - } - - /** - * Media event playback rate request data. - */ - interface SetPlaybackRateRequestData extends RequestData { - /** - * New playback rate (>0). - */ - playbackRate?: number; - - /** - * New playback rate relative to current playback rate. - * New rate will be the result of multiplying the current rate with the value. - * For example a value of 1.1 will increase rate by 10%. - * (Only used if the playbackRate value is not provided). - */ - relativePlaybackRate?: number; - } - - /** - * SetCredentials request data. - */ - interface SetCredentialsRequestData { - /** - * Credentials to use by receiver. - */ - credentials?: string; - - /** - * If it is a response for refresh credentials; it will indicate the request id - * of the refresh credentials request. - */ - forRequestId?: number; - - /** - * Optional request source. It contain the assistent query that initiate the request. - */ - source?: string; - } - - /** - * Media event SEEK request data. - */ - interface SeekRequestData extends RequestData { - /** - * Seconds since beginning of content. - */ - currentTime?: number; - - /** - * Seconds relative to the current playback position. If this field is defined; - * the currentTime field will be ignored. - */ - relativeTime?: number; - - /** - * The playback state after a SEEK request. - */ - resumeState?: SeekResumeState; - } - - /** - * Provides seekable range in seconds. - */ - class SeekableRange { - constructor(start?: number, end?: number); - - /** - * End of the seekable range in seconds. - */ - end?: number; - - /** - * Start of the seekable range in seconds. - */ - start?: number; - } - - /** - * Media event request data. - */ - class RequestData { - constructor(type: MessageType); - - /** - * Application-specific data for this request. - * It enables the sender and receiver to easily extend the media protocol - * without having to use a new namespace with custom messages. - */ - customData?: any; - - /** - * Id of the media session that the request applies to. - */ - mediaSessionId?: number; - - /** - * Id of the request; used to correlate request/response. - */ - requestId: number; - } - - /** - * Media event UPDATE queue request data. - */ - interface QueueUpdateRequestData { - /** - * ID of the current media Item after the deletion - * (if not provided; the currentItem value will be the same as before the deletion; - * if it does not exist because it has been deleted; the currentItem will point to - * the next logical item in the list). - */ - currentItemId?: number; - - /** - * Seconds since the beginning of content to start playback of the current item. - * If provided; this value will take precedence over the startTime value provided - * at the QueueItem level but only the first time the item is played. - * This is to cover the common case where the user jumps to the middle of an - * item so the currentTime does not apply to the item permanently like the - * QueueItem startTime does. It avoids having to reset the startTime dynamically - * (that may not be possible if the phone has gone to sleep). - */ - currentTime?: number; - - /** - * List of queue items to be updated. No reordering will happen; the items will - * retain the existing order. - */ - items?: QueueItem[]; - - /** - * Skip/Go back number of items with respect to the position of currentItem - * (it can be negative). If it is out of boundaries; the currentItem will be the - * next logical item in the queue wrapping around the boundaries. - * The new currentItem position will follow the rules of the queue repeat behavior. - */ - jump?: number; - - /** - * Behavior of the queue when all items have been played. - */ - repeatMode?: RepeatMode; - - /** - * Shuffle the queue items when the update is processed. - * After the queue items are shuffled; the item at the currentItem position will - * be loaded. - */ - shuffle?: boolean; - } - - /** - * Media event queue REORDER request data. - */ - class QueueReorderRequestData extends RequestData { - constructor(itemIds: number[]); - - /** - * ID of the current media Item after the deletion (if not provided; - * the currentItem value will be the same as before the deletion; - * if it does not exist because it has been deleted; - * the currentItem will point to the next logical item in the list). - */ - currentItemId?: number; - - /** - * Seconds since the beginning of content to start playback of the current item. - * If provided; this value will take precedence over the startTime value provided - * at the QueueItem level but only the first time the item is played. - * This is to cover the common case where the user jumps to the middle of an - * item so the currentTime does not apply to the item permanently like - * the QueueItem startTime does. It avoids having to reset the startTime dynamically - * (that may not be possible if the phone has gone to sleep). - */ - currentTime?: number; - - /** - * ID of the item that will be located immediately after the reordered list. - * If the ID is not found or it is not provided; - * the reordered list will be appended at the end of the existing list. - */ - insertBefore?: number; - - /** - * IDs of the items to be reordered; in the new order. - * Items not provided will keep their existing order. - * The provided list will be inserted at the position determined by insertBefore. - * For example: - * If insertBefore is not specified Existing queue: “A”;”D”;”G”;”H”;”B”;”E” itemIds: - * “D”;”H”;”B” New Order: “A”;”G”;”E”;“D”;”H”;”B” - * If insertBefore is “A” Existing queue: “A”;”D”;”G”;”H”;”B” itemIds: - * “D”;”H”;”B” New Order: “D”;”H”;”B”;“A”;”G”;”E” - * If insertBefore is “G” Existing queue: “A”;”D”;”G”;”H”;”B” itemIds: - * “D”;”H”;”B” New Order: “A”;“D”;”H”;”B”;”G”;”E” - */ - itemIds: number[]; - } - - /** - * Media event queue REMOVE request data. - */ - class QueueRemoveRequestData extends RequestData { - constructor(itemIds: number[]); - - /** - * ID of the current media Item after the deletion - * (if not provided; the currentItem value will be the same as before the deletion; - * if it does not exist because it has been deleted; - * the currentItem will point to the next logical item in the list). - */ - currentItemId?: number; - - /** - * Seconds since the beginning of content to start playback of the current item. - * If provided; this value will take precedence over the startTime value provided - * at the QueueItem level but only the first time the item is played. - * This is to cover the common case where the user jumps to the middle of an - * item so the currentTime does not apply to the item permanently like the - * QueueItem startTime does. It avoids having to reset the startTime dynamically - * (that may not be possible if the phone has gone to sleep). - */ - currentTime?: number; - - /** - * IDs of queue items to be deleted. - */ - itemIds?: number[]; - } - /** - * Media event queue LOAD request data. - */ - class QueueLoadRequestData extends RequestData { - constructor(items: QueueItem[]); - - /** - * Seconds (since the beginning of content) to start playback of the first item to - * be played. If provided; this value will take precedence over the - * startTime value provided at the QueueItem level but only the first - * time the item is played. This is to cover the common case where the user - * casts the item that was playing locally so the currentTime does not apply - * to the item permanently like the QueueItem startTime does. - * It avoids having to reset the startTime dynamically - * (that may not be possible if the phone has gone to sleep). - */ - currentTime?: number; - - /** - * Behavior of the queue when all items have been played. - */ - items: QueueItem[]; - - /** - * Id of the request; used to correlate request/response. - */ - repeatMode?: RepeatMode; - - /** - * The index of the item in the items array that must be the first currentItem - * (the item that will be played first). Note this is the index of the array - * (starts at 0) and not the itemId (as it is not known until the queue is created). - * If repeatMode is REPEAT_OFF playback will end when the last item in the array is - * played (elements before the startIndex will not be played). - * This may be useful for continuation scenarios where the user was already - * using the sender app and in the middle decides to cast. - * In this way the sender app does not need to map between the local and remote queue - * positions or saves one extra QUEUE_UPDATE request. - */ - startIndex?: number; - } - - /** - * Queue item information. Application developers may need to create a QueueItem to - * insert a queue element using InsertQueueItems. In this case they should not - * provide an itemId (as the actual itemId will be assigned when the item is inserted - * in the queue). This prevents ID collisions with items added from a sender app. - */ - class QueueItem { - constructor(opt_itemId?: number); - - /** - * Array of Track trackIds that are active. If the array is not provided; - * the default tracks will be active. - */ - activeTrackIds?: number[]; - - /** - * If the autoplay parameter is not specified or is true; the media player - * will begin playing the element in the queue when the item becomes the currentItem. - */ - autoplay?: boolean; - - /** - * The application can define any extra queue item information needed. - */ - customData?: any; - - /** - * Unique identifier of the item in the queue. - * The attribute is optional because for LOAD or INSERT should not be provided - * (as it will be assigned by the receiver when an item is first created/inserted). - */ - itemId?: number; - - /** - * Metadata (including contentId) of the playlist element. - */ - media?: MediaInformation; - - /** - * Playback duration of the item; if it is larger than the actual duration - - * startTime it will be ignored (default behavior). - * It can be negative; in such case the duration will be the actual asset - * duration minus the duration provided. - * It can be used for photo slideshows to control the duration the item should - * be presented or for live events to control the duration that the program - * should be played. It may be useful for autoplay scenarios to avoid displaying all - * the credits after an episode has ended. - */ - playbackDuration?: number; - - /** - * This parameter is a hint for the receiver to preload this media - * item before it is played. It allows for a smooth transition between items - * played from the queue. The time is expressed in seconds; relative to - * the beginning of this item playback (usually the end of the previous item playback). - * Only positive values are valid. For example; if the value is 10 seconds; this item - * will be preloaded 10 seconds before the previous item has finished. - * The receiver will try to honor this value but will not guarantee it; - * for example if the value is larger than the previous item duration the - * receiver may just preload this item shortly after the previous item has started playing - * (there will never be two items being preloaded in parallel). - * Also; if an item is inserted in the queue just after the currentItem and the time to preload is higher than the - * time left on the currentItem; the preload will just happen as soon as possible. - */ - preloadTime?: number; - - /** - * Seconds since beginning of content. If the content is live content; - * and startTime is not specified; the stream will start at the live position. - */ - startTime?: number; - } - - /** - * Media event queue INSERT request data. - */ - class QueueInsertRequestData extends RequestData { - constructor(items: QueueItem[]); - - /** - * ID of the current media Item after the insertion (if not provided; - * the currentItem value will be the same as before the insertion). - */ - currentItemId?: number; - - /** - * Index (relative to the items array; starting with 0) of the new current media Item. - * For inserted items we use the index (similar to startIndex in QUEUE_LOAD) and not - * currentItemId; because the itemId is unknown until the items are inserted. - * If not provided; the currentItem value will be the same as before the insertion - * (unless currentItemId is provided). This param allows to make atomic the common use - * case of insert and play an item. - */ - currentItemIndex?: number; - - /** - * Seconds since the beginning of content to start playback of the current item. - * If provided; this value will take precedence over the startTime value provided - * at the QueueItem level but only the first time the item is played. - * This is to cover the common case where the user jumps to the middle of an - * item so the currentTime does not apply to the item permanently like the - * QueueItem startTime does. It avoids having to reset the startTime dynamically - * (that may not be possible if the phone has gone to sleep). - */ - currentTime?: number; - - /** - * ID of the item that will be located immediately after the inserted list. - * If the ID is not found or it is not provided; the list will be appended at - * the end of the existing list. - */ - insertBefore?: number; - - /** - * List of queue items. The itemId field of the items should be empty. - * It is sorted (first element will be played first). - */ - items: QueueItem[]; - } - - /** - * Represents a data message containing the full list of queue ids. - */ - interface QueueIds { - /** - * List of queue item ids. - */ - itemIds?: number[]; - - /** - * The corresponding request id. - */ - requestId?: number; - - type: MessageType; - } - - /** - * Queue data as part of the LOAD request. - */ - class QueueData { - constructor( - id?: string, - name?: string, - description?: string, - repeatMode?: RepeatMode, - items?: QueueItem[], - startIndex?: number, - startTime?: number - ); - - /** - * Description of the queue. - */ - description?: string; - - /** - * Optional Queue entity id; provide Google Assistant deep link. - */ - entity?: string; - - /** - * Id of the queue. - */ - id?: string; - - /** - * Array of queue items. It is sorted (first element will be played first). - */ - items?: QueueItem[]; - - /** - * Name of the queue. - */ - name?: string; - - /** - * Queue type; e.g. album; playlist; radio station; tv series; etc. - */ - queueType?: QueueType; - - /** - * Continuous playback behavior of the queue. - */ - repeatMode?: RepeatMode; - - /** - * The index of the item in the queue that should be used to start playback first. - */ - startIndex?: number; - - /** - * Seconds (since the beginning of content) to start playback of the first item. - */ - startTime?: number; - } - - /** - * Represents a queue change message; such as insert; remove; and update. - */ - interface QueueChange { - /** - * The actual queue change type. - */ - changeType?: QueueChangeType; - - /** - * The id to insert the list of itemIds before. - */ - insertBefore?: number; - - /** - * List of changed itemIds. - */ - itemIds?: number[]; - - /** - * The corresponding request id. - */ - requestId?: number; - - /** - * The queue change sequence ID. Used to coordinate state sync between various - * senders and the receiver. - */ - sequenceNumber?: number; - - type: MessageType; - } - - /** - * Media event PRELOAD request data. - */ - class PreloadRequestData implements LoadRequestData { - /** - * Array of trackIds that are active. If the array is not provided; - * the default tracks will be active. - */ - activeTrackIds: number[]; - /** - * If the autoplay parameter is specified; the media player will begin playing - * the content when it is loaded. Even if autoplay is not specified;the media player - * implementation may choose to begin playback immediately. - */ - autoplay?: boolean; - /** - * Optional user credentials. - */ - credentials?: string; - /** - * Optional credentials type. The type 'cloud' is a reserved type used by load - * requests that were originated by voice assistant commands. - */ - credentialsType?: string; - /** - * Seconds since beginning of content. If the content is live content; - * and currentTime is not specified; the stream will start at the live position. - */ - currentTime?: number; - /** - * If the autoplay parameter is specified; the media player will begin playing - * the content when it is loaded. Even if autoplay is not specified; the media - * player implementation may choose to begin playback immediately. - */ - media: MediaInformation; - /** - * The media playback rate. - */ - playbackRate?: number; - /** - * Queue data. - */ - queueData: QueueData; - /** - * Application-specific data for this request. - * It enables the sender and receiver to easily extend the media protocol - * without having to use a new namespace with custom messages. - */ - customData?: any; - /** - * Id of the media session that the request applies to. - */ - mediaSessionId?: number; - /** - * Id of the request; used to correlate request/response. - */ - requestId: number; - constructor(itemId: number); - - /** - * The ID of the queue item. - */ - itemId: number; - } - - /** - * Media event PRECACHE request data. (Some fields of the load request; - * like autoplay and queueData; are ignored). - */ - class PrecacheRequestData implements LoadRequestData { - /** - * Array of trackIds that are active. If the array is not provided; - * the default tracks will be active. - */ - activeTrackIds: number[]; - /** - * If the autoplay parameter is specified; the media player will begin playing - * the content when it is loaded. Even if autoplay is not specified;the media player - * implementation may choose to begin playback immediately. - */ - autoplay?: boolean; - /** - * Optional user credentials. - */ - credentials?: string; - /** - * Optional credentials type. The type 'cloud' is a reserved type used by load - * requests that were originated by voice assistant commands. - */ - credentialsType?: string; - /** - * Seconds since beginning of content. If the content is live content; and - * currentTime is not specified; the stream will start at the live position. - */ - currentTime?: number; - /** - * If the autoplay parameter is specified; the media player will begin playing - * the content when it is loaded. Even if autoplay is not specified; - * the media player implementation may choose to begin playback immediately. - */ - media: MediaInformation; - /** - * The media playback rate. - */ - playbackRate?: number; - /** - * Queue data. - */ - queueData: QueueData; - /** - * Application-specific data for this request. - * It enables the sender and receiver to easily extend the media protocol - * without having to use a new namespace with custom messages. - */ - customData?: any; - /** - * Id of the media session that the request applies to. - */ - mediaSessionId?: number; - /** - * Id of the request; used to correlate request/response. - */ - requestId: number; - constructor(data?: string); - - /** - * Application precache data. - */ - precacheData?: string; - } - - /** - * PlayString request data. - */ - class PlayStringRequestData { - constructor(stringId: PlayStringId, opt_arguments?: string[]); - - /** - * An optional array of string values to be filled into the text. - */ - arguments?: string[]; - - /** - * An identifier for the text to be played back. - */ - stringId: PlayStringId; - } - - /** - * A photo media description. - */ - interface PhotoMediaMetadata { - /** - * Name of the photographer. - */ - artist?: string; - - /** - * ISO 8601 date and time the photo was taken; e.g. 2014-02-10T15:47:00Z. - */ - creationDateTime?: string; - - /** - * Photo height; in pixels. - */ - height?: number; - - /** - * Images associated with the content. Examples would include a photo thumbnail. - */ - images: Image[]; - - /** - * Latitude. - */ - latitude?: number; - - /** - * Location where the photo was taken. For example; "Seattle; Washington; USA". - */ - location?: string; - - /** - * Longitude. - */ - longitude?: number; - - /** - * Photo title. - */ - title?: string; - - /** - * Photo width; in pixels. - */ - width?: number; - } - - /** - * A music track media description. - */ - interface MusicTrackMediaMetadata { - /** - * Album artist name. - */ - albumArtist?: string; - - /** - * Album name. - */ - albumName?: string; - - /** - * Track artist name. - */ - artist?: string; - - /** - * @deprecated: use @see{@link artist} instead - */ - artistName: string; - - /** - * Track composer name. - */ - composer?: string; - - /** - * Disc number. A positive integer. - */ - discNumber?: number; - - /** - * Content images. Examples would include cover art or a thumbnail of the - * currently playing media. - */ - images: Image[]; - - /** - * ISO 8601 date when the track was released; e.g. 2014-02-10. - */ - releaseDate?: string; - - /** - * @deprecated: Use @see{@link releaseDate} instead - */ - releaseYear?: string; - - /** - * Track name. - */ - songName?: string; - - /** - * Track title. - */ - title?: string; - - /** - * Track number in album. A positive integer. - */ - trackNumber?: number; - } - - /** - * A movie media description. - */ - interface MovieMediaMetadata { - /** - * Content images. Examples would include cover art or a thumbnail of the - * currently playing media. - */ - images: Image[]; - - /** - * ISO 8601 date when the movie was released; e.g. 2014-02-10. - */ - releaseDate?: string; - - /** - * @deprecated: use @see{@link releaseDate} instead - */ - releaseYear?: number; - - /** - * Movie studio. - */ - studio?: string; - - /** - * Movie subtitle. - */ - subtitle?: string; - - /** - * Movie title. - */ - title?: string; - } - /** - * Represents the status of a media session. - */ - interface MediaStatus { - /** - * List of IDs corresponding to the active tracks. - */ - activeTrackIds: number[]; - - /** - * Status of break; if receiver is playing break. - * This field will be defined only when receiver is playing break. - */ - breakStatus: BreakStatus; - - /** - * ID of this media item (the item that originated the status change). - */ - currentItemId?: number; - - /** - * The current playback position. - */ - currentTime: number; - - /** - * Application-specific media status. - */ - customData?: any; - - /** - * Extended media status information. - */ - extendedStatus: ExtendedMediaStatus; - - /** - * If the state is IDLE; the reason the player went to IDLE state. - */ - idleReason: IdleReason; - - /** - * List of media queue items. - */ - items: QueueItem[]; - - /** - * Seekable range of a live or event stream. It uses relative media time in seconds. - * It will be undefined for VOD streams. - */ - liveSeekableRange: LiveSeekableRange; - - /** - * ID of the media Item currently loading. If there is no item being loaded; - * it will be undefined. - */ - loadingItemId?: number; - - /** - * The media information. - */ - media: MediaInformation; - - /** - * Unique id for the session. - */ - mediaSessionId: number; - - /** - * The playback rate. - */ - playbackRate: number; - - /** - * The playback state. - */ - playerState: PlayerState; - - /** - * ID of the next Item; only available if it has been preloaded. - * Media items can be preloaded and cached temporarily in memory; - * so when they are loaded later on; the process is faster - * (as the media does not have to be fetched from the network). - */ - preloadedItemId?: number; - - /** - * Queue data. - */ - queueData: QueueData; - - /** - * The behavior of the queue when all items have been played. - */ - repeatMode: RepeatMode; - - /** - * The commands supported by this player. - */ - supportedMediaCommands: number; - - type: MessageType; - - /** - * The video information. - */ - videoInfo: VideoInformation; - - /** - * The current stream volume. - */ - volume: Volume; - } - /** - * Common media metadata used as part of MediaInformation - */ - class MediaMetadata { - constructor(type: MetadataType); - - /** - * The type of metadata - */ - metadataType: MetadataType; - } - - /** - * Represents the media information. - */ - interface MediaInformation { - /** - * Partial list of break clips that includes current break clip that receiver - * is playing or ones that receiver will play shortly after; instead of sending - * whole list of clips. This is to avoid overflow of MediaStatus message. - */ - breakClips: BreakClip[]; - - /** - * List of breaks. - */ - breaks: Break[]; - - /** - * Typically the url of the media. - */ - contentId: string; - - /** - * The content MIME type. - */ - contentType: string; - - /** - * Optional media url; to allow using contentId for real id. If contentUrl - * is provided; it will be used as media url; otherwise the contentId will - * be used as the media url. - */ - contentUrl?: string; - - /** - * Application-specific media information. - */ - customData?: any; - - /** - * The media duration. - */ - duration?: number; - - /** - * Optional Media entity; provide Google Assistant deep link. - */ - entity?: string; - - /** - * The format of the HLS media segment. - */ - hlsSegmentFormat: HlsSegmentFormat; - - /** - * The media metadata. - */ - metadata: MediaMetadata; - - /** - * The stream type. - */ - streamType: StreamType; - - /** - * The style of text track. - */ - textTrackStyle: TextTrackStyle; - - /** - * The media tracks. - */ - tracks: Track[]; - } - - /** - * Media event LOAD request data. - */ - interface LoadRequestData extends RequestData { - /** - * Array of trackIds that are active. If the array is not provided; the - * default tracks will be active. - */ - activeTrackIds: number[]; - - /** - * If the autoplay parameter is specified; the media player will begin - * playing the content when it is loaded. Even if autoplay is not - * specified;the media player implementation may choose to begin playback - * immediately. - */ - autoplay?: boolean; - - /** - * Optional user credentials. - */ - credentials?: string; - - /** - * Optional credentials type. The type 'cloud' is a reserved type used by - * load requests that were originated by voice assistant commands. - */ - credentialsType?: string; - - /** - * Seconds since beginning of content. If the content is live content; - * and currentTime is not specified; the stream will start at the live position. - */ - currentTime?: number; - - /** - * If the autoplay parameter is specified; the media player will begin playing - * the content when it is loaded. Even if autoplay is not specified; the media - * player implementation may choose to begin playback immediately. - */ - media: MediaInformation; - - /** - * The media playback rate. - */ - playbackRate?: number; - - /** - * Queue data. - */ - queueData: QueueData; - } - - /** - * LoadByEntity request data. - */ - interface LoadByEntityRequestData { - /** - * Content entity information; typically represented by a stringified JSON object - */ - entity: string; - - /** - * Shuffle the items to play. - */ - shuffle?: boolean; - - /** - * Optional request source. It contain the assistent query that initiate the request. - */ - source?: string; - } - - /** - * Provides live seekable range with start and end time in seconds and two more - * attributes. - */ - class LiveSeekableRange { - constructor( - start?: number, - end?: number, - isMovingWindow?: boolean, - isLiveDone?: boolean - ); - - /** - * A boolean value indicates whether a live stream is ended. If it is done; - * the end of live seekable range should stop updating. - */ - isLiveDone?: boolean; - - /** - * A boolean value indicates whether the live seekable range is a moving window. - * If false; it will be either a expanding range or a fixed range meaning live - * has ended. - */ - isMovingWindow?: boolean; - } - - /** - * Represents a data message containing item information for each requested ids. - */ - interface ItemsInfo { - /** - * List of changed itemIds. - */ - items: QueueItem[]; - - /** - * The corresponding request id. - */ - requestId?: number; - - type: MessageType; - } - - /** - * An image that describes a receiver application or media item. - * This could be an application icon; cover art; or a thumbnail. - */ - class Image { - constructor(url: string); - - /** - * The height of the image. - */ - height?: number; - - /** - * the URL to the image - */ - url: string; - - /** - * The width of the image - */ - width?: number; - } - /** Media event GET_STATUS request data. */ - interface GetStatusRequestData extends RequestData { - /** - * The options of a GET_STATUS request. - */ - options: GetStatusOptions; - } - - /** - * Get items info request data. - */ - class GetItemsInfoRequestData extends RequestData { - constructor(itemIds: number[]); - - /** - * List of item ids to be requested. - */ - itemIds: number[]; - } - /** - * A generic media description. - */ - interface GenericMediaMetadata extends MediaMetadata { - /** - * Content images. Examples would include cover art or a thumbnail of the - * currently playing media. - */ - images: Image[]; - - /** - * ISO 8601 date and/or time when the content was released; e.g. 2014-02-10. - */ - releaseDate?: string; - - /** - * @deprecated - use @see{@link releaseDate} instead - */ - releaseYear?: number; - - /** - * Content subtitle. - */ - subtitle?: string; - - /** - * Content title. - */ - title?: string; - } - - /** - * Focus state change message. - */ - interface FocusStateRequestData { - /** - * The focus state of the app. - */ - state: FocusState; - } - - /** Fetch items request data. */ - class FetchItemsRequestData extends RequestData { - constructor(itemId: number, nextCount: number, prevCount: number); - - /** - * ID of the reference media item for fetching more items. - */ - itemId: number; - - /** - * Number of items after the reference item to be fetched. - */ - nextCount: number; - - /** - * Number of items before the reference item to be fetched. - */ - prevCount: number; - } - - /** - * Extended media status information - */ - class ExtendedMediaStatus { - constructor( - playerState: MediaInformation, - opt_media?: MediaInformation - ); - - media: MediaInformation; - - playerState: ExtendedPlayerState; - } - - /** Event data for @see{@link EventType.ERROR} event. */ - class ErrorEvent extends Event { - constructor(detailedErrorCode?: DetailedErrorCode, error?: any); - - /** - * An error code representing the cause of the error. - */ - detailedErrorCode?: DetailedErrorCode; - - /** - * The error object. - * This could be an Error object (e.g.; if an Error was thrown in an event handler) - * or an object with error information (e.g.; if the receiver received an invalid - * command). - */ - error?: any; - } - - class ErrorData { - constructor(type: ErrorType); - - /** - * Application-specific data for this request. - * It enables the sender and receiver to easily extend the media protocol - * without having to use a new namespace with custom messages. - */ - customData?: any; - - /** - * Id of the request; used to correlate request/response. - */ - requestId?: number; - } - - /** Media event EDIT_TRACKS_INFO request data. */ - interface EditTracksInfoRequestData extends RequestData { - /** - * Array of the Track trackIds that should be active. - * If it is not provided; the active tracks will not change. - * If the array is empty; no track will be active. - */ - activeTrackIds?: number[]; - - /** - * Flag to enable or disable text tracks. - * If false it will disable all text tracks; - * if true it will enable the first text track; or the previous active text tracks. - * This flag is ignored if activeTrackIds or language is provided. - */ - enableTextTracks?: boolean; - - /** - * Indicates that the provided language was not explicit user request; but rather - * inferred from used language in voice query. - * It allows receiver apps to use user saved preference instead of spoken language. - */ - isSuggestedLanguage?: boolean; - - /** - * Language for the tracks that should be active. The language field will take - * precedence over activeTrackIds if both are specified. - */ - language?: string; - - textTrackStyle?: TextTrackStyle; - } - - /** - * Media event EDIT_AUDIO_TRACKS request data. If language is not provided; - * the default audio track for the media will be enabled. - */ - interface EditAudioTracksRequestData extends RequestData { - /** - * Indicates that the provided language was not explicit user request; - * but rather inferred from used language in voice query. - * It allows receiver apps to use user saved preference instead of spoken language. - */ - isSuggestedLanguage?: boolean; - - language?: string; - } - - /** DisplayStatus request data. */ - interface DisplayStatusRequestData { - /** - * Optional request source. It contain the assistent query that initiate the request. - */ - source: string; - } - - /** CustomCommand request data. */ - interface CustomCommandRequestData { - /** - * Custom Data; typically represented by a stringified JSON object. - */ - data: string; - - /** - * Optional request source. It contain the assistent query that initiate the request. - */ - source: string; - } - - class BreakStatus { - constructor(currentBreakTime: number, currentBreakClipTime: number); - - /** - * Id of current break clip. - */ - breakClipId: string; - - /** - * Id of current break. - */ - breakId: string; - - /** - * Time in sec elapsed after current break clip starts. - */ - currentBreakClipTime: number; - - /** - * Time in sec elapsed after current break starts. - */ - currentBreakTime: number; - - /** - * The time in sec when this break clip becomes skippable. - * 5 means that end user can skip this break clip after 5 seconds. - * If this field is not defined; it means that current break clip is not skippable. - */ - whenSkippable: number; - } - - /** - * Represents break clip (e.g. a clip of ad during ad break) - */ - class BreakClip { - constructor(id: string); - - /** - * Url of page that sender will display; when end user clicks link on sender UI; while receiver is playing this clip. - */ - clickThroughUrl?: string; - /** - * Typically the url of the break media (playing on the receiver). - */ - contentId?: string; - /** - * The content MIME type. - */ - contentType?: string; - /** - * Optional break media url; to allow using contentId for real id. - * If contentUrl is provided; it will be used as media url; - * otherwise the contentId will be used as the media url. - */ - contentUrl?: string; - /** - * Application-specific break clip data. - */ - customData?: any; - /** - * Duration of break clip in sec. - */ - duration?: number; - /** - * The format of the HLS media segment. - */ - hlsSegmentFormat?: HlsSegmentFormat; - /** - * Unique id of break clip. - */ - id: string; - /** - * Url of content that sender will display while receiver is playing this clip. - */ - posterUrl?: string; - /** - * Title of break clip. Sender might display this on its screen; if provided. - */ - title?: string; - /** - * VAST ad request configuration. Used if contentId or contentUrl is not provided. - */ - vastAdsRequest?: VastAdsRequest; - /** - * The time in sec when this break clip becomes skippable. - * 5 means that end user can skip this break clip after 5 seconds. - * If this field is not defined; it means that current break clip is not skippable. - */ - whenSkippable?: number; - } - - /** Represents break (e.g. ad break) included in main video. */ - class Break { - constructor(id: string, breakClipIds: string[], position: number); - /** - * List of ids of break clip that this break includes. - */ - breakClipIds: string[]; - /** - * Duration of break in sec. - */ - duration?: number; - /** - * Unique id of break. - */ - id: string; - /** - * If true; indicates this is embedded break in main stream. - */ - - isEmbedded?: boolean; - /** - * Whether break is watched. - * Sender can change color of progress bar marker corresponding to this break once - * this field changes from false to true; - * denoting that the end-user already watched this break. - */ - isWatched: boolean; - - /** - * Where the break is located inside main video. -1 represents the end of main video. - */ - position: number; - } +export as namespace messages +export type UserAction = + | "LIKE" + | "DISLIKE" + | "FOLLOW" + | "UNFOLLOW" + | "FLAG" + | "SKIP_AD"; + +export type UserActionContext = + | "UNKNOWN_CONTEXT" + | "ALBUM" + | "ARTIST" + | "PLAYLIST" + | "EPISODE" + | "SERIES" + | "MOVIE" + | "CHANNEL" + | "TEAM" + | "PLAYER" + | "COACH"; + +export type TextTrackType = + | "SUBTITLES" + | "CAPTIONS" + | "DESCRIPTIONS" + | "CHAPTERS" + | "METADATA"; + +export type TextTrackWindowType = "NONE" | "NORMAL" | "ROUNDED_CORNERS"; + +export type TrackType = "TEXT" | "AUDIO" | "VIDEO"; + +export type TextTrackFontGenericFamily = + | "SANS_SERIF" + | "MONOSPACED_SANS_SERIF" + | "SERIF" + | "MONOSPACED_SERIF" + | "CASUAL" + | "CURSIVE" + | "SMALL_CAPITALS"; + +export type TextTrackFontStyle = "NORMAL" | "BOLD" | "BOLD_ITALIC" | "ITALIC"; + +export type TextTrackEdgeType = + | "NONE" + | "OUTLINE" + | "DROP_SHADOW" + | "RAISED" + | "DEPRESSED"; + +export type Command = + | "PAUSE" + | "SEEK" + | "STREAM_VOLUME" + | "STREAM_MUTE" + | "ALL_BASIC_MEDIA" + | "QUEUE_NEXT" + | "QUEUE_PREV" + | "QUEUE_SHUFFLE" + | "SKIP_AD"; + +export type SeekResumeState = "PLAYBACK_START" | "PLAYBACK_PAUSE"; + +export type StreamingProtocolType = + | "UNKNOWN" + | "MPEG_DASH" + | "HLS" + | "SMOOTH_STREAMING"; + +export type StreamType = "BUFFERED" | "LIVE" | "NONE"; + +export type FocusState = "IN_FOCUS" | "NOT_IN_FOCUS"; + +export type ExtendedPlayerState = "LOADING"; + +export type ErrorType = + | "INVALID_PLAYER_STATE" + | "LOAD_FAILED" + | "LOAD_CANCELLED" + | "INVALID_REQUEST" + | "ERROR"; + +export type ErrorReason = + | "INVALID_COMMAND" + | "INVALID_PARAMS" + | "INVALID_MEDIA_SESSION_ID" + | "SKIP_LIMIT_REACHED" + | "NOT_SUPPORTED" + | "LANGUAGE_NOT_SUPPORTED" + | "END_OF_QUEUE" + | "APP_ERROR" + | "AUTHENTICATION_EXPIRED" + | "PREMIUM_ACCOUNT_REQUIRED" + | "CONCURRENT_STREAM_LIMIT" + | "PARENTAL_CONTROL_RESTRICTED" + | "NOT_AVAILABLE_IN_REGION" + | "CONTENT_ALREADY_PLAYING" + | "INVALID_REQUEST" + | "GENERIC_LOAD_ERROR"; + +export type RepeatMode = + | "REPEAT_OFF" + | "REPEAT_ALL" + | "REPEAT_SINGLE" + | "REPEAT_ALL_AND_SHUFFLE"; + +export type IdleReason = "CANCELLED" | "INTERRUPTED" | "FINISHED" | "ERROR"; + +export type HlsSegmentFormat = "AAC" | "AC3" | "MP3" | "TS" | "TS_AAC"; + +export type HdrType = "SDR" | "HDR" | "DV"; + +export type PlayStringId = + | "FREE_TRIAL_ABOUT_TO_EXPIRE" + | "SUBSCRIPTION_ABOUT_TO_EXPIRE" + | "STREAM_HIJACKED"; + +export type GetStatusOptions = "NO_METADATA" | "NO_QUEUE_ITEMS"; + +export type MessageType = + | "MEDIA_STATUS" + | "CLOUD_STATUS" + | "QUEUE_CHANGE" + | "QUEUE_ITEMS" + | "QUEUE_ITEM_IDS" + | "GET_STATUS" + | "LOAD" + | "PAUSE" + | "STOP" + | "PLAY" + | "SKIP_AD" + | "PLAY_AGAIN" + | "SEEK" + | "SET_PLAYBACK_RATE" + | "SET_VOLUME" + | "EDIT_TRACKS_INFO" + | "EDIT_AUDIO_TRACKS" + | "PRECACHE" + | "PRELOAD" + | "QUEUE_LOAD" + | "QUEUE_INSERT" + | "QUEUE_UPDATE" + | "QUEUE_REMOVE" + | "QUEUE_REORDER" + | "QUEUE_NEXT" + | "QUEUE_PREV" + | "QUEUE_GET_ITEM_RANGE" + | "QUEUE_GET_ITEMS" + | "QUEUE_GET_ITEM_IDS" + | "QUEUE_SHUFFLE" + | "SET_CREDENTIALS" + | "LOAD_BY_ENTITY" + | "USER_ACTION" + | "DISPLAY_STATUS" + | "FOCUS_STATE" + | "CUSTOM_COMMAND"; + +export type PlayerState = "IDLE" | "PLAYING" | "PAUSED" | "BUFFERING"; + +export type QueueChangeType = + | "INSERT" + | "REMOVE" + | "ITEMS_CHANGE" + | "UPDATE" + | "NO_CHANGE"; + +export type QueueType = + | "ALBUM" + | "PLAYLIST" + | "AUDIOBOOK" + | "RADIO_STATION" + | "PODCAST_SERIES" + | "TV_SERIES" + | "VIDEO_PLAYLIST" + | "LIVE_TV" + | "MOVIE"; + +export type MetadataType = + | "GENERIC" + | "MOVIE" + | "TV_SHOW" + | "MUSIC_TRACK" + | "PHOTO"; + +/** + * RefreshCredentials request data. + */ +export interface RefreshCredentialsRequestData { + [key: string]: any; +} + +/** + * Media event SET_VOLUME request data. + */ +export interface VolumeRequestData extends RequestData { + /** + * The media stream volume + */ + volume?: Volume; +} + +/** + * Represents the volume of a media session stream. + */ +export interface Volume { + /** + * Value from 0 to 1 that represents the current stream volume level. + */ + level?: number; + + /** + * Whether the stream is muted. + */ + muted?: boolean; +} + +/** + * Video information such as video resolution and High Dynamic Range (HDR). + */ +export class VideoInformation { + constructor(width: number, height: number, hdrType: HdrType); + + width: number; + + height: number; + + hdrType: HdrType; +} + +/** + * VAST ad request configuration. + */ +export interface VastAdsRequest { + /** + * Specifies a VAST document to be used as the ads response instead of making a + * request via an ad tag url. + * This can be useful for debugging and other situations where a VAST response is + * already available. + */ + adsResponse?: string; + + /** + * URL for VAST file. + */ + adTagUrl?: string; +} + +/** + * UserAction request data. + */ +export interface UserActionRequestData { + /** + * Optional request source. + * It contain the assistent query that initiate the request. + */ + source?: string; + + /** + * User action to be handled by the application. + */ + userAction?: UserAction; + + /** + * Optional context information for the user action. + */ + userActionContext?: UserActionContext; +} + +/** + * A TV episode media description. + */ +export interface TvShowMediaMetadata { + /** + * TV episode number. A positive integer. + */ + episode?: number; + + /** + * @deprecated use episode instead + */ + episodeNumber?: number; + + /** + * @deprecated use episode instead + */ + episodeTitle?: string; + + /** + * Content images. Examples would include cover art or a thumbnail of + * the currently playing media. + */ + images?: Image[]; + + /** + * ISO 8601 date when the episode originally aired; e.g. 2014-02-10. + */ + originalAirdate?: string; + + /** + * @deprecated use originalAirdate instead. + */ + releaseYear?: number; + + /** + * TV episode season. A positive integer. + */ + season?: number; + + /** + * @deprecated use season instead. + */ + seasonNumber?: number; + + /** + * TV series title. + */ + seriesTitle?: string; + + /** + * TV episode title. + */ + title?: string; +} +/** + * Describes track metadata information. + */ +export class Track { + constructor(trackId: number, trackType: TrackType); + + /** + * Custom data set by the receiver application. + */ + customData?: string; + + /** + * Language tag as per RFC 5646 (If subtype is “SUBTITLES” it is mandatory). + */ + language?: string; + + /** + * A descriptive; human readable name for the track. For example "Spanish". + */ + name?: string; + + /** + * For text tracks; the type of text track. + */ + subtype?: string; + + /** + * It can be the url of the track or any other identifier that allows the receiver + * to find the content (when the track is not inband or included in the manifest). + * For example it can be the url of a vtt file. + */ + trackContentId?: string; + + /** + * It represents the MIME type of the track content. For example if the track + * is a vtt file it will be ‘text/vtt’. This field is needed for out of band tracks; + * so it is usually provided if a trackContentId has also been provided. + * It is not mandatory if the receiver has a way to identify the content from + * the trackContentId; but recommended. + * The track content type; if provided; must be consistent with the track type. + */ + trackContentType?: string; + + /** + * Unique identifier of the track within the context of a MediaInformation object. + */ + trackId?: number; + + /** + * The type of track. + */ + type: TrackType; +} +/** + * Describes style information for a text track. + */ +export interface TextTrackStyle { + /** + * The background 32 bit RGBA color. The alpha channel should be used for transparent backgrounds. + */ + backgroundColor?: string; + + /** + * Custom data set by the receiver application. + */ + customData?: any; + + /** + * RGBA color for the edge; this value will be ignored if edgeType is NONE. + */ + edgeColor?: string; + + edgeType?: TextTrackEdgeType; + + /** + * If the font is not available in the receiver the fontGenericFamily will be used. + */ + fontFamily?: string; + + /** + * The text track generic family. + */ + fontGenericFamily?: TextTrackFontGenericFamily; + + /** + * The font scaling factor for the text track (the default is 1). + */ + fontScale?: number; + + /** + * The text track font style. + */ + fontStyle?: TextTrackFontStyle; + + /** + * The foreground 32 bit RGBA color. + */ + foregroundColor?: string; + + /** + * 32 bit RGBA color for the window. This value will be ignored if windowType is NONE. + */ + windowColor?: string; + + /** + * Rounded corner radius absolute value in pixels (px). This value will be ignored + * if windowType is not ROUNDED_CORNERS. + */ + windowRoundedCornerRadius?: number; + + /** + * The window concept is defined in CEA-608 and CEA-708. In WebVTT is called a region. + */ + windowType?: TextTrackWindowType; +} + +/** + * Media event playback rate request data. + */ +export interface SetPlaybackRateRequestData extends RequestData { + /** + * New playback rate (>0). + */ + playbackRate?: number; + + /** + * New playback rate relative to current playback rate. + * New rate will be the result of multiplying the current rate with the value. + * For example a value of 1.1 will increase rate by 10%. + * (Only used if the playbackRate value is not provided). + */ + relativePlaybackRate?: number; +} + +/** + * SetCredentials request data. + */ +export interface SetCredentialsRequestData { + /** + * Credentials to use by receiver. + */ + credentials?: string; + + /** + * If it is a response for refresh credentials; it will indicate the request id + * of the refresh credentials request. + */ + forRequestId?: number; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; +} + +/** + * Media event SEEK request data. + */ +export interface SeekRequestData extends RequestData { + /** + * Seconds since beginning of content. + */ + currentTime?: number; + + /** + * Seconds relative to the current playback position. If this field is defined; + * the currentTime field will be ignored. + */ + relativeTime?: number; + + /** + * The playback state after a SEEK request. + */ + resumeState?: SeekResumeState; +} + +/** + * Provides seekable range in seconds. + */ +export class SeekableRange { + constructor(start?: number, end?: number); + + /** + * End of the seekable range in seconds. + */ + end?: number; + + /** + * Start of the seekable range in seconds. + */ + start?: number; +} + +/** + * Media event request data. + */ +export class RequestData { + constructor(type: MessageType); + + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; +} + +/** + * Media event UPDATE queue request data. + */ +export interface QueueUpdateRequestData { + /** + * ID of the current media Item after the deletion + * (if not provided; the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; the currentItem will point to + * the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * List of queue items to be updated. No reordering will happen; the items will + * retain the existing order. + */ + items?: QueueItem[]; + + /** + * Skip/Go back number of items with respect to the position of currentItem + * (it can be negative). If it is out of boundaries; the currentItem will be the + * next logical item in the queue wrapping around the boundaries. + * The new currentItem position will follow the rules of the queue repeat behavior. + */ + jump?: number; + + /** + * Behavior of the queue when all items have been played. + */ + repeatMode?: RepeatMode; + + /** + * Shuffle the queue items when the update is processed. + * After the queue items are shuffled; the item at the currentItem position will + * be loaded. + */ + shuffle?: boolean; +} + +/** + * Media event queue REORDER request data. + */ +export class QueueReorderRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * ID of the current media Item after the deletion (if not provided; + * the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; + * the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like + * the QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * ID of the item that will be located immediately after the reordered list. + * If the ID is not found or it is not provided; + * the reordered list will be appended at the end of the existing list. + */ + insertBefore?: number; + + /** + * IDs of the items to be reordered; in the new order. + * Items not provided will keep their existing order. + * The provided list will be inserted at the position determined by insertBefore. + * For example: + * If insertBefore is not specified Existing queue: “A”;”D”;”G”;”H”;”B”;”E” itemIds: + * “D”;”H”;”B” New Order: “A”;”G”;”E”;“D”;”H”;”B” + * If insertBefore is “A” Existing queue: “A”;”D”;”G”;”H”;”B” itemIds: + * “D”;”H”;”B” New Order: “D”;”H”;”B”;“A”;”G”;”E” + * If insertBefore is “G” Existing queue: “A”;”D”;”G”;”H”;”B” itemIds: + * “D”;”H”;”B” New Order: “A”;“D”;”H”;”B”;”G”;”E” + */ + itemIds: number[]; +} + +/** + * Media event queue REMOVE request data. + */ +export class QueueRemoveRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * ID of the current media Item after the deletion + * (if not provided; the currentItem value will be the same as before the deletion; + * if it does not exist because it has been deleted; + * the currentItem will point to the next logical item in the list). + */ + currentItemId?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * IDs of queue items to be deleted. + */ + itemIds?: number[]; +} +/** + * Media event queue LOAD request data. + */ +export class QueueLoadRequestData extends RequestData { + constructor(items: QueueItem[]); + + /** + * Seconds (since the beginning of content) to start playback of the first item to + * be played. If provided; this value will take precedence over the + * startTime value provided at the QueueItem level but only the first + * time the item is played. This is to cover the common case where the user + * casts the item that was playing locally so the currentTime does not apply + * to the item permanently like the QueueItem startTime does. + * It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * Behavior of the queue when all items have been played. + */ + items: QueueItem[]; + + /** + * Id of the request; used to correlate request/response. + */ + repeatMode?: RepeatMode; + + /** + * The index of the item in the items array that must be the first currentItem + * (the item that will be played first). Note this is the index of the array + * (starts at 0) and not the itemId (as it is not known until the queue is created). + * If repeatMode is REPEAT_OFF playback will end when the last item in the array is + * played (elements before the startIndex will not be played). + * This may be useful for continuation scenarios where the user was already + * using the sender app and in the middle decides to cast. + * In this way the sender app does not need to map between the local and remote queue + * positions or saves one extra QUEUE_UPDATE request. + */ + startIndex?: number; +} + +/** + * Queue item information. Application developers may need to create a QueueItem to + * insert a queue element using InsertQueueItems. In this case they should not + * provide an itemId (as the actual itemId will be assigned when the item is inserted + * in the queue). This prevents ID collisions with items added from a sender app. + */ +export class QueueItem { + constructor(opt_itemId?: number); + + /** + * Array of Track trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds?: number[]; + + /** + * If the autoplay parameter is not specified or is true; the media player + * will begin playing the element in the queue when the item becomes the currentItem. + */ + autoplay?: boolean; + + /** + * The application can define any extra queue item information needed. + */ + customData?: any; + + /** + * Unique identifier of the item in the queue. + * The attribute is optional because for LOAD or INSERT should not be provided + * (as it will be assigned by the receiver when an item is first created/inserted). + */ + itemId?: number; + + /** + * Metadata (including contentId) of the playlist element. + */ + media?: MediaInformation; + + /** + * Playback duration of the item; if it is larger than the actual duration - + * startTime it will be ignored (default behavior). + * It can be negative; in such case the duration will be the actual asset + * duration minus the duration provided. + * It can be used for photo slideshows to control the duration the item should + * be presented or for live events to control the duration that the program + * should be played. It may be useful for autoplay scenarios to avoid displaying all + * the credits after an episode has ended. + */ + playbackDuration?: number; + + /** + * This parameter is a hint for the receiver to preload this media + * item before it is played. It allows for a smooth transition between items + * played from the queue. The time is expressed in seconds; relative to + * the beginning of this item playback (usually the end of the previous item playback). + * Only positive values are valid. For example; if the value is 10 seconds; this item + * will be preloaded 10 seconds before the previous item has finished. + * The receiver will try to honor this value but will not guarantee it; + * for example if the value is larger than the previous item duration the + * receiver may just preload this item shortly after the previous item has started playing + * (there will never be two items being preloaded in parallel). + * Also; if an item is inserted in the queue just after the currentItem and the time to preload is higher than the + * time left on the currentItem; the preload will just happen as soon as possible. + */ + preloadTime?: number; + + /** + * Seconds since beginning of content. If the content is live content; + * and startTime is not specified; the stream will start at the live position. + */ + startTime?: number; +} + +/** + * Media event queue INSERT request data. + */ +export class QueueInsertRequestData extends RequestData { + constructor(items: QueueItem[]); + + /** + * ID of the current media Item after the insertion (if not provided; + * the currentItem value will be the same as before the insertion). + */ + currentItemId?: number; + + /** + * Index (relative to the items array; starting with 0) of the new current media Item. + * For inserted items we use the index (similar to startIndex in QUEUE_LOAD) and not + * currentItemId; because the itemId is unknown until the items are inserted. + * If not provided; the currentItem value will be the same as before the insertion + * (unless currentItemId is provided). This param allows to make atomic the common use + * case of insert and play an item. + */ + currentItemIndex?: number; + + /** + * Seconds since the beginning of content to start playback of the current item. + * If provided; this value will take precedence over the startTime value provided + * at the QueueItem level but only the first time the item is played. + * This is to cover the common case where the user jumps to the middle of an + * item so the currentTime does not apply to the item permanently like the + * QueueItem startTime does. It avoids having to reset the startTime dynamically + * (that may not be possible if the phone has gone to sleep). + */ + currentTime?: number; + + /** + * ID of the item that will be located immediately after the inserted list. + * If the ID is not found or it is not provided; the list will be appended at + * the end of the existing list. + */ + insertBefore?: number; + + /** + * List of queue items. The itemId field of the items should be empty. + * It is sorted (first element will be played first). + */ + items: QueueItem[]; +} + +/** + * Represents a data message containing the full list of queue ids. + */ +export interface QueueIds { + /** + * List of queue item ids. + */ + itemIds?: number[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + type: MessageType; +} + +/** + * Queue data as part of the LOAD request. + */ +export class QueueData { + constructor( + id?: string, + name?: string, + description?: string, + repeatMode?: RepeatMode, + items?: QueueItem[], + startIndex?: number, + startTime?: number + ); + + /** + * Description of the queue. + */ + description?: string; + + /** + * Optional Queue entity id; provide Google Assistant deep link. + */ + entity?: string; + + /** + * Id of the queue. + */ + id?: string; + + /** + * Array of queue items. It is sorted (first element will be played first). + */ + items?: QueueItem[]; + + /** + * Name of the queue. + */ + name?: string; + + /** + * Queue type; e.g. album; playlist; radio station; tv series; etc. + */ + queueType?: QueueType; + + /** + * Continuous playback behavior of the queue. + */ + repeatMode?: RepeatMode; + + /** + * The index of the item in the queue that should be used to start playback first. + */ + startIndex?: number; + + /** + * Seconds (since the beginning of content) to start playback of the first item. + */ + startTime?: number; +} + +/** + * Represents a queue change message; such as insert; remove; and update. + */ +export interface QueueChange { + /** + * The actual queue change type. + */ + changeType?: QueueChangeType; + + /** + * The id to insert the list of itemIds before. + */ + insertBefore?: number; + + /** + * List of changed itemIds. + */ + itemIds?: number[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + /** + * The queue change sequence ID. Used to coordinate state sync between various + * senders and the receiver. + */ + sequenceNumber?: number; + + type: MessageType; +} + +/** + * Media event PRELOAD request data. + */ +export class PreloadRequestData implements LoadRequestData { + /** + * Array of trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds: number[]; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified;the media player + * implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + /** + * Optional user credentials. + */ + credentials?: string; + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load + * requests that were originated by voice assistant commands. + */ + credentialsType?: string; + /** + * Seconds since beginning of content. If the content is live content; + * and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; the media + * player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + /** + * The media playback rate. + */ + playbackRate?: number; + /** + * Queue data. + */ + queueData: QueueData; + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + constructor(itemId: number); + + /** + * The ID of the queue item. + */ + itemId: number; +} + +/** + * Media event PRECACHE request data. (Some fields of the load request; + * like autoplay and queueData; are ignored). + */ +export class PrecacheRequestData implements LoadRequestData { + /** + * Array of trackIds that are active. If the array is not provided; + * the default tracks will be active. + */ + activeTrackIds: number[]; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified;the media player + * implementation may choose to begin playback immediately. + */ + autoplay?: boolean; + /** + * Optional user credentials. + */ + credentials?: string; + /** + * Optional credentials type. The type 'cloud' is a reserved type used by load + * requests that were originated by voice assistant commands. + */ + credentialsType?: string; + /** + * Seconds since beginning of content. If the content is live content; and + * currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; + * the media player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + /** + * The media playback rate. + */ + playbackRate?: number; + /** + * Queue data. + */ + queueData: QueueData; + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + /** + * Id of the media session that the request applies to. + */ + mediaSessionId?: number; + /** + * Id of the request; used to correlate request/response. + */ + requestId: number; + constructor(data?: string); + + /** + * Application precache data. + */ + precacheData?: string; +} + +/** + * PlayString request data. + */ +export class PlayStringRequestData { + constructor(stringId: PlayStringId, opt_arguments?: string[]); + + /** + * An optional array of string values to be filled into the text. + */ + arguments?: string[]; + + /** + * An identifier for the text to be played back. + */ + stringId: PlayStringId; +} + +/** + * A photo media description. + */ +export interface PhotoMediaMetadata { + /** + * Name of the photographer. + */ + artist?: string; + + /** + * ISO 8601 date and time the photo was taken; e.g. 2014-02-10T15:47:00Z. + */ + creationDateTime?: string; + + /** + * Photo height; in pixels. + */ + height?: number; + + /** + * Images associated with the content. Examples would include a photo thumbnail. + */ + images: Image[]; + + /** + * Latitude. + */ + latitude?: number; + + /** + * Location where the photo was taken. For example; "Seattle; Washington; USA". + */ + location?: string; + + /** + * Longitude. + */ + longitude?: number; + + /** + * Photo title. + */ + title?: string; + + /** + * Photo width; in pixels. + */ + width?: number; +} + +/** + * A music track media description. + */ +export interface MusicTrackMediaMetadata { + /** + * Album artist name. + */ + albumArtist?: string; + + /** + * Album name. + */ + albumName?: string; + + /** + * Track artist name. + */ + artist?: string; + + /** + * @deprecated: use @see{@link artist} instead + */ + artistName: string; + + /** + * Track composer name. + */ + composer?: string; + + /** + * Disc number. A positive integer. + */ + discNumber?: number; + + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date when the track was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated: Use @see{@link releaseDate} instead + */ + releaseYear?: string; + + /** + * Track name. + */ + songName?: string; + + /** + * Track title. + */ + title?: string; + + /** + * Track number in album. A positive integer. + */ + trackNumber?: number; +} + +/** + * A movie media description. + */ +export interface MovieMediaMetadata { + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date when the movie was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated: use @see{@link releaseDate} instead + */ + releaseYear?: number; + + /** + * Movie studio. + */ + studio?: string; + + /** + * Movie subtitle. + */ + subtitle?: string; + + /** + * Movie title. + */ + title?: string; +} +/** + * Represents the status of a media session. + */ +export interface MediaStatus { + /** + * List of IDs corresponding to the active tracks. + */ + activeTrackIds: number[]; + + /** + * Status of break; if receiver is playing break. + * This field will be defined only when receiver is playing break. + */ + breakStatus: BreakStatus; + + /** + * ID of this media item (the item that originated the status change). + */ + currentItemId?: number; + + /** + * The current playback position. + */ + currentTime: number; + + /** + * Application-specific media status. + */ + customData?: any; + + /** + * Extended media status information. + */ + extendedStatus: ExtendedMediaStatus; + + /** + * If the state is IDLE; the reason the player went to IDLE state. + */ + idleReason: IdleReason; + + /** + * List of media queue items. + */ + items: QueueItem[]; + + /** + * Seekable range of a live or event stream. It uses relative media time in seconds. + * It will be undefined for VOD streams. + */ + liveSeekableRange: LiveSeekableRange; + + /** + * ID of the media Item currently loading. If there is no item being loaded; + * it will be undefined. + */ + loadingItemId?: number; + + /** + * The media information. + */ + media: MediaInformation; + + /** + * Unique id for the session. + */ + mediaSessionId: number; + + /** + * The playback rate. + */ + playbackRate: number; + + /** + * The playback state. + */ + playerState: PlayerState; + + /** + * ID of the next Item; only available if it has been preloaded. + * Media items can be preloaded and cached temporarily in memory; + * so when they are loaded later on; the process is faster + * (as the media does not have to be fetched from the network). + */ + preloadedItemId?: number; + + /** + * Queue data. + */ + queueData: QueueData; + + /** + * The behavior of the queue when all items have been played. + */ + repeatMode: RepeatMode; + + /** + * The commands supported by this player. + */ + supportedMediaCommands: number; + + type: MessageType; + + /** + * The video information. + */ + videoInfo: VideoInformation; + + /** + * The current stream volume. + */ + volume: Volume; +} +/** + * Common media metadata used as part of MediaInformation + */ +export class MediaMetadata { + constructor(type: MetadataType); + + /** + * The type of metadata + */ + metadataType: MetadataType; +} + +/** + * Represents the media information. + */ +export interface MediaInformation { + /** + * Partial list of break clips that includes current break clip that receiver + * is playing or ones that receiver will play shortly after; instead of sending + * whole list of clips. This is to avoid overflow of MediaStatus message. + */ + breakClips?: BreakClip[]; + + /** + * List of breaks. + */ + breaks?: Break[]; + + /** + * Typically the url of the media. + */ + contentId: string; + + /** + * The content MIME type. + */ + contentType: string; + + /** + * Optional media url; to allow using contentId for real id. If contentUrl + * is provided; it will be used as media url; otherwise the contentId will + * be used as the media url. + */ + contentUrl?: string; + + /** + * Application-specific media information. + */ + customData?: any; + + /** + * The media duration. + */ + duration?: number; + + /** + * Optional Media entity; provide Google Assistant deep link. + */ + entity?: string; + + /** + * The format of the HLS media segment. + */ + hlsSegmentFormat?: HlsSegmentFormat; + + /** + * The media metadata. + */ + metadata?: + | MediaMetadata + | GenericMediaMetadata + | MovieMediaMetadata + | MusicTrackMediaMetadata + | PhotoMediaMetadata + | TvShowMediaMetadata; + + /** + * The stream type. + */ + streamType: StreamType; + + /** + * The style of text track. + */ + textTrackStyle?: TextTrackStyle; + + /** + * The media tracks. + */ + tracks?: Track[]; +} + +/** + * Media event LOAD request data. + */ +export interface LoadRequestData extends RequestData { + /** + * Array of trackIds that are active. If the array is not provided; the + * default tracks will be active. + */ + activeTrackIds: number[]; + + /** + * If the autoplay parameter is specified; the media player will begin + * playing the content when it is loaded. Even if autoplay is not + * specified;the media player implementation may choose to begin playback + * immediately. + */ + autoplay?: boolean; + + /** + * Optional user credentials. + */ + credentials?: string; + + /** + * Optional credentials type. The type 'cloud' is a reserved type used by + * load requests that were originated by voice assistant commands. + */ + credentialsType?: string; + + /** + * Seconds since beginning of content. If the content is live content; + * and currentTime is not specified; the stream will start at the live position. + */ + currentTime?: number; + + /** + * If the autoplay parameter is specified; the media player will begin playing + * the content when it is loaded. Even if autoplay is not specified; the media + * player implementation may choose to begin playback immediately. + */ + media: MediaInformation; + + /** + * The media playback rate. + */ + playbackRate?: number; + + /** + * Queue data. + */ + queueData: QueueData; +} + +/** + * LoadByEntity request data. + */ +export interface LoadByEntityRequestData { + /** + * Content entity information; typically represented by a stringified JSON object + */ + entity: string; + + /** + * Shuffle the items to play. + */ + shuffle?: boolean; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source?: string; +} + +/** + * Provides live seekable range with start and end time in seconds and two more + * attributes. + */ +export class LiveSeekableRange { + constructor( + start?: number, + end?: number, + isMovingWindow?: boolean, + isLiveDone?: boolean + ); + + /** + * A boolean value indicates whether a live stream is ended. If it is done; + * the end of live seekable range should stop updating. + */ + isLiveDone?: boolean; + + /** + * A boolean value indicates whether the live seekable range is a moving window. + * If false; it will be either a expanding range or a fixed range meaning live + * has ended. + */ + isMovingWindow?: boolean; +} + +/** + * Represents a data message containing item information for each requested ids. + */ +export interface ItemsInfo { + /** + * List of changed itemIds. + */ + items: QueueItem[]; + + /** + * The corresponding request id. + */ + requestId?: number; + + type: MessageType; +} + +/** + * An image that describes a receiver application or media item. + * This could be an application icon; cover art; or a thumbnail. + */ +export class Image { + constructor(url: string); + + /** + * The height of the image. + */ + height?: number; + + /** + * the URL to the image + */ + url: string; + + /** + * The width of the image + */ + width?: number; +} +/** Media event GET_STATUS request data. */ +export interface GetStatusRequestData extends RequestData { + /** + * The options of a GET_STATUS request. + */ + options: GetStatusOptions; +} + +/** + * Get items info request data. + */ +export class GetItemsInfoRequestData extends RequestData { + constructor(itemIds: number[]); + + /** + * List of item ids to be requested. + */ + itemIds: number[]; +} +/** + * A generic media description. + */ +export interface GenericMediaMetadata extends MediaMetadata { + /** + * Content images. Examples would include cover art or a thumbnail of the + * currently playing media. + */ + images: Image[]; + + /** + * ISO 8601 date and/or time when the content was released; e.g. 2014-02-10. + */ + releaseDate?: string; + + /** + * @deprecated - use @see{@link releaseDate} instead + */ + releaseYear?: number; + + /** + * Content subtitle. + */ + subtitle?: string; + + /** + * Content title. + */ + title?: string; +} + +/** + * Focus state change message. + */ +export interface FocusStateRequestData { + /** + * The focus state of the app. + */ + state: FocusState; +} + +/** Fetch items request data. */ +export class FetchItemsRequestData extends RequestData { + constructor(itemId: number, nextCount: number, prevCount: number); + + /** + * ID of the reference media item for fetching more items. + */ + itemId: number; + + /** + * Number of items after the reference item to be fetched. + */ + nextCount: number; + + /** + * Number of items before the reference item to be fetched. + */ + prevCount: number; +} + +/** + * Extended media status information + */ +export class ExtendedMediaStatus { + constructor( + playerState: MediaInformation, + opt_media?: MediaInformation + ); + + media: MediaInformation; + + playerState: ExtendedPlayerState; +} + +/** Event data for @see{@link EventType.ERROR} event. */ +export class ErrorEvent extends Event { + constructor(detailedErrorCode?: DetailedErrorCode, error?: any); + + /** + * An error code representing the cause of the error. + */ + detailedErrorCode?: DetailedErrorCode; + + /** + * The error object. + * This could be an Error object (e.g.; if an Error was thrown in an event handler) + * or an object with error information (e.g.; if the receiver received an invalid + * command). + */ + error?: any; +} + +export class ErrorData { + constructor(type: ErrorType); + + /** + * Application-specific data for this request. + * It enables the sender and receiver to easily extend the media protocol + * without having to use a new namespace with custom messages. + */ + customData?: any; + + /** + * Id of the request; used to correlate request/response. + */ + requestId?: number; +} + +/** Media event EDIT_TRACKS_INFO request data. */ +export interface EditTracksInfoRequestData extends RequestData { + /** + * Array of the Track trackIds that should be active. + * If it is not provided; the active tracks will not change. + * If the array is empty; no track will be active. + */ + activeTrackIds?: number[]; + + /** + * Flag to enable or disable text tracks. + * If false it will disable all text tracks; + * if true it will enable the first text track; or the previous active text tracks. + * This flag is ignored if activeTrackIds or language is provided. + */ + enableTextTracks?: boolean; + + /** + * Indicates that the provided language was not explicit user request; but rather + * inferred from used language in voice query. + * It allows receiver apps to use user saved preference instead of spoken language. + */ + isSuggestedLanguage?: boolean; + + /** + * Language for the tracks that should be active. The language field will take + * precedence over activeTrackIds if both are specified. + */ + language?: string; + + textTrackStyle?: TextTrackStyle; +} + +/** + * Media event EDIT_AUDIO_TRACKS request data. If language is not provided; + * the default audio track for the media will be enabled. + */ +export interface EditAudioTracksRequestData extends RequestData { + /** + * Indicates that the provided language was not explicit user request; + * but rather inferred from used language in voice query. + * It allows receiver apps to use user saved preference instead of spoken language. + */ + isSuggestedLanguage?: boolean; + + language?: string; +} + +/** DisplayStatus request data. */ +export interface DisplayStatusRequestData { + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source: string; +} + +/** CustomCommand request data. */ +export interface CustomCommandRequestData { + /** + * Custom Data; typically represented by a stringified JSON object. + */ + data: string; + + /** + * Optional request source. It contain the assistent query that initiate the request. + */ + source: string; +} + +export class BreakStatus { + constructor(currentBreakTime: number, currentBreakClipTime: number); + + /** + * Id of current break clip. + */ + breakClipId: string; + + /** + * Id of current break. + */ + breakId: string; + + /** + * Time in sec elapsed after current break clip starts. + */ + currentBreakClipTime: number; + + /** + * Time in sec elapsed after current break starts. + */ + currentBreakTime: number; + + /** + * The time in sec when this break clip becomes skippable. + * 5 means that end user can skip this break clip after 5 seconds. + * If this field is not defined; it means that current break clip is not skippable. + */ + whenSkippable: number; +} + +/** + * Represents break clip (e.g. a clip of ad during ad break) + */ +export class BreakClip { + constructor(id: string); + + /** + * Url of page that sender will display; when end user clicks link on sender UI; while receiver is playing this clip. + */ + clickThroughUrl?: string; + /** + * Typically the url of the break media (playing on the receiver). + */ + contentId?: string; + /** + * The content MIME type. + */ + contentType?: string; + /** + * Optional break media url; to allow using contentId for real id. + * If contentUrl is provided; it will be used as media url; + * otherwise the contentId will be used as the media url. + */ + contentUrl?: string; + /** + * Application-specific break clip data. + */ + customData?: any; + /** + * Duration of break clip in sec. + */ + duration?: number; + /** + * The format of the HLS media segment. + */ + hlsSegmentFormat?: HlsSegmentFormat; + /** + * Unique id of break clip. + */ + id: string; + /** + * Url of content that sender will display while receiver is playing this clip. + */ + posterUrl?: string; + /** + * Title of break clip. Sender might display this on its screen; if provided. + */ + title?: string; + /** + * VAST ad request configuration. Used if contentId or contentUrl is not provided. + */ + vastAdsRequest?: VastAdsRequest; + /** + * The time in sec when this break clip becomes skippable. + * 5 means that end user can skip this break clip after 5 seconds. + * If this field is not defined; it means that current break clip is not skippable. + */ + whenSkippable?: number; +} + +/** Represents break (e.g. ad break) included in main video. */ +export class Break { + constructor(id: string, breakClipIds: string[], position: number); + /** + * List of ids of break clip that this break includes. + */ + breakClipIds: string[]; + /** + * Duration of break in sec. + */ + duration?: number; + /** + * Unique id of break. + */ + id: string; + /** + * If true; indicates this is embedded break in main stream. + */ + + isEmbedded?: boolean; + /** + * Whether break is watched. + * Sender can change color of progress bar marker corresponding to this break once + * this field changes from false to true; + * denoting that the end-user already watched this break. + */ + isWatched: boolean; + + /** + * Where the break is located inside main video. -1 represents the end of main video. + */ + position: number; } diff --git a/types/chromecast-caf-receiver/cast.framework.system.d.ts b/types/chromecast-caf-receiver/cast.framework.system.d.ts index d055e252fb..1aacb05058 100644 --- a/types/chromecast-caf-receiver/cast.framework.system.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.system.d.ts @@ -1,198 +1,196 @@ import { EventType } from "./cast.framework.events"; -export = cast.framework.system; -declare namespace cast.framework.system { - type EventType = - // Fired when the system is ready. - | "READY" - // Fired when the application is terminated - | "SHUTDOWN" - // Fired when a new sender has connected. - | "SENDER_CONNECTED" - // Fired when a sender has disconnected. - | "SENDER_DISCONNECTED" - // Fired when there is a system error. - | "ERROR" - // Fired when the system volume has changed. - | "SYSTEM_VOLUME_CHANGED" - // Fired when the visibility of the application has changed - // (for example after a HDMI Input change or when the TV is turned - // off/on and the cast device is externally powered). - // Note that this API has the same effect as the webkitvisibilitychange event raised - // by your document, we provided it as CastReceiverManager API for convenience and - // to avoid a dependency on a webkit-prefixed event. - | "VISIBILITY_CHANGED" - // Fired when the standby state of the TV has changed. - // This event is related to the visibility chnaged event, as if the TV is in standby - // the visibility will be false, the visibility is more granular - // (as it also detects that the TV has selected a different channel) - // but it is not reliably detected in all TVs, - // standby can be used in those cases as most TVs implement it. - | "STANDBY_CHANGED" - | "MAX_VIDEO_RESOLUTION_CHANGED" - | "FEEDBACK_STARTED"; +export as namespace system +export type EventType = + // Fired when the system is ready. + | "READY" + // Fired when the application is terminated + | "SHUTDOWN" + // Fired when a new sender has connected. + | "SENDER_CONNECTED" + // Fired when a sender has disconnected. + | "SENDER_DISCONNECTED" + // Fired when there is a system error. + | "ERROR" + // Fired when the system volume has changed. + | "SYSTEM_VOLUME_CHANGED" + // Fired when the visibility of the application has changed + // (for example after a HDMI Input change or when the TV is turned + // off/on and the cast device is externally powered). + // Note that this API has the same effect as the webkitvisibilitychange event raised + // by your document, we provided it as CastReceiverManager API for convenience and + // to avoid a dependency on a webkit-prefixed event. + | "VISIBILITY_CHANGED" + // Fired when the standby state of the TV has changed. + // This event is related to the visibility chnaged event, as if the TV is in standby + // the visibility will be false, the visibility is more granular + // (as it also detects that the TV has selected a different channel) + // but it is not reliably detected in all TVs, + // standby can be used in those cases as most TVs implement it. + | "STANDBY_CHANGED" + | "MAX_VIDEO_RESOLUTION_CHANGED" + | "FEEDBACK_STARTED"; - type SystemState = - | "NOT_STARTED" - | "STARTING_IN_BACKGROUND" - | "STARTING" - | "READY" - | "STOPPING_IN_BACKGROUND" - | "STOPPING"; +export type SystemState = + | "NOT_STARTED" + | "STARTING_IN_BACKGROUND" + | "STARTING" + | "READY" + | "STOPPING_IN_BACKGROUND" + | "STOPPING"; - type StandbyState = "STANDBY" | "NOT_STANDBY" | "UNKNOWN"; +export type StandbyState = "STANDBY" | "NOT_STANDBY" | "UNKNOWN"; - type DisconnectReason = "REQUESTED_BY_SENDER" | "ERROR" | "UNKNOWN"; +export type DisconnectReason = "REQUESTED_BY_SENDER" | "ERROR" | "UNKNOWN"; + +/** + * Event dispatched by @see{@link CastReceiverManager} when the visibility of the application changes (HDMI input change; TV is turned off). + */ +export class VisibilityChangedEvent { + constructor(isVisible: boolean); /** - * Event dispatched by @see{@link CastReceiverManager} when the visibility of the application changes (HDMI input change; TV is turned off). + * Whether the Cast device is the active input or not. */ - class VisibilityChangedEvent { - constructor(isVisible: boolean); - - /** - * Whether the Cast device is the active input or not. - */ - isVisible: boolean; - } - - /** - * Represents the system volume data. - */ - interface SystemVolumeData { - /** - * The level (from 0.0 to 1.0) of the system volume - */ - level: number; - - /** - * Whether the system volume is muted or not. - */ - muted: boolean; - } - /** - * Event dispatched by @see{CastReceiverManager} when the system volume changes. - */ - class SystemVolumeChangedEvent extends Event { - constructor(volume: SystemVolumeData); - - /** - * The system volume data - */ - data: SystemVolumeData; - } - /** - * Event dispatched by @see{@link CastReceiverManager} when the TV enters/leaves the standby state. - */ - class StandbyChangedEvent { - constructor(isStandby: boolean); - - isStandby: boolean; - } - /** - * Whether the TV is in standby or not. - */ - interface ShutdownEvent extends Event { - [key: string]: any; - } - - /** - * Event dispatched by @see{@link CastReceiverManager} when a sender is disconnected. - */ - class SenderDisconnectedEvent extends Event { - constructor(senderId: string, userAgent: string); - /** - * The ID of the sender connected. - */ - senderId: string; - - /** - * The user agent of the sender. - */ - userAgent: string; - - /** - * The reason the sender was disconnected. - */ - reason?: DisconnectReason; - } - - /** - * Event dispatched by @see{@link CastReceiverManager} when a sender is connected. - */ - class SenderConnectedEvent extends Event { - constructor(senderId: string, userAgent: string); - /** - * The ID of the sender connected. - */ - senderId: string; - - /** - * The user agent of the sender. - */ - userAgent: string; - } - - /** - * Represents the data of a connected sender device. - */ - interface Sender { - /** - * The sender Id. - */ - id: string; - - /** - * Indicate the sender supports large messages (>64KB) - */ - largeMessageSupported?: boolean; - - /** - * The userAgent of the sender. - */ - userAgent?: string; - } - - /** - * Event dispatched by CastReceiverManager when the system is ready. - */ - class ReadyEvent { - constructor(applicationData: ApplicationData); - - /** - * The application data - */ - data: ApplicationData; - } - - /** - * Event dispatched by @see{@link CastReceiverManager} when the system needs to update the restriction on maximum video resolution. - */ - class MaxVideoResolutionChangedEvent extends Event { - constructor(height: number); - - /** - * Maximum video resolution requested by the system. The value of 0 means there is no restriction. - */ - height: number; - } - /** Event dispatched by @see{@link CastReceiverManager} when the systems starts to create feedback report. */ - interface FeedbackStartedEvent extends Event { - [key: string]: any; - } - /** Event dispatched by @see{@link CastReceiverContext} which contains system information. */ - class Event { - constructor(type: EventType, data?: any); - type: EventType; - data?: any; - } - - /** Represents the data of the launched application. */ - interface ApplicationData { - id(): string; - launchingSenderId(): string; - name(): string; - namespaces(): string[]; - sessionId(): number; - } + isVisible: boolean; +} + +/** + * Represents the system volume data. + */ +export interface SystemVolumeData { + /** + * The level (from 0.0 to 1.0) of the system volume + */ + level: number; + + /** + * Whether the system volume is muted or not. + */ + muted: boolean; +} +/** + * Event dispatched by @see{CastReceiverManager} when the system volume changes. + */ +export class SystemVolumeChangedEvent extends Event { + constructor(volume: SystemVolumeData); + + /** + * The system volume data + */ + data: SystemVolumeData; +} +/** + * Event dispatched by @see{@link CastReceiverManager} when the TV enters/leaves the standby state. + */ +export class StandbyChangedEvent { + constructor(isStandby: boolean); + + isStandby: boolean; +} +/** + * Whether the TV is in standby or not. + */ +export interface ShutdownEvent extends Event { + [key: string]: any; +} + +/** + * Event dispatched by @see{@link CastReceiverManager} when a sender is disconnected. + */ +export class SenderDisconnectedEvent extends Event { + constructor(senderId: string, userAgent: string); + /** + * The ID of the sender connected. + */ + senderId: string; + + /** + * The user agent of the sender. + */ + userAgent: string; + + /** + * The reason the sender was disconnected. + */ + reason?: DisconnectReason; +} + +/** + * Event dispatched by @see{@link CastReceiverManager} when a sender is connected. + */ +export class SenderConnectedEvent extends Event { + constructor(senderId: string, userAgent: string); + /** + * The ID of the sender connected. + */ + senderId: string; + + /** + * The user agent of the sender. + */ + userAgent: string; +} + +/** + * Represents the data of a connected sender device. + */ +export interface Sender { + /** + * The sender Id. + */ + id: string; + + /** + * Indicate the sender supports large messages (>64KB) + */ + largeMessageSupported?: boolean; + + /** + * The userAgent of the sender. + */ + userAgent?: string; +} + +/** + * Event dispatched by CastReceiverManager when the system is ready. + */ +export class ReadyEvent { + constructor(applicationData: ApplicationData); + + /** + * The application data + */ + data: ApplicationData; +} + +/** + * Event dispatched by @see{@link CastReceiverManager} when the system needs to update the restriction on maximum video resolution. + */ +export class MaxVideoResolutionChangedEvent extends Event { + constructor(height: number); + + /** + * Maximum video resolution requested by the system. The value of 0 means there is no restriction. + */ + height: number; +} +/** Event dispatched by @see{@link CastReceiverManager} when the systems starts to create feedback report. */ +export interface FeedbackStartedEvent extends Event { + [key: string]: any; +} +/** Event dispatched by @see{@link CastReceiverContext} which contains system information. */ +export class Event { + constructor(type: EventType, data?: any); + type: EventType; + data?: any; +} + +/** Represents the data of the launched application. */ +export interface ApplicationData { + id(): string; + launchingSenderId(): string; + name(): string; + namespaces(): string[]; + sessionId(): number; } diff --git a/types/chromecast-caf-receiver/cast.framework.ui.d.ts b/types/chromecast-caf-receiver/cast.framework.ui.d.ts index 77d93c8082..cd3fb79e2a 100644 --- a/types/chromecast-caf-receiver/cast.framework.ui.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.ui.d.ts @@ -1,197 +1,193 @@ import { PlayerDataEventType } from "./cast.framework.ui"; import { MediaMetadata } from "./cast.framework.messages"; -import { PlayerDataChangedEventHandler } from "./index"; -export = cast.framework.ui; +export as namespace ui +export type ContentType = "video" | "audio" | "image"; -declare namespace cast.framework.ui { - type ContentType = "video" | "audio" | "image"; +export type State = + | "launching" + | "idle" + | "loading" + | "buffering" + | "paused" + | "playing"; - type State = - | "launching" - | "idle" - | "loading" - | "buffering" - | "paused" - | "playing"; +export type PlayerDataEventType = + | "ANY_CHANGE" + | "STATE_CHANGED" + | "IS_SEEKING_CHANGED" + | "DURATION_CHANGED" + | "CURRENT_TIME_CHANGED" + | "METADATA_CHANGED" + | "TITLE_CHANGED" + | "SUBTITLE_CHANGED" + | "THUMBNAIL_URL_CHANGED" + | "NEXT_TITLE_CHANGED" + | "NEXT_SUBTITLE_CHANGED" + | "NEXT_THUMBNAIL_URL_CHANGED" + | "PRELOADING_NEXT_CHANGED" + | "CONTENT_TYPE_CHANGED" + | "IS_LIVE_CHANGED" + | "BREAK_PERCENTAGE_POSITIONS_CHANGED" + | "IS_PLAYING_BREAK_CHANGED" + | "IS_BREAK_SKIPPABLE_CHANGED" + | "WHEN_SKIPPABLE_CHANGED" + | "NUMBER_BREAK_CLIPS_CHANGED" + | "CURRENT_BREAK_CLIP_NUMBER_CHANGED" + | "DISPLAY_STATUS_CHANGED"; - type PlayerDataEventType = - | "ANY_CHANGE" - | "STATE_CHANGED" - | "IS_SEEKING_CHANGED" - | "DURATION_CHANGED" - | "CURRENT_TIME_CHANGED" - | "METADATA_CHANGED" - | "TITLE_CHANGED" - | "SUBTITLE_CHANGED" - | "THUMBNAIL_URL_CHANGED" - | "NEXT_TITLE_CHANGED" - | "NEXT_SUBTITLE_CHANGED" - | "NEXT_THUMBNAIL_URL_CHANGED" - | "PRELOADING_NEXT_CHANGED" - | "CONTENT_TYPE_CHANGED" - | "IS_LIVE_CHANGED" - | "BREAK_PERCENTAGE_POSITIONS_CHANGED" - | "IS_PLAYING_BREAK_CHANGED" - | "IS_BREAK_SKIPPABLE_CHANGED" - | "WHEN_SKIPPABLE_CHANGED" - | "NUMBER_BREAK_CLIPS_CHANGED" - | "CURRENT_BREAK_CLIP_NUMBER_CHANGED" - | "DISPLAY_STATUS_CHANGED"; +/** + * Player data changed event. Provides the changed field (type); and new value. + */ +export class PlayerDataChangedEvent { + constructor(type: PlayerDataEventType, field: string, value: any); /** - * Player data changed event. Provides the changed field (type); and new value. + * The field name that was changed. */ - class PlayerDataChangedEvent { - constructor(type: PlayerDataEventType, field: string, value: any); + field: string; - /** - * The field name that was changed. - */ - field: string; + type: PlayerDataEventType; - type: PlayerDataEventType; - - /** - * The new field value. - */ - value: any; - } /** - * Player data binder. Bind a player data object to the player state. - * The player data will be updated to reflect correctly the current player state without firing any change event. + * The new field value. */ - class PlayerDataBinder { - constructor(playerData: PlayerData); - - /** - * Add listener to player data changes. - */ - addEventListener: ( - type: PlayerDataEventType, - listener: PlayerDataChangedEventHandler - ) => void; - - /** - * Remove listener to player data changes. - */ - removeEventListener: ( - type: PlayerDataEventType, - listener: PlayerDataChangedEventHandler - ) => void; - } - /** - * Player data. Provide the player media and break state. - */ - interface PlayerData { - /** - * Array of breaks positions in percentage. - */ - breakPercentagePositions: number[]; - - /** - * Content Type. - */ - contentType: ContentType; - - /** - * The number of the current playing break clip in the break. - */ - currentBreakClipNumber: number; - - /** - * Media current position in seconds; or break current position if playing break. - */ - currentTime: number; - - /** - * Whether the player metadata (ie: title; currentTime) should be displayed. - * This will be true if at least one field in the metadata should be displayed. - * In some cases; displayStatus will be true; but parts of the metadata should be hidden - * (ie: the media title while media is seeking). - * In these cases; additional css can be applied to hide those elements. - * For cases where the media is audio-only; this will almost always be true. - * In cases where the media is video; this will be true when: - * (1) the video is loading; buffering; or seeking - * (2) a play request was made in the last five seconds while media is already playing; - * (3) there is a request made to show the status in the last five seconds; or - * (4) the media was paused in the last five seconds. - */ - displayStatus: boolean; - - /** - * Media duration in seconds; Or break duration if playing break. - */ - duration: number; - - /** - * Indicate break clip can be skipped. - */ - isBreakSkippable: boolean; - - /** - * Indicate if the content is a live stream. - */ - isLive: boolean; - - /** - * Indicate that the receiver is playing a break. - */ - isPlayingBreak: boolean; - - /** - * Indicate the player is seeking (can be either during playing or pausing). - */ - isSeeking: boolean; - - /** - * Media metadata. - */ - metadata: MediaMetadata; - - /** - * Next Item subtitle. - */ - nextSubtitle: string; - - /** - * Next Item thumbnail url. - */ - nextThumbnailUrl: string; - - /** - * Next Item title. - */ - nextTitle: string; - - /** - * Number of break clips in current break. - */ - numberBreakClips: number; - - /** - * Flag to show/hide next item metadata. - */ - preloadingNext: boolean; - - /** - * Current player state. - */ - state: State; - - /** - * Content thumbnail url. - */ - thumbnailUrl: string; - - /** - * Content title. - */ - title: string; - - /** - * Provide the time a break is skipable - relative to current playback time. Undefined if not skippable. - */ - whenSkippable?: number; - } + value: any; +} +/** + * Player data binder. Bind a player data object to the player state. + * The player data will be updated to reflect correctly the current player state without firing any change event. + */ +export class PlayerDataBinder { + constructor(playerData: PlayerData); + + /** + * Add listener to player data changes. + */ + addEventListener: ( + type: PlayerDataEventType, + listener: PlayerDataChangedEventHandler + ) => void; + + /** + * Remove listener to player data changes. + */ + removeEventListener: ( + type: PlayerDataEventType, + listener: PlayerDataChangedEventHandler + ) => void; +} +/** + * Player data. Provide the player media and break state. + */ +export interface PlayerData { + /** + * Array of breaks positions in percentage. + */ + breakPercentagePositions: number[]; + + /** + * Content Type. + */ + contentType: ContentType; + + /** + * The number of the current playing break clip in the break. + */ + currentBreakClipNumber: number; + + /** + * Media current position in seconds; or break current position if playing break. + */ + currentTime: number; + + /** + * Whether the player metadata (ie: title; currentTime) should be displayed. + * This will be true if at least one field in the metadata should be displayed. + * In some cases; displayStatus will be true; but parts of the metadata should be hidden + * (ie: the media title while media is seeking). + * In these cases; additional css can be applied to hide those elements. + * For cases where the media is audio-only; this will almost always be true. + * In cases where the media is video; this will be true when: + * (1) the video is loading; buffering; or seeking + * (2) a play request was made in the last five seconds while media is already playing; + * (3) there is a request made to show the status in the last five seconds; or + * (4) the media was paused in the last five seconds. + */ + displayStatus: boolean; + + /** + * Media duration in seconds; Or break duration if playing break. + */ + duration: number; + + /** + * Indicate break clip can be skipped. + */ + isBreakSkippable: boolean; + + /** + * Indicate if the content is a live stream. + */ + isLive: boolean; + + /** + * Indicate that the receiver is playing a break. + */ + isPlayingBreak: boolean; + + /** + * Indicate the player is seeking (can be either during playing or pausing). + */ + isSeeking: boolean; + + /** + * Media metadata. + */ + metadata: MediaMetadata; + + /** + * Next Item subtitle. + */ + nextSubtitle: string; + + /** + * Next Item thumbnail url. + */ + nextThumbnailUrl: string; + + /** + * Next Item title. + */ + nextTitle: string; + + /** + * Number of break clips in current break. + */ + numberBreakClips: number; + + /** + * Flag to show/hide next item metadata. + */ + preloadingNext: boolean; + + /** + * Current player state. + */ + state: State; + + /** + * Content thumbnail url. + */ + thumbnailUrl: string; + + /** + * Content title. + */ + title: string; + + /** + * Provide the time a break is skipable - relative to current playback time. Undefined if not skippable. + */ + whenSkippable?: number; } diff --git a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts index 08ce57cf86..0df790c5f7 100644 --- a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts +++ b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts @@ -1,64 +1,60 @@ -import { - PlayerData, - PlayerDataBinder -} from "chromecast-caf-receiver/cast.framework.ui"; -import { - ReadyEvent, - ApplicationData -} from "chromecast-caf-receiver/cast.framework.system"; -import { - RequestEvent, - Event, - BreaksEvent -} from "chromecast-caf-receiver/cast.framework.events"; -import { - QueueBase, - TextTracksManager, - QueueManager, - PlayerManager -} from "chromecast-caf-receiver/cast.framework"; -import { - BreakSeekData, - BreakClipLoadInterceptorContext, - BreakManager -} from "chromecast-caf-receiver/cast.framework.breaks"; -import { - Break, - BreakClip, - LoadRequestData, - Track, - MediaMetadata -} from "chromecast-caf-receiver/cast.framework.messages"; +import { MediaMetadata } from "chromecast-caf-receiver/cast.framework.messages"; -const breaksEvent = new BreaksEvent('BREAK_STARTED'); -breaksEvent.breakId = 'some-break-id'; -breaksEvent.breakClipId = 'some-break-clip-id'; +// The following test showcases how you can import individual types directly from the namespace: -const track = new Track(1, "TEXT"); -const breakClip = new BreakClip("id"); -const adBreak = new Break("id", ["id"], 1); -const rEvent = new RequestEvent("BITRATE_CHANGED", { requestId: 2 }); -const pManager = new PlayerManager(); -pManager.addEventListener("STALLED", () => { }); -const ttManager = new TextTracksManager(); -const qManager = new QueueManager(); -const qBase = new QueueBase(); +const mediaMetadata = new MediaMetadata("GENERIC"); +mediaMetadata.metadataType = "TV_SHOW"; + +// The following tests showcase how you can globally access 'cast' types using +// the nested namespace style. This is the preferred method as it +// conforms exactly to the CAF documentation. + +// tslint:disable-next-line +const breaksEvent = new cast.framework.events.BreaksEvent("BREAK_STARTED"); +breaksEvent.breakId = "some-break-id"; +breaksEvent.breakClipId = "some-break-clip-id"; + +// tslint:disable-next-line +const track = new cast.framework.messages.Track(1, "TEXT"); +// tslint:disable-next-line +const breakClip = new cast.framework.messages.BreakClip("id"); +// tslint:disable-next-line +const adBreak = new cast.framework.messages.Break("id", ["id"], 1); +// tslint:disable-next-line +const rEvent = new cast.framework.events.RequestEvent("BITRATE_CHANGED", { + requestId: 2 +}); +// tslint:disable-next-line +const pManager = new cast.framework.PlayerManager(); +pManager.addEventListener("STALLED", () => {}); +// tslint:disable-next-line +const ttManager = new cast.framework.TextTracksManager(); +// tslint:disable-next-line +const qManager = new cast.framework.QueueManager(); +// tslint:disable-next-line +const qBase = new cast.framework.QueueBase(); const items = qBase.fetchItems(1, 3, 4); -const breakSeekData = new BreakSeekData(0, 100, []); -const breakClipLoadContext = new BreakClipLoadInterceptorContext(adBreak); -const breakManager: BreakManager = { +// tslint:disable-next-line +const breakSeekData = new cast.framework.breaks.BreakSeekData(0, 100, []); +// tslint:disable-next-line +const breakClipLoadContext = new cast.framework.breaks.BreakClipLoadInterceptorContext( + adBreak +); +// tslint:disable-next-line +const breakManager: cast.framework.breaks.BreakManager = { getBreakById: () => adBreak, getBreakClipById: () => breakClip, getBreakClips: () => [breakClip], getBreaks: () => [adBreak], getPlayWatchedBreak: () => true, - setBreakClipLoadInterceptor: () => { }, - setBreakSeekInterceptor: () => { }, - setPlayWatchedBreak: () => { }, - setVastTrackingInterceptor: () => { } + setBreakClipLoadInterceptor: () => {}, + setBreakSeekInterceptor: () => {}, + setPlayWatchedBreak: () => {}, + setVastTrackingInterceptor: () => {} }; -const lrd: LoadRequestData = { +// tslint:disable-next-line +const lrd: cast.framework.messages.LoadRequestData = { requestId: 1, activeTrackIds: [1, 2], media: { @@ -75,7 +71,8 @@ const lrd: LoadRequestData = { queueData: {} }; -const appData: ApplicationData = { +// tslint:disable-next-line +const appData: cast.framework.system.ApplicationData = { id: () => "id", launchingSenderId: () => "launch-id", name: () => "name", @@ -83,9 +80,11 @@ const appData: ApplicationData = { sessionId: () => 1 }; -const readyEvent = new ReadyEvent(appData); +// tslint:disable-next-line +const readyEvent = new cast.framework.system.ReadyEvent(appData); const data = readyEvent.data; -const pData: PlayerData = { +// tslint:disable-next-line +const pData: cast.framework.ui.PlayerData = { breakPercentagePositions: [1], contentType: "video", currentBreakClipNumber: 2, @@ -96,7 +95,8 @@ const pData: PlayerData = { isLive: true, isPlayingBreak: false, isSeeking: true, - metadata: new MediaMetadata("GENERIC"), + // tslint:disable-next-line + metadata: new cast.framework.messages.MediaMetadata("GENERIC"), nextSubtitle: "sub", nextThumbnailUrl: "url", nextTitle: "title", @@ -107,5 +107,6 @@ const pData: PlayerData = { title: "title", whenSkippable: 321 }; -const binder = new PlayerDataBinder(pData); -binder.addEventListener("ANY_CHANGE", e => { }); +// tslint:disable-next-line +const binder = new cast.framework.ui.PlayerDataBinder(pData); +binder.addEventListener("ANY_CHANGE", e => {}); diff --git a/types/chromecast-caf-receiver/index.d.ts b/types/chromecast-caf-receiver/index.d.ts index 73a13f53ca..444dba0af4 100644 --- a/types/chromecast-caf-receiver/index.d.ts +++ b/types/chromecast-caf-receiver/index.d.ts @@ -11,14 +11,18 @@ /// /// +import * as framework from "./cast.framework"; import { PlayerDataChangedEvent } from './cast.framework.ui'; -import { NetworkRequestInfo } from './cast.framework'; import { Event } from './cast.framework.events'; export as namespace cast; -export type EventHandler = (event: Event) => void; -export type PlayerDataChangedEventHandler = ( - event: PlayerDataChangedEvent -) => void; -export type RequestHandler = (request: NetworkRequestInfo) => void; -export type BinaryHandler = (data: Uint8Array) => Uint8Array; +export { framework }; + +declare global { + type EventHandler = (event: Event) => void; + type PlayerDataChangedEventHandler = ( + event: PlayerDataChangedEvent + ) => void; + type RequestHandler = (request: framework.NetworkRequestInfo) => void; + type BinaryHandler = (data: Uint8Array) => Uint8Array; +} diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index a6f9c9cf5c..1321d5b83d 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -289,6 +289,17 @@ function test_dom_node() { strong.insertBefore(em); strong.insertBeforeMe(em); element.isReadOnly(); + var prev = node.getPreviousSourceNode(); + prev = node.getPreviousSourceNode(true); + prev = node.getPreviousSourceNode(true, CKEDITOR.NODE_TEXT); + prev = node.getPreviousSourceNode(true, CKEDITOR.NODE_COMMENT, node); + prev = node.getPreviousSourceNode(true, CKEDITOR.NODE_COMMENT, (current: CKEDITOR.dom.node) => false); + var next = node.getNextSourceNode(); + next = node.getNextSourceNode(true); + next = node.getNextSourceNode(true, CKEDITOR.NODE_ELEMENT); + next = node.getNextSourceNode(true, CKEDITOR.NODE_DOCUMENT, node); + next = node.getNextSourceNode(true, CKEDITOR.NODE_DOCUMENT_FRAGMENT, (current: CKEDITOR.dom.node) => true); + console.log(node.type); } function test_dom_nodeList() { @@ -369,6 +380,7 @@ function test_dom_walker() { node = walker.lastForward(); node = walker.next(); node = walker.previous(); + isSomething = walker.guard(node, true); walker.reset(); isSomething = CKEDITOR.dom.walker.blockBoundary({ div: 1 })(node); @@ -485,7 +497,7 @@ function test_dialog() { { id: 'tab-basic', label: 'Basic Settings', - elements: [] + elements: [] as any [] }, { id: 'tab-adv', @@ -914,6 +926,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 6815d3aa98..910d62f2d7 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -2,6 +2,7 @@ // 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. @@ -332,6 +333,7 @@ declare namespace CKEDITOR { } class node extends domObject { + type: number; constructor(domNode: Node); appendTo(element: element): element; clone(includeChildren: boolean, cloneId: boolean): node; @@ -346,12 +348,12 @@ declare namespace CKEDITOR { getDocument(): document; getIndex(normalized?: boolean): number; getNext(evaluator?: (node: node) => boolean): node; - getNextSourceNode(startFromSibling: boolean, nodeType: number, guard: node | ((node: node) => boolean)): void; + getNextSourceNode(startFromSibling?: boolean, nodeType?: number, guard?: node | ((node: node) => boolean)): node; getParent(allowFragmentParent?: boolean): element; getParents(closerFirst?: boolean): node[]; getPosition(otherNode: node): void; getPrevious(evaluator?: (node: node) => boolean): node; - getPreviousSourceNode(startFromSibling: boolean, nodeType: number, guard: node | ((node: node) => boolean)): void; + getPreviousSourceNode(startFromSibling?: boolean, nodeType?: number, guard?: node | ((node: node) => boolean)): node; hasAscendant(name: string, includeSelf: boolean): boolean; remove(preserveChildren?: boolean): node; replace(nodeToReplace: node): void; @@ -497,7 +499,7 @@ declare namespace CKEDITOR { class walker { evaluator: (node: node) => boolean; - guard: (node: node) => boolean; + guard: (node: node, movingOut?: boolean) => boolean; static validEmptyBlockContainers: { [key: string]: any }; @@ -760,7 +762,7 @@ declare namespace CKEDITOR { pasteFromWordNumberedHeadingToList?: boolean; pasteFromWordPromptCleanup?: boolean; pasteFromWordRemoveFontStyles?: boolean; - pasteFromWorkRemoveStyles?: boolean; + pasteFromWordRemoveStyles?: boolean; pasteFromWord_heuristicsEdgeList?: boolean; pasteFromWord_inlineImages?: boolean; plugins?: string; @@ -2168,6 +2170,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; diff --git a/types/ckeditor/v2/ckeditor-tests.ts b/types/ckeditor/v2/ckeditor-tests.ts index ce93c75eba..3407a07501 100644 --- a/types/ckeditor/v2/ckeditor-tests.ts +++ b/types/ckeditor/v2/ckeditor-tests.ts @@ -337,7 +337,7 @@ function test_adding_dialog_by_definition() { { id: 'tab-basic', label: 'Basic Settings', - elements: [] + elements: [] as any[] }, { id: 'tab-adv', diff --git a/types/ckeditor/v2/index.d.ts b/types/ckeditor/v2/index.d.ts index ab7b88bbdd..93e7902090 100644 --- a/types/ckeditor/v2/index.d.ts +++ b/types/ckeditor/v2/index.d.ts @@ -718,7 +718,7 @@ declare namespace CKEDITOR { pasteFromWordNumberedHeadingToList?: boolean; pasteFromWordPromptCleanup?: boolean; pasteFromWordRemoveFontStyles?: boolean; - pasteFromWorkRemoveStyles?: boolean; + pasteFromWordRemoveStyles?: boolean; plugins?: string; protectedSource?: RegExp[]; diff --git a/types/ckeditor__ckeditor5-core/ckeditor__ckeditor5-core-tests.ts b/types/ckeditor__ckeditor5-core/ckeditor__ckeditor5-core-tests.ts new file mode 100644 index 0000000000..68a20aff51 --- /dev/null +++ b/types/ckeditor__ckeditor5-core/ckeditor__ckeditor5-core-tests.ts @@ -0,0 +1,328 @@ +import * as utils from "ckeditor__ckeditor5-utils"; +import * as core from "ckeditor__ckeditor5-core"; +import * as engine from "ckeditor__ckeditor5-engine"; + +declare let bool: boolean; +declare let command: core.Command; +declare let commandCollection: core.CommandCollection; +declare let commands: core.Command[]; +declare let componentFactory: core.ComponentFactory; +declare let config: utils.Config; +declare let conversion: engine.conversion.Conversion; +declare let dataController: engine.controller.DataController; +declare let editingController: engine.controller.EditingController; +declare let editingKeystrokeHandler: core.EditingKeystrokeHandler; +declare let editor: core.editor.Editor; +declare let focusTracker: utils.FocusTracker; +declare let htmlElement: HTMLElement; +declare let keystrokes: core.EditingKeystrokeHandler; +declare let locale: utils.Locale; +declare let model: engine.model.Model; +declare let num: number; +declare let pendingActions: core.PendingActions; +declare let plugin: core.Plugin; +declare let pluginCollection: core.PluginCollection; +declare let pluginCollectionStr: core.PluginCollection>; +declare let pluginStr: core.Plugin; +declare let myPlugin: MyPlugin; +declare let myPluginMaybe: MyPlugin | undefined; +declare let myPlugins: MyPlugin[]; +declare let str: string; +declare let strOrUndef: string | undefined; +declare let strs: string[]; +declare let ui: core.editor.EditorUI; +declare let undef: undefined; +declare let view: core.EditorUIView; + +class MyPlugin extends core.Plugin { + constructor(editor: core.editor.Editor) { + super(editor); + } + + static get pluginName() { + return "A"; + } + + myMethod() { + return "this is MyPlugin method"; + } +} + +class SomeCommand extends core.Command { + execute() {} +} + +// core/editor/utils/dataapimixin ============================================= + +class DataApiEditor extends core.editor.Editor implements core.editor.utils.DataApi { + // mixin by DataApiMixin + getData: () => string; + setData: (data: string) => void; +} +utils.mix(DataApiEditor, core.editor.utils.DataApiMixin); +const dataApiEditor = new DataApiEditor(); + +dataApiEditor.setData("foo"); +str = dataApiEditor.getData(); + +// core/editor/utils/elementapimixin ========================================== + +class ElementApiEditor extends core.editor.Editor implements core.editor.utils.ElementApi { + // mixin by ElementApiMixin + readonly sourceElement: HTMLElement; + updateSourceElement: () => void; +} +utils.mix(ElementApiEditor, core.editor.utils.ElementApiMixin); +const elementApiEditor = new ElementApiEditor(); + +htmlElement = elementApiEditor.sourceElement; +elementApiEditor.updateSourceElement(); + +// core/editor/utils/attachtoform ============================================= + +// $ExpectError +core.editor.utils.attachToForm(editor); +core.editor.utils.attachToForm(elementApiEditor); + +// core/editor/editor ========================================================= + +commandCollection = editor.commands; +config = editor.config; +editingController = editor.editing; +conversion = editor.conversion; +dataController = editor.data; +editor.isReadOnly = bool; +editingKeystrokeHandler = editor.keystrokes; +locale = editor.locale; +model = editor.model; +pluginCollection = editor.plugins; + +if (editor.state === "initializing") { + console.log("new Editor()"); +} else if (editor.state === "ready") { + console.log("Editor.create()"); +} else if (editor.state === "destroyed") { + console.log("editor.destroy"); +} else { + const n: never = editor.state; +} + +editor.state = "ready"; + +core.editor.Editor.builtinPlugins = [plugin, pluginStr, plugin]; +const plugins: Array> = core.editor.Editor.builtinPlugins; + +core.editor.Editor.defaultConfig = { + foo: { + a: 1, + b: 2 + } +}; + +editor = new core.editor.Editor(); +editor = new core.editor.Editor({language: "pl"}); + +editor.destroy(); +editor.destroy().then(() => { + console.log(`${editor.state} == destroyed`); +}); + +editor.execute("someCommand"); +editor.execute("someCommand2", "arg1", 2); + +editor.initPlugins(); +editor.initPlugins().then(() => { + console.log(`init ${Array.from(editor.plugins).length} plugins`); +}); + +locale.t = editor.t; +str = editor.t("Label"); +str = editor.t('Created file "%0" in %1ms.', ["fileName", "100"]); + +// core/editor/editorui ======================================================= + +componentFactory = ui.componentFactory; +editor = ui.editor; +focusTracker = ui.focusTracker; +view = ui.view; + +ui = new core.editor.EditorUI(editor, view); +ui.destroy(); +ui.update(); + +// core/editor/editorwithui =================================================== + +declare let ewui: core.editor.EditorWithUI; +htmlElement = ewui.element!; +ui = ewui.ui; + +// core/command =============================================================== + +editor = command.editor; + +bool = command.isEnabled; + +undef = command.value; +strOrUndef = new core.Command(editor).value; + +command = new core.Command(editor); + +command.destroy(); + +command.execute(); + +command.refresh(); + +// core/commandcollection ===================================================== + +commandCollection = new core.CommandCollection(); + +const collectionsPairs = Array.from(commandCollection); +const collectionsPair = collectionsPairs[0]; +str = collectionsPair[0]; +command = collectionsPair[1]; + +commandCollection.add("foo", new SomeCommand(editor)); + +command = commandCollection.commands().next().value; +commands = Array.from(commandCollection.commands()); + +commandCollection.destroy(); + +commandCollection.execute("foo"); +commandCollection.execute("bar", 1, "param"); + +command = commandCollection.get("foo"); + +str = commandCollection.names().next().value; +strs = Array.from(commandCollection.names()); + +// core/editingkeystrokehandler =============================================== + +keystrokes = new core.EditingKeystrokeHandler(editor); + +editor = keystrokes.editor; + +keystrokes.press({keyCode: 123}); + +keystrokes.set("Ctrl+A", "foo"); +keystrokes.set(["shift", "33"], "foo"); +keystrokes.set(["ctrl", "A"], "foo", {priority: 10}); +keystrokes.set(["ctrl", "A"], "foo", {priority: "high"}); +keystrokes.set(["ctrl", "A"], () => console.log("key")); +keystrokes.set(["ctrl", "A"], (keyEvtData, cancel) => { + console.log(keyEvtData.keyCode); + cancel(); +}); + +// core/pendingactions ======================================================== + +pendingActions = new core.PendingActions(editor); + +str = core.PendingActions.pluginName; + +const firstAction = pendingActions.first; + +bool = pendingActions.hasAny; + +strs = Array.from(pendingActions, action => action.message); + +const action1 = pendingActions.add("Action 1"); + +pendingActions.remove(action1); + +firstAction!.fire("I'm an Observable with a message"); +str = firstAction!.message; +str = action1.message; + +// core/plugin ================================================================ + +class MyPluginMini extends core.Plugin { + constructor(editor: core.editor.Editor) { + super(editor); + } +} + +class MyPluginAll extends core.Plugin { + constructor(editor: core.editor.Editor) { + super(editor); + } + + static get pluginName() { + return "All"; + } + + static get requires() { + return [MyPlugin, MyPluginMini]; + } + + afterInit() {return Math.random() ? null : Promise.resolve("resolved"); } + destroy() {return Math.random() ? null : Promise.resolve("destroy"); } + init() {return Math.random() ? null : Promise.resolve("init"); } +} + +plugin = new MyPlugin(editor); +plugin = new MyPluginMini(editor); +pluginStr = new MyPluginAll(editor); + +const Plugin: MyPlugin = new MyPlugin(editor); +const pluginMini: MyPluginMini = new MyPluginMini(editor); +const pluginAll: MyPluginAll = new MyPluginAll(editor); + +editor = myPlugin.editor; + +str = MyPluginAll.pluginName; +strOrUndef = MyPluginMini.pluginName; // Todo: should be undefined. + +plugin = new MyPluginAll.requires[0](editor); + +const fs: Function[] = MyPluginAll.requires; +const fsOrUndef = MyPluginMini.requires; // Todo: should be undefined. + +// $ExpectError +pluginMini.afterInit(); +pluginAll.afterInit(); + +// $ExpectError +pluginMini.destroy(); +pluginAll.destroy(); + +// $ExpectError +pluginMini.init(); +pluginAll.init(); + +// core/plugincollection ====================================================== + +pluginCollectionStr = new core.PluginCollection(editor, [MyPluginAll]); +// $ExpectError +pluginCollectionStr = new core.PluginCollection(editor, [MyPlugin]); + +const aColl = new core.PluginCollection(editor, [MyPluginAll, MyPluginMini]); + +const myColl = new core.PluginCollection(editor, [MyPlugin]); + +const myCollArray = Array.from(myColl); +myPlugins = myCollArray.map(entry => entry[1]); +myPlugin = new (myCollArray[0][0])(editor); + +myColl.destroy() + .then(destroyedPlugins => { + num = destroyedPlugins.length; + const plugin = destroyedPlugins[0]; + editor = plugin.editor; + plugin.init!(); + plugin.destroy(); + str = plugin.myMethod(); + }); + +myPluginMaybe = myColl.get("A"); +myPluginMaybe = myColl.get(MyPlugin); + +myColl.load([MyPlugin, "A"]) + .then((loadedPlugins) => { + const plugin = loadedPlugins[0]; + editor = plugin.editor; + str = plugin.myMethod(); + }); + +myColl.load([MyPlugin, "A"], [MyPlugin, "A"]); diff --git a/types/ckeditor__ckeditor5-core/index.d.ts b/types/ckeditor__ckeditor5-core/index.d.ts new file mode 100644 index 0000000000..63ae237739 --- /dev/null +++ b/types/ckeditor__ckeditor5-core/index.d.ts @@ -0,0 +1,269 @@ +// Type definitions for @ckeditor/ckeditor5-core 11.0 +// Project: https://github.com/ckeditor/ckeditor5-core +// Definitions by: denisname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as engine from "ckeditor__ckeditor5-engine"; +import * as ckutils from "ckeditor__ckeditor5-utils"; + +// TODO: depends on other libraries +export interface AlignmentConfig {} +export interface AutosaveConfig {} +export interface CKFinderAdapterConfig {} +export interface CloudServicesConfig {} +export interface FontFamilyConfig {} +export interface FontSizeConfig {} +export interface HeadingConfig {} +export interface HighlightConfig {} +export interface ImageConfig {} +export interface MediaEmbedConfig {} +export interface TypingConfig {} +export interface ComponentFactory {} // CKEditor 5 UI +export interface EditorUIView {} // CKEditor 5 UI + +export namespace editor { + namespace utils { + // core/editor/utils/attachtoform + + function attachToForm(editor: Editor & ElementApi): void; + + // core/editor/utils/dataapimixin + + const DataApiMixin: DataApi; + + interface DataApi { + getData(): string; + setData(data: string): void; + } + + // core/editor/utils/elementapimixin + + const ElementApiMixin: ElementApi; + + interface ElementApi { + readonly sourceElement: HTMLElement; + updateSourceElement(): void; + } + } + + // core/editor/editor + + class Editor implements ckutils.Emitter, ckutils.Observable { + readonly commands: CommandCollection; + readonly config: ckutils.Config; + readonly conversion: engine.conversion.Conversion; + readonly data: engine.controller.DataController; + readonly editing: engine.controller.EditingController; + isReadOnly: boolean; + readonly keystrokes: EditingKeystrokeHandler; + readonly locale: ckutils.Locale; + readonly model: engine.model.Model; + readonly plugins: PluginCollection>; + state: "initializing" | "ready" | "destroyed"; + + static builtinPlugins: Array>; + static defaultConfig: object; + + constructor(config?: object); + destroy(): Promise; + execute(commandName: string, ...commandParams: any[]): void; + initPlugins(): Promise; + t(str: string, values?: string[]): string; + + static create(config: object): Promise; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } + + // core/editor/editorconfig + + interface EditorConfig { + alignment: AlignmentConfig; + autosave: AutosaveConfig; + balloonToolbar: string[]; + blockToolbar: string[]; + ckfinder: CKFinderAdapterConfig; + cloudServices: CloudServicesConfig; + fontFamily: FontFamilyConfig; + fontSize: FontSizeConfig; + heading: HeadingConfig; + highlight: HighlightConfig; + image: ImageConfig; + language: string; + mediaEmbed: MediaEmbedConfig; + plugins: Array; + removePlugins: string[]; + toolbar: string[] | {items: string[]; viewportTopOffset: number; }; + typing: TypingConfig; + } + + // core/editor/editorui + + class EditorUI implements ckutils.Emitter { + readonly componentFactory: ComponentFactory; + readonly editor: Editor; + readonly focusTracker: ckutils.FocusTracker; + readonly view: EditorUIView; + + constructor(editor: Editor, view: EditorUIView); + destroy(): void; + update(): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + } + + // core/editor/editorwithui + + interface EditorWithUI { + readonly element: HTMLElement | null; + readonly ui: EditorUI; + } +} + +// core/command + +export class Command implements ckutils.Emitter, ckutils.Observable { + readonly editor: editor.Editor; + readonly isEnabled: boolean; + readonly value: T | undefined; + + constructor(editor: editor.Editor); + destroy(): void; + execute(): void; + refresh(): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; +} + +// core/commandcollection + +export class CommandCollection { + constructor(); + [Symbol.iterator](): Iterator<[string, Command]>; + add(commandName: string, command: Command): void; + commands(): IterableIterator; + destroy(): void; + execute(commandName: string, ...commandParams: any[]): void; + get(commandName: string): Command; + names(): IterableIterator; +} + +// core/editingkeystrokehandler + +export class EditingKeystrokeHandler extends ckutils.KeystrokeHandler { + readonly editor: editor.Editor; + + constructor(editor: editor.Editor); + set( + keystroke: string | Array, + callback: string | ((keyEvtData: engine.view.observer.KeyEventData, cancel: () => void) => void), + options?: {priority: ckutils.PriorityString | number} + ): void; +} + +// core/pendingactions + +export class PendingActions extends Plugin { + static readonly pluginName: "PendingActions"; + + first: null | ckutils.Observable & {message: string}; + readonly hasAny: boolean; + + [Symbol.iterator](): Iterator; + add(message: string): ckutils.Observable & {message: string}; + remove(action: ckutils.Observable & {message: string}): void; +} + +// core/plugin + +export abstract class Plugin implements ckutils.Emitter, ckutils.Observable { + readonly editor: editor.Editor; + + static readonly pluginName?: string; + static readonly requires?: Array Plugin>; + + constructor(editor: editor.Editor); + afterInit?(): null | Promise; + destroy?(): null | Promise; + init?(): null | Promise; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; +} + +// PluginInterface, see Plugin + +// core/plugincollection + +export class PluginCollection

> { + constructor( + editor: editor.Editor, + availablePlugins?: Array P> + ); + + [Symbol.iterator](): Iterator<[new(editor: editor.Editor) => P, P]>; + + destroy(): Promise}>>; + + get( + key: string | (new(editor: editor.Editor) => P) + ): P | undefined; + + load( + plugins: Array P)>, + removePlugins?: Array P)> + ): Promise; +} diff --git a/types/ckeditor__ckeditor5-core/tsconfig.json b/types/ckeditor__ckeditor5-core/tsconfig.json new file mode 100644 index 0000000000..5f53bb9035 --- /dev/null +++ b/types/ckeditor__ckeditor5-core/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6", + "dom", + "es2015.promise" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ckeditor__ckeditor5-core-tests.ts" + ] +} diff --git a/types/ckeditor__ckeditor5-core/tslint.json b/types/ckeditor__ckeditor5-core/tslint.json new file mode 100644 index 0000000000..b4dd998211 --- /dev/null +++ b/types/ckeditor__ckeditor5-core/tslint.json @@ -0,0 +1,22 @@ +{ + "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`?"] + ] + }, + "no-empty-interface": false, + "prefer-switch": false, + "quotemark": [ + true, + "double", + "avoid-escape", + "avoid-template" + ] + } +} diff --git a/types/ckeditor__ckeditor5-engine/ckeditor__ckeditor5-engine-tests.ts b/types/ckeditor__ckeditor5-engine/ckeditor__ckeditor5-engine-tests.ts new file mode 100644 index 0000000000..676f30ac3b --- /dev/null +++ b/types/ckeditor__ckeditor5-engine/ckeditor__ckeditor5-engine-tests.ts @@ -0,0 +1,81 @@ +import * as engine from "ckeditor__ckeditor5-engine"; + +declare let pattern: engine.view.MatcherPattern; + +pattern = {name: /^p/}; + +pattern = { + attributes: { + title: "foobar", + foo: /^\w+/, + bar: true, + } +}; + +pattern = { + classes: "foobar" +}; + +pattern = { + classes: /foo.../ +}; + +pattern = { + classes: ["baz", "bar", /foo.../] +}; + +pattern = { + styles: { + position: "absolute", + color: /^\w*blue$/ + } +}; + +pattern = { + name: "span", + styles: { + "font-weight": "bold" + }, + classes: "highlighted" +}; + +pattern = (element: engine.view.Element) => { + if (element.name === "div" && element.childCount > 0) { + return {name: true}; + } + + return null; +}; + +pattern = (element: engine.view.Element) => { + if (element.name === "p") { + const fontSize = element.getStyle("font-size")!; + const size = fontSize.match(/(\d+)/px); + + if (size && Number(size[1]) > 26) { + return {name: true, attribute: ["font-size"]}; + } + } + + return null; +}; + +declare let viewDefinition: engine.view.ElementDefinition; + +viewDefinition = "p"; + +viewDefinition = { + name: "h1", + classes: ["foo", "bar"], +}; + +viewDefinition = { + name: "span", + styles: { + "font-size": "12px", + "font-weight": "bold", + }, + attributes: { + "data-id": "123", + } +}; diff --git a/types/ckeditor__ckeditor5-engine/index.d.ts b/types/ckeditor__ckeditor5-engine/index.d.ts new file mode 100644 index 0000000000..280b6ea213 --- /dev/null +++ b/types/ckeditor__ckeditor5-engine/index.d.ts @@ -0,0 +1,1368 @@ +// Type definitions for @ckeditor/ckeditor5-engine 11.0 +// Project: https://github.com/ckeditor/ckeditor5-engine +// Definitions by: denisname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as ckutils from "ckeditor__ckeditor5-utils"; + +export namespace controller { + // engine/controller/datacontroller + + class DataController implements ckutils.Emitter, ckutils.Observable { + readonly downcastDispatcher: conversion.DowncastDispatcher; + readonly mapper: conversion.Mapper; + readonly model: model.Model; + readonly processor: dataprocessor.DataProcessor; + readonly upcastDispatcher: conversion.UpcastDispatcher; + + constructor(model: model.Model, dataProcessor?: dataprocessor.DataProcessor); + destroy(): void; + get(rootName?: string): string; + init(data: string, rootName?: string): Promise; + parse(data: string, context?: model.SchemaContextDefinition): model.DocumentFragment; + stringify(modelElementOrFragment: Element | model.DocumentFragment): string; + toModel(viewElementOrFragment: Element | model.DocumentFragment, context?: model.SchemaContextDefinition): model.DocumentFragment; + toView(modelElementOrFragment: Element | model.DocumentFragment): model.DocumentFragment; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } + + // engine/controller/editingcontroller + + class EditingController implements ckutils.Emitter, ckutils.Observable { + readonly downcastDispatcher: conversion.DowncastDispatcher; + readonly mapper: conversion.Mapper; + readonly model: model.Model; + readonly view: view.View; + + constructor(model: model.Model); + destroy(): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } +} + +export namespace conversion { + // engine/conversion/conversion + + class Conversion { + constructor(); + attributeToAttribute(definition?: {model: string | Object, view?: string | Object, upcastAlso?: view.MatcherPattern | view.MatcherPattern[]}): void; + attributeToElement(definition: ConverterDefinition): void; + elementToElement(definition: ConverterDefinition): void; + for(groupName: string): {add: () => void}; + register(groupName: string, dispatchers: Array): void; + } + + interface ConverterDefinition { + converterPriority: ckutils.PriorityString; + model: any; + upcastAlso: view.MatcherPattern | view.MatcherPattern[]; + view: view.ElementDefinition | Object; + } + + // engine/conversion/downcast-converters + + interface HighlightDescriptor { + attributes: Object; + classes: string | string[]; + id: string; + priority: number; + } + + // engine/conversion/downcast-selection-converters + + function clearAttributes(): Function; + + function convertCollapsedSelection(): Function; + + function convertRangeSelection(): Function; + + // engine/conversion/downcastdispatcher + + class DowncastDispatcher { + // TODO + } + + // engine/conversion/mapper + + class Mapper { + constructor(); + bindElementToMarker(element: view.Element, name: string): void; + bindElements(modelElement: model.Element, viewElement: view.Element): void; + clearBindings(): void; + getModelLength(viewNode: view.Element): number; + markerNameToElements(name: string): Set | null; + registerViewToModelLength(viewElementName: string, lengthCallback: Function): void; + toModelElement(viewElement: view.Element): model.Element | undefined; + toModelPosition(viewPosition: view.Position): model.Position; + toModelRange(viewRange: view.Range): model.Range; + toViewElement(modelElement: model.Element): view.Element | undefined; + toViewPosition(modelPosition: model.Position, options?: {isPhantom: boolean}): view.Position; + toViewRange(modelRange: model.Range): view.Range; + unbindElementsFromMarkerName(name: string): void; + unbindModelElement(modelElement: model.Element): void; + unbindViewElement(viewElement: view.Element): void; + } + + // engine/conversion/modelconsumable + + class ModelConsumable { + constructor(); + add(item: model.Item | model.Selection | model.Range, type: string): void; + consume(item: model.Item | model.Selection | model.Range, type: string): boolean; + revert(item: model.Item | model.Selection | model.Range, type: string): null | boolean; + test(item: model.Item | model.Selection | model.Range, type: string): null | boolean; + } + + // engine/conversion/upcast-converters + + function convertText(): Function; + + function convertToModelFragment(): Function; + + function upcastAttributeToAttribute( + config: {view: string | {key: string, name: string, value: string | RegExp | Function}, + model: string | {key: string, value: string | Function}, + converterPriority?: ckutils.PriorityString} + ): Function; + + function upcastElementToAttribute( + config: {view: view.MatcherPattern, model: string | {key: string, value: string | Function}, converterPriority?: ckutils.PriorityString} + ): Function; + + function upcastElementToElement( + config: {view: view.MatcherPattern, model: string | Element | Function, converterPriority?: ckutils.PriorityString} + ): Function; + + function upcastElementToMarker( + config: {view: view.MatcherPattern, model: string | Function, converterPriority?: ckutils.PriorityString} + ): Function; + + // engine/conversion/upcast-selection-converters + + function convertSelectionChange(model: model.Model, mapper: Mapper): Function; + + // engine/conversion/upcastdispatcher + + class UpcastDispatcher { + // TODO + } + + interface ViewConversionApi { + // TODO + } + + // engine/conversion/viewconsumable + + class ViewConsumable { + // TODO + } +} + +export namespace dataprocessor { + // engine/dataprocessor/basichtmlwriter + + class BasicHtmlWriter implements HtmlWriter { + getHtml(fragment: model.DocumentFragment): string; + } + + // engine/dataprocessor/dataprocessor + + interface DataProcessor { + // TODO + } + + // engine/dataprocessor/htmldataprocessor + + class HtmlDataProcessor implements DataProcessor { + // TODO + } + + // engine/dataprocessor/htmlwriter + + interface HtmlWriter { + getHtml(fragment: model.DocumentFragment): string; + } + + // engine/dataprocessor/xmldataprocessor + + class XmlDataProcessor implements DataProcessor { + // TODO + } +} + +export namespace devUtils { + // engine/dev-utils/enableenginedebug + + class DebugPlugin {} + + function disableEngineDebug(): void; + + function enableEngineDebug(_logger: {log: (...arg: any[]) => string, error: (...arg: any[]) => string}): DebugPlugin; + + // engine/dev-utils/model + + namespace devmodel { + function getData( + model: model.Model, + options?: { + withoutSelection?: boolean, + rootName?: string, + convertMarkers?: boolean + } + ): string; + + function parse( + data: string, + schema: model.Schema, + batch: model.Batch, + options?: { + selectionAttributes?: Object[], + lastRangeBackward?: boolean, + context?: model.SchemaContextDefinition + } + ): model.Element | model.Text | model.DocumentFragment | Object; + + function setData(model: string, data: Object, options: {rootName?: string, selectionAttributes?: Object[], lastRangeBackward?: boolean, batchType?: string}): void; + + function stringify( + node: model.RootElement | model.Element | model.Text | model.DocumentFragment, + selectionOrPositionOrRange: model.Selection | model.Position | model.Range, // TODO optional + markers: Iterable | null + ): string; + } + + // engine/dev-utils/operationreplayer + + class OperationReplayer { + // TODO + } + + // engine/dev-utils/view + + function getData( + view: view.View, + options?: { + withoutSelection?: boolean, + rootName?: boolean, + showType?: boolean, + showPriority?: boolean, + showAttributeElementId?: boolean, + renderUIElements?: boolean, + } + ): string; + + function parse( + data: string, + options: { + order?: number[], + lastRangeBackward?: boolean, + rootElement?: view.Element | view.DocumentFragment, + sameSelectionCharacters?: boolean + } + ): view.Text | view.Element | view.DocumentFragment | Object; + + function setData( + view: view.View, + data: string, + options: {rootName?: string} + ): void; + + function stringify( + node: view.Text | view.Element | view.DocumentFragment, + selectionOrPositionOrRange?: view.DocumentSelection | view.Position | view.Range, + options?: { + showType?: boolean, + showPriority?: boolean, + showAttributeElementId?: boolean, + ignoreRoot?: boolean, + sameSelectionCharacters?: boolean, + renderUIElements?: boolean, + } + ): string; +} + +export namespace model { + namespace operation { + // engine/model/operation/attributeoperation + + class AttributeOperation { + // TODO + } + + // engine/model/operation/detachoperation + + class DetachOperation { + // TODO + } + + // engine/model/operation/insertoperation + + class InsertOperation { + // TODO + } + + // engine/model/operation/markeroperation + + class MarkerOperation { + // TODO + } + + // engine/model/operation/mergeoperation + + class MergeOperation { + // TODO + } + + // engine/model/operation/moveoperation + + class MoveOperation { + // TODO + } + + // engine/model/operation/nooperation + + class NoOperation { + // TODO + } + + // engine/model/operation/operation + + class Operation { + // TODO + } + + // engine/model/operation/operationfactory + + class OperationFactory { + // TODO + } + + // engine/model/operation/renameoperation + + class RenameOperation { + // TODO + } + + // engine/model/operation/rootattributeoperation + + class RootAttributeOperation { + // TODO + } + + // engine/model/operation/splitoperation + + class SplitOperation { + // TODO + } + + // engine/model/operation/transform + + class TransformationContext { + // TODO + } + + function transform(a: Operation, b: Operation, context: TransformationContext): Operation[]; + + function transformSets(operationsA: Operation[], operationsB: Operation[], options: {document: Document | null, useRelations: boolean, padWithNoOps: boolean}): object; + } + + namespace utils { + function deleteContent( + model: Model, + selection: Selection | DocumentSelection, + batch: Batch, + options?: {leaveUnmerged: boolean, doNotResetEntireContent: boolean} + ): void; + + function getSelectedContent( + model: Model, + selection: Selection | DocumentSelection + ): DocumentFragment; + + function insertContent( + model: Model, + content: DocumentFragment | Item, + selectable?: Selection | DocumentSelection | Position | Element | Iterable | Range | null + ): void; + + function modifySelection( + model: Model, + selection: Selection | DocumentSelection, + options?: {direction?: "forward" | "backward", unit?: "character" | "codePoint" | "word"} + ): void; + + function injectSelectionPostFixer( + model: Model + ): void; + } + + // engine/model/batch + + class Batch { + // TODO + } + + // engine/model/differ + + class Differ { + // TODO + } + + // engine/model/document + + class Document { + // TODO + } + + // engine/model/documentfragment + + class DocumentFragment { + readonly childCount: number; + readonly isEmpty: boolean; + readonly markers: Map; + readonly maxOffset: number; + readonly parent: null; + readonly root: DocumentFragment; + + protected constructor(children?: Node | Iterable); + [Symbol.iterator](): Iterator; + getChild(index: number): Node | null; + getChildIndex(node: Node): number | null; + getChildStartOffset(node: Node): number | null; + getChildren(): Iterable; + getNodeByPath(relativePath: number[]): Node | DocumentFragment; + getPath(): number[]; /*TS3.0: []*/ + is(type: string): boolean; + offsetToIndex(offset: number): number; + toJSON(): Object; + protected _appendChild(items: Item | Iterable): void; + protected _insertChild(index: number, items: Item | Iterable): void; + protected _removeChildren(index: number, howMany?: number): Node[]; + + static fromJSON(json: object): DocumentFragment; + } + + // engine/model/documentselection + + class DocumentSelection { + // TODO + } + + // engine/model/element + + class Element extends Node { + readonly childCount: number; + readonly isEmpty: boolean; + readonly maxOffset: number; + readonly name: string; + + protected constructor( + name: string, + attrs?: Map | ReadonlyArray<[string, any]>, + children?: Node | Iterable + ); + getChild(index: number): Node; + getChildIndex(node: Node): number; + getChildStartOffset(node: Node): number; + getChildren(): Iterable; + getNodeByPath(relativePath: number[]): Node; + is(type: string, name?: string): boolean; + offsetToIndex(offset: number): number; + toJSON(): object; + protected _appendChild(nodes: Item | Iterable): void; + protected _clone(deep?: boolean): Element; + protected _insertChild(index: number, items: Item | Iterable): void; + protected _removeChildren(index: number, howMany?: number): Node[]; + + static fromJSON(json: object): Element; + } + + // engine/model/history + + class History { + // TODO + } + + // engine/model/item + + type Item = Node | TextProxy; + + // engine/model/liveposition + + class LivePosition { + // TODO + } + + // engine/model/liverange + + class LiveRange { + // TODO + } + + // engine/model/markercollection + + class Marker { + // TODO + } + + class MarkerCollection { + // TODO + } + + // engine/model/model + + class Model implements ckutils.Emitter, ckutils.Observable { + readonly document: Document; + readonly markers: MarkerCollection; + readonly schema: Schema; + + applyOperation(operation: operation.Operation): void; + change(callback: Function): any; + deleteContent(selection: Selection | DocumentSelection, batch: Batch, options: {leaveUnmerged?: boolean, doNotResetEntireContent?: boolean}): void; + destroy(): void; + enqueueChange(batchOrType: Batch | "transparent" | "default", callback: Function): void; + getSelectedContent(selection: Selection | DocumentSelection): DocumentFragment; + hasContent(rangeOrElement: Range | Element): boolean; + insertContent(content: DocumentFragment | Item, selectable?: Selection | DocumentSelection | Position | Element | Iterable | Range | null): void; + modifySelection(selection: Selection | DocumentSelection, options?: {direction?: "forward" | "backward", unit?: "character" | "codePoint" | "word"}): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } + + // engine/model/node + + class Node { + readonly document: Document | null; + readonly endOffset: number | null; + readonly index: number | null; + readonly nextSibling: Node | null; + readonly offsetSize: number; + readonly parent: Element | DocumentFragment | null; + readonly previousSibling: Node | null; + readonly root: Node | DocumentFragment; + readonly startOffset: number | null; + + constructor(attrs?: Map | ReadonlyArray<[string, any]>); + getAncestors(options: {includeSelf: boolean, parentFirst: boolean}): Node[]; + getAttribute(key: string): any /*| undefined*/; + getAttributeKeys(): Iterable; + getAttributes(): Iterable; + getCommonAncestor(node: Node, options?: {includeSelf: boolean}): Element | DocumentFragment | null; + getPath(): number[]; + hasAttribute(key: string): boolean; + + is(type: "element"): this is Element; + is(type: "rootElement"): this is RootElement; + is(type: "text"): this is Text; + is(type: "textProxy"): this is TextProxy; + is(type: "documentFragment"): this is DocumentFragment; + is(type: string, name: string): boolean; + + isAfter(node: Node): boolean; + isBefore(node: Node): boolean; + toJSON(): object; + } + + type NodeSet = Node | TextProxy | string | NodeList | DocumentFragment | Iterable; + + // engine/model/nodelist + + class NodeList implements Iterable { + readonly length: number; + readonly maxOffset: number; + + [Symbol.iterator](): Iterator; + getNode(index: number): Node | null; + getNodeIndex(node: Node): number | null; + getNodeStartOffset(node: Node): number | null; + indexToOffset(index: number): number; + offsetToIndex(offset: number): number; + toJSON(): Node[]; + } + + // engine/model/position + + class Position { + readonly index: number; + readonly isAtEnd: boolean; + readonly isAtStart: boolean; + readonly nodeAfter: Node | null; + readonly nodeBefore: Node; + offset: number; + readonly parent: Element; + readonly path: number[]; + readonly root: Element | DocumentFragment; + stickiness: PositionStickiness; + readonly textNode: Text | null; + + constructor(root: Element | DocumentFragment, path: number[], stickiness?: PositionStickiness); + compareWith(otherPosition: Position): PositionRelation; + getAncestors(): Item[]; + getCommonAncestor(position: Position): Element | DocumentFragment | null; + getCommonPath(position: Position): number[]; + getLastMatchingPosition(skip: (t: TreeWalkerValue) => boolean, options: object): Position; + getParentPath(): number[]; + getShiftedBy(shift: number): Position; + getTransformedByOperation(operation: operation.Operation): Position; + hasSameParentAs(position: Position): boolean; + isAfter(otherPosition: Position): boolean; + isBefore(otherPosition: Position): boolean; + isEqual(otherPosition: Position): boolean; + isTouching(otherPosition: Position): boolean; + toJSON(): object; + + static createAfter(item: Item): Position; + static createAt(itemOrPosition: Item | Position, offset?: number | "end" | "before" | "after"): void; + static createBefore(item: Item): Position; + static createFromParentAndOffset(parent: Element | DocumentFragment, offset: number): Position; + static createFromPosition(position: Position): Position; + static fromJSON(json: object, doc: Document): Position; + } + + type PositionRelation = "before" | "after" | "same"; + + type PositionStickiness = "toNone" | "toNext" | "toPrevious"; + + // engine/model/range + + class Range implements Iterable { + readonly end: Position; + isCollapsed: boolean; + isFlat: boolean; + root: Element | DocumentFragment; + readonly start: Position; + + constructor(start: Position, end?: Position); + [Symbol.iterator](): Iterator; + containsItem(item: Item): void; + containsPosition(position: Position): boolean; + containsRange(otherRange: Range, loose?: boolean): boolean; + getCommonAncestor(): Element | DocumentFragment | null; + getDifference(otherRange: Range): Range[]; + getIntersection(otherRange: Range): Range | null; + getMinimalFlatRanges(): Range[]; + getPositions(options: object): Iterable; + getTransformedByOperation(operation: operation.Operation): Range[]; + getTransformedByOperations(operations: Iterable): Range[]; + getWalker(options: { + startPosition: Position, + singleCharacters: boolean, + shallow: boolean, + ignoreElementEnd: boolean, + }): void; + isEqual(otherRange: Range): boolean; + isIntersecting(otherRange: Range): boolean; + toJSON(): object; + } + + function getItems(options: object): Iterable; + + // engine/model/rootelement + + class RootElement extends Element { + readonly document: Document | null; + readonly rootName: string; + + constructor(doc: Document, name: string, rootName: string); + // TODO: toJSON(): string; + } + + // engine/model/schema + + class Schema { + // TODO + } + + class SchemaContext { + // TODO + } + + interface SchemaCompiledItemDefinition { + name: string; + allowIn: string | string[]; + allowAttributes: string | string[]; + isBlock: boolean; + isLimit: boolean; + isObject: boolean; + } + + type SchemaContextDefinition = Node | Position | SchemaContext | string | Array; + + interface SchemaContextItem { + name: string; + getAttributeKeys: Iterable; + getAttribute: (key: string) => string; + } + + interface SchemaItemDefinition { + allowIn: string | string[]; + allowAttributes: string | string[]; + allowContentOf: string | string[]; + allowWhere: string | string[]; + allowAttributesOf: string | string[]; + inheritTypesFrom: string | string[]; + inheritAllFrom: string | string[]; + isBlock: boolean; + isLimit: boolean; + isObject: boolean; + } + + // engine/model/selection + + class Selection implements ckutils.Emitter { + // TODO + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + } + + // engine/model/text + + class Text extends Node { + readonly data: string; + protected _data: string; + + protected constructor(data: string, attrs?: Map | ReadonlyArray<[string, any]>); + toJSON(): object; + protected _clone(): Text; + + static fromJSON(json: object): Text; + } + + // engine/model/textproxy + + class TextProxy { + readonly data: string; + readonly document: Document | null; + readonly endOffset: number; + readonly isPartial: boolean; + readonly offsetInText: number; + readonly offsetSize: number; + readonly parent: Element | DocumentFragment | null; + readonly root: Node | DocumentFragment; + readonly startOffset: number; + readonly textNode: Text; + + protected constructor(textNode: Text, offsetInText: number, length: number); + getAncestors(options: {includeSelf?: boolean, parentFirst?: boolean}): Array; + getAttribute(key: string): any; + getAttributeKeys(): Iterable; + getAttributes(): Iterable; + getPath(): number[]; + hasAttribute(key: string): boolean; + is(type: "textProxy"): this is TextProxy; + is(type: string): boolean; + } + + // engine/model/treewalker + + class TreeWalker implements Iterable { + readonly boundaries: Range; + readonly direction: "backward" | "forward"; + readonly ignoreElementEnd: boolean; + readonly position: Position; + readonly shallow: boolean; + readonly singleCharacters: boolean; + + constructor(options?: { + direction?: "forward" | "backward", + boundaries?: Range, + startPosition: Position, + singleCharacters?: boolean, + shallow?: boolean, + ignoreElementEnd?: boolean + }); + [Symbol.iterator](): Iterator; + next(): TreeWalkerValue; + skip(skip: (t: TreeWalkerValue) => boolean): void; + } + + interface TreeWalkerValue { + item: Item; + length: number; + nextPosition: Position; + previousPosition: Position; + type: TreeWalkerValueType; + } + + type TreeWalkerValueType = "elementStart" | "elementEnd" | "character" | "text"; + + // engine/model/writer + + class Writer { + // TODO + } +} + +export namespace utils { + // engine/utils/bindtwostepcarettoattribute + + function bindTwoStepCaretToAttribute(view: view.View, model: model.Model, emitter: ckutils.Emitter, attribute: string): void; +} + +export namespace view { + namespace observer { + // engine/view/observer/clickobserver + + class ClickObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/compositionobserver + + class CompositionObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/domeventdata + + class DomEventData { + // TODO + } + + // engine/view/observer/domeventobserver + + class DomEventObserver extends Observer { + readonly domEventType: string | string[]; + useCapture: boolean; + + fire(eventType: string, domEvent: Event, additionalData?: Object): void; + onDomEvent(): void; + } + + // engine/view/observer/fakeselectionobserver + + class FakeSelectionObserver extends Observer { + constructor(view: View); + destroy(): void; + observe(): void; + } + + // engine/view/observer/focusobserver + + class FocusObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/keyobserver + + class KeyEventData extends DomEventData implements ckutils.KeystrokeInfo { + // KeystrokeInfo + altKey?: boolean; + ctrlKey?: boolean; + keyCode: number; + keystroke: number; + shiftKey?: boolean; + } + + class KeyObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/mouseobserver + + class MouseObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/mutationobserver + + class MutationObserver extends Observer { + domConverter: DomConverter; + renderer: Renderer; + } + + interface MutatedChildren { + newChildren: Node[]; + node: Element; + oldChildren: Node[]; + type: string; + } + + interface MutatedText { + newText: string; + node: Text; + oldText: string; + type: string; + } + + // engine/view/observer/observer + + class Observer { + readonly document: Document; + readonly isEnabled: boolean; + readonly view: View; + + constructor(view: View); + destroy(): void; + disable(): void; + enable(): void; + observe(domElement: HTMLElement, name: string): void; + } + + // engine/view/observer/selectionobserver + + class SelectionObserver extends Observer { + readonly domConverter: DomConverter; + readonly mutationObserver: MutationObserver; + readonly selection: DocumentSelection; + } + } + + // engine/view/attributeelement + + class AttributeElement extends Element { + readonly id: string | number; + readonly priority: number; + protected _clonesGroup: Set | null; + protected _id: string | number; + protected _priority: number; + + static DEFAULT_PRIORITY: number; + + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + getElementsWithSameId(): Set; + getFillerOffset(): number | null; + isSimilar(otherElement: Element): boolean; + protected _clone(deep: boolean): AttributeElement; + } + + // engine/view/containerelement + + class ContainerElement extends Element { + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + getFillerOffset(): number | null; + } + + // engine/view/document + + class Document implements ckutils.Emitter, ckutils.Observable { + readonly isComposing: boolean; + readonly isFocused: boolean; + isReadOnly: boolean; + readonly roots: ckutils.Collection; + readonly selection: DocumentSelection; + + constructor(); + getRoot(name?: string): RootEditableElement | null; + registerPostFixer(postFixer: (downcastWriter: DowncastWriter) => boolean): void; + protected _callPostFixers(writer: DowncastWriter): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } + + type ChangeType = "children" | "attributes" | "text"; + + // engine/view/documentfragment + + class DocumentFragment { + readonly childCount: number; + readonly isEmpty: boolean; + readonly parent: null; + readonly root: DocumentFragment; + protected _children: Element[]; + + protected constructor(children?: Node | Iterable); + [Symbol.iterator](): Iterator; + _appendChild(items: Item | Iterable): number; + _insertChild(index: number, items: Item | Iterable): number; + _removeChildren(index: number, howMany?: number): Node[]; + getChild(index: number): Node; + getChildIndex(node: Node): number; + getChildren(): Iterable; + is(type: string): boolean; + } + + // engine/view/documentselection + + class DocumentSelection { + // TODO + } + + // engine/view/domconverter + + class DomConverter { + // TODO + } + + // engine/view/downcastwriter + + class DowncastWriter { + // TODO + } + + // engine/view/editableelement + + class EditableElement extends ContainerElement { + // TODO + } + + // engine/view/element + + class Element extends Node { + readonly childCount: number; + readonly isEmpty: boolean; + readonly name: string; + protected _attrs: Map; + protected _children: Node[]; + protected _classes: Set; + protected _customProperties: Map; + protected _styles: Map; + + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + _removeChildren(index: number, howMany?: number): Node[]; + _removeClass(className: string[] | string): void; + findAncestor(patterns: Object | string | RegExp | Function): Element | null; + getAttribute(key: string): string | undefined; + getAttributeKeys(): Iterable; + getAttributes(): Iterable; + getChild(index: number): Node; + getChildIndex(node: Node): number; + getChildren(): Iterable; + getClassNames(): Iterable; + getCustomProperties(): Iterable; + getCustomProperty(key: string | symbol): any; + getFillerOffset(): void; + getIdentity(): string; + getStyle(property: string): string | undefined; + getStyleNames(): Iterable; + hasAttribute(key: string): boolean; + hasClass(className: string): void; + hasStyle(property: string): void; + is(type: string, name?: string): boolean; + isSimilar(otherElement: Element): boolean; + protected _addClass(className: string[] | string): void; + protected _appendChild(items: Item | Iterable): number; + protected _clone(deep?: boolean): Element; + protected _insertChild(index: number, items: Item | Iterable): number; + protected _removeAttribute(key: string): boolean; + protected _removeCustomProperty(key: string | symbol): boolean; + protected _removeStyle(property: string[] | string): void; + protected _setAttribute(key: string, value: string): void; + protected _setCustomProperty(key: string | symbol, value: any): void; + protected _setStyle(property: string | {[key: string]: string}, value?: string): void; + } + + // engine/view/elementdefinition + + type ElementDefinition = string | { + attributes?: {[key: string]: string}; + classes?: string | string[]; + name: string; + priority?: number; + styles?: {[key: string]: string}; + }; + + // engine/view/emptyelement + + class EmptyElement extends Element { + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + getFillerOffset(): null; + } + + // engine/view/filler + + const INLINE_FILLER_LENGTH: number; + + const INLINE_FILLER: string; + + function BR_FILLER(): void; + + function NBSP_FILLER(): void; + + function getDataWithoutFiller(domText: Text): string; + + function injectQuirksHandling(view: View): void; + + function isBlockFiller(domNode: /*TODO globals.*/Node, blockFiller: Function): boolean; + + function isInlineFiller(domText: /*TODO globals.*/Text): boolean; + + function startsWithFiller(domNode: /*TODO globals.*/Text): boolean; + + // engine/view/item + + type Item = Node | TextProxy; + + // engine/view/matcher + + class Matcher { + // TODO + } + + type MatcherPattern = + ((element: Element) => null | {name: boolean; attribute?: string[]; }) | + string | + RegExp | + { + attributes?: {[key: string]: string | RegExp | boolean}; + classes?: string | RegExp | Array; + name?: string | RegExp; + styles?: {[key: string]: string | RegExp}; + }; + + // engine/view/node + + class Node { + readonly document: Document | null; + readonly index: number | null; + readonly nextSibling: Node | null; + readonly parent: Element | DocumentFragment | null; + readonly previousSibling: Node | null; + readonly root: Node | DocumentFragment; + + constructor(); + _fireChange(type: ChangeType, node: Node): void; + getAncestors(options: {includeSelf: boolean, parentFirst?: boolean}): Array; + getCommonAncestor(node: Node, options: {includeSelf?: boolean}): Element | DocumentFragment | null; + getPath(): number[]; + + is(type: "element"): this is Element; + is(type: "containerElement"): this is ContainerElement; + is(type: "attributeElement"): this is AttributeElement; + is(type: "emptyElement"): this is EmptyElement; + is(type: "uiElement"): this is UIElement; + is(type: "documentFragment"): this is DocumentFragment; + is(type: "text"): this is Text; + is(type: "textProxy"): this is TextProxy; + is(type: string, name: string): boolean; + + isAfter(node: Node): boolean; + isBefore(node: Node): boolean; + isSimilar(otherElement: Node): boolean; + toJSON(): object; + protected _clone(): Node; + protected _remove(): void; + } + + // engine/view/placeholder + + function attachPlaceholder(view: View, element: Element, placeholderText: string, checkFunction?: Function): void; + + function detachPlaceholder(view: View, element: Element): void; + + // engine/view/position + + class Position { + // TODO + } + + type PositionRelation = "before" | "after" | "same" | "different"; + + // engine/view/range + + class Range { + // TODO + } + + // engine/view/renderer + + class Renderer { + // TODO + } + + // engine/view/rooteditableelement + + class RootEditableElement extends EditableElement { + // TODO + } + + // engine/view/selection + + class Selection { + // TODO + } + + // engine/view/text + + class Text extends Node { + readonly data: string; + protected _data: string; + protected _textData: string; + + protected constructor(data: string); + isSimilar(otherNode: Text): boolean; + protected _clone(): Text; + } + + // engine/view/textproxy + + class TextProxy { + readonly data: string; + readonly document: Document | null; + readonly isPartial: boolean; + readonly offsetInText: number; + readonly offsetSize: number; + readonly parent: Element | DocumentFragment | null; + readonly root: Node | DocumentFragment; + readonly textNode: Text; + + protected constructor(textNode: Text, offsetInText: number, length: number); + getAncestors(options: {includeSelf?: boolean, parentFirst?: boolean}): Array; + is(type: "textProxy"): this is TextProxy; + is(type: string): boolean; + } + + // engine/view/treewalker + + class TreeWalker { + readonly boundaries: Range; + readonly direction: TreeWalkerDirection; + readonly ignoreElementEnd: boolean; + readonly position: Position; + readonly shallow: boolean; + readonly singleCharacters: boolean; + + constructor(options: { + boundaries?: Range, + startPosition?: Position, + direction?: TreeWalkerDirection, + singleCharacters?: boolean, + shallow?: boolean, + ignoreElementEnd?: boolean; + }); + [Symbol.iterator](): Iterator; + next(): TreeWalkerValue; + skip(skip: (treeWalkerValue: TreeWalkerValue) => boolean): void; + } + + type TreeWalkerDirection = "forward" | "backward"; + + interface TreeWalkerValue { + item: Item; + length: number; + nextPosition: Position; + previousPosition: Position; + type: TreeWalkerValueType; + } + + type TreeWalkerValueType = "elementStart" | "elementEnd" | "text"; + + // engine/view/uielement + + class UIElement extends Element { + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + getFillerOffset(): null; + render(domDocument: /*TODO: globals.*/Document): HTMLElement; + toDomElement(domDocument: /*TODO: globals.*/Document): HTMLElement; + } + + // engine/view/upcastwriter + + class UpcastWriter { + // TODO + } + + // engine/view/view + + class View implements ckutils.Emitter, ckutils.Observable { + // TODO + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } +} diff --git a/types/ckeditor__ckeditor5-engine/tsconfig.json b/types/ckeditor__ckeditor5-engine/tsconfig.json new file mode 100644 index 0000000000..36da122d77 --- /dev/null +++ b/types/ckeditor__ckeditor5-engine/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-engine-tests.ts" + ] +} diff --git a/types/ckeditor__ckeditor5-engine/tslint.json b/types/ckeditor__ckeditor5-engine/tslint.json new file mode 100644 index 0000000000..6a214f0cfd --- /dev/null +++ b/types/ckeditor__ckeditor5-engine/tslint.json @@ -0,0 +1,20 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": { + "options": [ + ["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`?"] + ] + }, + "no-empty-interface": false, + "quotemark": [ + true, + "double", + "avoid-escape", + "avoid-template" + ] + } +} 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..19f21f667a --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts @@ -0,0 +1,600 @@ +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 ================================================================== + +interface SomeMixin { + a: () => string; +} + +class Editor implements SomeMixin { + a: () => string; + b() { return 3; } +} + +const SomeMixin = { + a() { return "a"; } +}; + +const SomeMixinNum = { + a() { return 3; } +}; + +utils.mix(Editor, SomeMixin); +// $ExpectError +utils.mix(Editor, SomeMixinNum); + +const editor = new Editor(); +str = editor.a(); +num = editor.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..50571483f8 --- /dev/null +++ b/types/ckeditor__ckeditor5-utils/index.d.ts @@ -0,0 +1,475 @@ +// 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: (keyEvtData: KeystrokeInfo, cancel: () => void) => void, + 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(...p: any[]): T}, ...mixins: Array>): 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/classnames/bind.d.ts b/types/classnames/bind.d.ts index 4af94d1835..9befbabd4c 100644 --- a/types/classnames/bind.d.ts +++ b/types/classnames/bind.d.ts @@ -1,3 +1,3 @@ -import * as cn from "./index"; +import classNames = require('./index'); -export function bind(styles: Record): typeof cn; +export function bind(styles: Record): typeof classNames; diff --git a/types/classnames/tsconfig.json b/types/classnames/tsconfig.json index f9b03432fc..0e8475e613 100644 --- a/types/classnames/tsconfig.json +++ b/types/classnames/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/clean-css/clean-css-tests.ts b/types/clean-css/clean-css-tests.ts index 1ba3953cfd..98049b3ef6 100644 --- a/types/clean-css/clean-css-tests.ts +++ b/types/clean-css/clean-css-tests.ts @@ -1,18 +1,20 @@ +// Original by Tanguy Krotoff +// Updated by Andrew Potter import * as CleanCSS from 'clean-css'; -var source = 'a{font-weight:bold;}'; -var minified = new CleanCSS().minify(source).styles; +let source = 'a{font-weight:bold;}'; +console.log(new CleanCSS().minify(source).styles); -var source = '@import url(http://path/to/remote/styles);'; -new CleanCSS().minify(source, function (error, minified) { +source = '@import url(http://path/to/remote/styles);'; +new CleanCSS().minify(source, (error: any, minified: CleanCSS.Output): void => { console.log(minified.styles); }); const pathToOutputDirectory = 'path'; -new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) - .minify(source, function (error, minified) { +new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory }) + .minify(source, (error: any, minified: CleanCSS.Output): void => { // access minified.sourceMap for SourceMapGenerator object // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI @@ -20,15 +22,15 @@ new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) }); const inputSourceMapAsString = 'input'; -new CleanCSS({ sourceMap: inputSourceMapAsString, target: pathToOutputDirectory }) - .minify(source, function (error, minified) { +new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory }) + .minify(source, inputSourceMapAsString, (error: any, minified: CleanCSS.Output): void => { // access minified.sourceMap to access SourceMapGenerator object // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI console.log(minified.sourceMap); }); -new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ +new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory }).minify({ 'path/to/source/1': { styles: '...styles...', sourceMap: '...source-map...' @@ -37,7 +39,7 @@ new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ styles: '...styles...', sourceMap: '...source-map...' } -}, function (error, minified) { +}, (error: any, minified: CleanCSS.Output): void => { // access minified.sourceMap as above console.log(minified.sourceMap); }); @@ -52,3 +54,45 @@ new CleanCSS().minify({ styles: 'contents of file two' } }); + +// new tests - promise resolution +new CleanCSS({ returnPromise: true, rebaseTo: pathToOutputDirectory }).minify(source) + .then((minified: CleanCSS.Output): void => { + console.log(minified.styles); + }).catch((error: any): void => { + console.log(error); + } +); + +new CleanCSS({ returnPromise: true, sourceMap: true }).minify(source) + .then((minified: CleanCSS.Output): void => { + // access minified.sourceMap as above + console.log(minified.sourceMap); + }).catch((error: any): void => { + console.log(error); + } +); + +new CleanCSS({ returnPromise: true, sourceMap: true }).minify(source, inputSourceMapAsString) + .then((minified: CleanCSS.Output): void => { + // access minified.sourceMap as above + console.log(minified.sourceMap); + }).catch((error: any): void => { + console.log(error); + } +); + +// test object return when passing options as object +let CleanCssOptions: CleanCSS.Options = { returnPromise: true }; +new CleanCSS(CleanCssOptions).minify(source) + .then((minified: CleanCSS.Output): void => { + console.log(minified.styles); + }).catch((error: any): void => { + console.log(error); + } +); + +CleanCssOptions = { returnPromise: false }; +new CleanCSS(CleanCssOptions).minify(source, (error: any, minified: CleanCSS.Output): void => { + console.log(minified.styles); +}); diff --git a/types/clean-css/index.d.ts b/types/clean-css/index.d.ts index 012977f035..9f2dfe9358 100644 --- a/types/clean-css/index.d.ts +++ b/types/clean-css/index.d.ts @@ -1,108 +1,690 @@ -// Type definitions for clean-css v3.4.9 +// Type definitions for clean-css 4.2 // Project: https://github.com/jakubpawlowicz/clean-css // Definitions by: Tanguy Krotoff +// Andrew Potter // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +import { RequestOptions as HttpsRequestOptions } from "https"; +import { RequestOptions as HttpRequestOptions } from "http"; + +/** + * Shared options passed when initializing a new instance of CleanCSS that returns either a promise or output + */ +interface OptionsBase { + /** + * Controls compatibility mode used; defaults to ie10+ using `'*'`. + * Compatibility hash exposes the following properties: `colors`, `properties`, `selectors`, and `units` + */ + compatibility?: "*" | "ie9" | "ie8" | "ie7" | CleanCSS.CompatibilityOptions; + + /** + * Controls a function for handling remote requests; Defaults to the build in `loadRemoteResource` function + */ + fetch?: (uri: string, inlineRequest: HttpRequestOptions | HttpsRequestOptions, inlineTimeout: number, done: (message: string | number, body: string) => void) => void; + + /** + * Controls output CSS formatting; defaults to `false`. + * Format hash exposes the following properties: `breaks`, `breakWith`, `indentBy`, `indentWith`, `spaces`, and `wrapAt`. + */ + format?: "beautify" | "keep-breaks" | CleanCSS.FormatOptions | false; + + /** + * inline option whitelists which @import rules will be processed. Defaults to `'local'` + * Accepts the following values: + * 'local': enables local inlining; + * 'remote': enables remote inlining; + * 'none': disables all inlining; + * 'all': enables all inlining, same as ['local', 'remote']; + * '[uri]': enables remote inlining from the specified uri; + * '![url]': disables remote inlining from the specified uri; + */ + inline?: ReadonlyArray | false; + + /** + * Controls extra options for inlining remote @import rules + */ + inlineRequest?: HttpRequestOptions | HttpsRequestOptions; + + /** + * Controls number of milliseconds after which inlining a remote @import fails; defaults to `5000`; + */ + inlineTimeout?: number; + + /** + * Controls optimization level used; defaults to `1`. + * Level hash exposes `1`, and `2`. + */ + level?: 0 | 1 | 2 | CleanCSS.OptimizationsOptions; + + /** + * Controls URL rebasing; defaults to `true`; + */ + rebase?: boolean; + + /** + * controls a directory to which all URLs are rebased, most likely the directory under which the output file + * will live; defaults to the current directory; + */ + rebaseTo?: string; + + /** + * Controls whether an output source map is built; defaults to `false` + */ + sourceMap?: boolean; + + /** + * Controls embedding sources inside a source map's `sourcesContent` field; defaults to `false` + */ + sourceMapInlineSources?: boolean; +} declare namespace CleanCSS { - interface Options { - // Set to false to disable advanced optimizations - selector & property merging, reduction, etc. - advanced?: boolean; - - // Set to false to disable aggressive merging of properties. - aggressiveMerging?: boolean; - - // Turns on benchmarking mode measuring time spent on cleaning up (run npm run bench to see example) - benchmark?: boolean; - - // Enables compatibility mode - compatibility?: Object; - - // Set to true to get minification statistics under stats property (see test/custom-test.js for examples) - debug?: boolean; - - // A hash of options for @import inliner, see test/protocol-imports-test.js for examples, or this comment for a proxy use case. - inliner?: Object; - - // Whether to keep line breaks (default is false) - keepBreaks?: boolean; - - // * for keeping all (default), 1 for keeping first one only, 0 for removing all - keepSpecialComments?: string | number; - - // Whether to merge @media at-rules (default is true) - mediaMerging?: boolean; - - // Whether to process @import rules - processImport?: boolean; - - // A list of @import rules, can be ['all'] (default), ['local'], ['remote'], or a blacklisted path e.g. ['!fonts.googleapis.com'] - processImportFrom?: Array; - - // Set to false to skip URL rebasing - rebase?: boolean; - - // Path to resolve relative @import rules and URLs - relativeTo?: string; - - // Set to false to disable restructuring in advanced optimizations - restructuring?: boolean; - - // Path to resolve absolute @import rules and rebase relative URLs - root?: string; - - // Rounding precision; defaults to 2; -1 disables rounding - roundingPrecision?: number; - - // Set to true to enable semantic merging mode which assumes BEM-like content (default is false as it's highly likely this will break your stylesheets - use with caution!) - semanticMerging?: boolean; - - // Set to false to skip shorthand compacting (default is true unless sourceMap is set when it's false) - shorthandCompacting?: boolean; - - // Exposes source map under sourceMap property, e.g. new CleanCSS().minify(source).sourceMap (default is false) If input styles are a product of CSS preprocessor (Less, Sass) an input source map can be passed as a string. - sourceMap?: boolean | string; - - // Set to true to inline sources inside a source map's sourcesContent field (defaults to false) It is also required to process inlined sources from input source maps. - sourceMapInlineSources?: boolean; - - // Path to a folder or an output file to which rebase all URLs - target?: string; - } - + /** + * Output returned when calling minify functions + */ interface Output { - // Optimized output CSS as a string + /** + * Optimized output CSS as a string + */ styles: string; - // Output source map (if requested with sourceMap option) + /** + * Output source map if requested with `sourceMap` option + */ sourceMap: string; - // A list of errors raised - errors: Array; + /** + * A list of errors raised + */ + errors: string[]; - // A list of warnings raised - warnings: Array; + /** + * A list of warnings raised + */ + warnings: string[]; - // A hash of statistic information (if requested with debug option) + /** + * Contains statistics on the minify process + */ stats: { - // Original content size (after import inlining) + /** + * Original content size after import inlining + */ originalSize: number; - // Optimized content size + /** + * Optimized content size + */ minifiedSize: number; - // Time spent on optimizations + /** + * Time spent on optimizations in milliseconds + */ timeSpent: number; - // A ratio of output size to input size (e.g. 25% if content was reduced from 100 bytes to 75 bytes) + /** + * `(originalSize - minifiedSize) / originalSize`, e.g. 0.25 if size is reduced from 100 bytes to 75 bytes + */ efficiency: number; }; } + + /** + * Fine grained configuration for compatibility option + */ + interface CompatibilityOptions { + /** + * A hash of compatibility options related to color + */ + colors?: { + /** + * Controls `rgba()` / `hsla()` color support; defaults to `true` + */ + opacity?: boolean; + }; + /** + * A hash of properties that can be set with compatibility + */ + properties?: { + /** + * Controls background-clip merging into shorthand; defaults to `true` + */ + backgroundClipMerging?: boolean; + + /** + * Controls background-origin merging into shorthand; defaults to `true` + */ + backgroundOriginMerging?: boolean; + + /** + * Controls background-size merging into shorthand; defaults to `true` + */ + backgroundSizeMerging?: boolean; + + /** + * controls color optimizations; defaults to `true` + */ + colors?: boolean, + + /** + * Controls keeping IE bang hack; defaults to `false` + */ + ieBangHack?: boolean; + + /** + * Controls keeping IE `filter` / `-ms-filter`; defaults to `false` + */ + ieFilters?: boolean; + + /** + * Controls keeping IE prefix hack; defaults to `false` + */ + iePrefixHack?: boolean; + + /** + * Controls keeping IE suffix hack; defaults to `false` + */ + ieSuffixHack?: boolean; + + /** + * Controls property merging based on understandably; defaults to `true` + */ + merging?: boolean; + + /** + * Controls shortening pixel units into `pc`, `pt`, or `in` units; defaults to `false` + */ + shorterLengthUnits?: false; + + /** + * Controls keeping space after closing brace - `url() no-repeat` into `url()no-repeat`; defaults to `true` + */ + spaceAfterClosingBrace?: true; + + /** + * Controls keeping quoting inside `url()`; defaults to `false` + */ + urlQuotes?: boolean; + + /** + * Controls removal of units `0` value; defaults to `true` + */ + zeroUnits?: boolean; + }; + /** + * A hash of options related to compatibility of selectors + */ + selectors?: { + /** + * Controls extra space before `nav` element; defaults to `false` + */ + adjacentSpace?: boolean; + + /** + * Controls removal of IE7 selector hacks, e.g. `*+html...`; defaults to `true` + */ + ie7Hack?: boolean; + + /** + * Controls a whitelist of mergeable pseudo classes; defaults to `[':active', ...]` + */ + mergeablePseudoClasses?: ReadonlyArray; + + /** + * Controls a whitelist of mergeable pseudo elements; defaults to `['::after', ...]` + */ + mergeablePseudoElements: ReadonlyArray; + + /** + * Controls maximum number of selectors in a single rule (since 4.1.0); defaults to `8191` + */ + mergeLimit: number; + + /** + * Controls merging of rules with multiple pseudo classes / elements (since 4.1.0); defaults to `true` + */ + multiplePseudoMerging: boolean; + }; + /** + * A hash of options related to comparability of supported units + */ + units?: { + /** + * Controls treating `ch` as a supported unit; defaults to `true` + */ + ch?: boolean; + + /** + * Controls treating `in` as a supported unit; defaults to `true` + */ + in?: boolean; + + /** + * Controls treating `pc` as a supported unit; defaults to `true` + */ + pc?: boolean; + + /** + * Controls treating `pt` as a supported unit; defaults to `true` + */ + pt?: boolean; + + /** + * Controls treating `rem` as a supported unit; defaults to `true` + */ + rem?: boolean; + + /** + * Controls treating `vh` as a supported unit; defaults to `true` + */ + vh?: boolean; + + /** + * Controls treating `vm` as a supported unit; defaults to `true` + */ + vm?: boolean; + + /** + * Controls treating `vmax` as a supported unit; defaults to `true` + */ + vmax?: boolean; + + /** + * Controls treating `vmin` as a supported unit; defaults to `true` + */ + vmin?: boolean; + }; + } + + /** + * Fine grained options for configuring the CSS formatting + */ + interface FormatOptions { + /** + * Controls where to insert breaks + */ + breaks?: { + /** + * Controls if a line break comes after an at-rule; e.g. `@charset`; defaults to `false` + */ + afterAtRule?: boolean; + + /** + * Controls if a line break comes after a block begins; e.g. `@media`; defaults to `false` + */ + afterBlockBegins?: boolean; + + /** + * Controls if a line break comes after a block ends, defaults to `false` + */ + afterBlockEnds?: boolean; + + /** + * Controls if a line break comes after a comment; defaults to `false` + */ + afterComment?: boolean; + + /** + * Controls if a line break comes after a property; defaults to `false` + */ + afterProperty?: boolean; + + /** + * Controls if a line break comes after a rule begins; defaults to `false` + */ + afterRuleBegins?: boolean; + + /** + * Controls if a line break comes after a rule ends; defaults to `false` + */ + afterRuleEnds?: boolean; + + /** + * Controls if a line break comes before a block ends; defaults to `false` + */ + beforeBlockEnds?: boolean; + + /** + * Controls if a line break comes between selectors; defaults to `false` + */ + betweenSelectors?: boolean; + }; + /** + * Controls the new line character, can be `'\r\n'` or `'\n'`(aliased as `'windows'` and `'unix'` + * or `'crlf'` and `'lf'`); defaults to system one, so former on Windows and latter on Unix + */ + breakWith?: string; + + /** + * Controls number of characters to indent with; defaults to `0` + */ + indentBy?: number; + + /** + * Controls a character to indent with, can be `'space'` or `'tab'`; defaults to `'space'` + */ + indentWith?: "space" | "tab"; + + /** + * Controls where to insert spaces + */ + spaces?: { + /** + * Controls if spaces come around selector relations; e.g. `div > a`; defaults to `false` + */ + aroundSelectorRelation?: boolean; + + /** + * Controls if a space comes before a block begins; e.g. `.block {`; defaults to `false` + */ + beforeBlockBegins?: boolean; + + /** + * Controls if a space comes before a value; e.g. `width: 1rem`; defaults to `false` + */ + beforeValue?: boolean; + }; + /** + * Controls maximum line length; defaults to `false` + */ + wrapAt?: false | number; + } + + /** + * Fine grained options for configuring optimizations + */ + interface OptimizationsOptions { + 1?: { + /** + * Sets all optimizations at this level unless otherwise specified + */ + all?: boolean; + + /** + * Controls `@charset` moving to the front of a stylesheet; defaults to `true` + */ + cleanupCharsets?: boolean; + + /** + * Controls URL normalization; defaults to `true` + */ + normalizeUrls?: boolean; + + /** + * Controls `background` property optimizations; defaults to `true` + */ + optimizeBackground?: boolean; + + /** + * Controls `border-radius` property optimizations; defaults to `true` + */ + optimizeBorderRadius?: boolean; + + /** + * Controls `filter` property optimizations; defaults to `true` + */ + optimizeFilter?: boolean; + + /** + * Controls `font` property optimizations; defaults to `true` + */ + optimizeFont?: boolean; + + /** + * Controls `font-weight` property optimizations; defaults to `true` + */ + optimizeFontWeight?: boolean; + + /** + * Controls `outline` property optimizations; defaults to `true` + */ + optimizeOutline?: boolean; + + /** + * Controls removing empty rules and nested blocks; defaults to `true` + */ + removeEmpty?: boolean; + + /** + * Controls removing negative paddings; defaults to `true` + */ + removeNegativePaddings?: boolean; + + /** + * Controls removing quotes when unnecessary; defaults to `true` + */ + removeQuotes?: boolean; + + /** + * Controls removing unused whitespace; defaults to `true` + */ + removeWhitespace?: boolean; + + /** + * Contols removing redundant zeros; defaults to `true` + */ + replaceMultipleZeros?: boolean; + + /** + * Controls replacing time units with shorter values; defaults to `true` + */ + replaceTimeUnits?: boolean; + + /** + * Controls replacing zero values with units; defaults to `true` + */ + replaceZeroUnits?: boolean; + + /** + * Rounds pixel values to `N` decimal places; `false` disables rounding; defaults to `false` + */ + roundingPrecision?: boolean; + + /** + * denotes selector sorting method; can be `'natural'` or `'standard'`, `'none'`, or false (the last two + * since 4.1.0); defaults to `'standard'` + */ + selectorsSortingMethod?: "standard" | "natural" | "none"; + + /** + * denotes a number of /*! ... * / comments preserved; defaults to `all` + */ + specialComments?: string; + + /** + * Controls at-rules (e.g. `@charset`, `@import`) optimizing; defaults to `true` + */ + tidyAtRules?: boolean; + + /** + * Controls block scopes (e.g. `@media`) optimizing; defaults to `true` + */ + tidyBlockScopes?: boolean; + + /** + * Controls selectors optimizing; defaults to `true` + */ + tidySelectors?: boolean; + + /** + * Controls removing trailing semicolons in rule; defaults to `false` - means remove + */ + semicolonAfterLastProperty?: boolean; + + /** + * Defines a callback for fine-grained property optimization; defaults to no-op + */ + transform?: (propertyName: string, propertyValue: string, selector?: string) => string; + }; + 2?: { + /** + * Sets all optimizations at this level unless otherwise specified + */ + all?: boolean; + + /** + * Controls adjacent rules merging; defaults to true + */ + mergeAdjacentRules?: boolean; + + /** + * Controls merging properties into shorthands; defaults to true + */ + mergeIntoShorthands?: boolean; + + /** + * Controls `@media` merging; defaults to true + */ + mergeMedia?: boolean; + + /** + * Controls non-adjacent rule merging; defaults to true + */ + mergeNonAdjacentRules?: boolean; + + /** + * Controls semantic merging; defaults to false + */ + mergeSemantically?: boolean; + + /** + * Controls property overriding based on understandably; defaults to true + */ + overrideProperties?: boolean; + + /** + * Controls removing empty rules and nested blocks; defaults to `true` + */ + removeEmpty?: boolean; + + /** + * Controls non-adjacent rule reducing; defaults to true + */ + reduceNonAdjacentRules?: boolean; + + /** + * Controls duplicate `@font-face` removing; defaults to true + */ + removeDuplicateFontRules?: boolean; + + /** + * Controls duplicate `@media` removing; defaults to true + */ + removeDuplicateMediaBlocks?: boolean; + + /** + * Controls duplicate rules removing; defaults to true + */ + removeDuplicateRules?: boolean; + + /** + * Controls unused at rule removing; defaults to false (available since 4.1.0) + */ + removeUnusedAtRules?: boolean; + + /** + * Controls rule restructuring; defaults to false + */ + restructureRules?: boolean; + + /** + * Controls which properties won't be optimized, defaults to `[]` which means all will be optimized (since 4.1.0) + */ + skipProperties?: ReadonlyArray; + }; + } + + /** + * Hash of input source(s). Passing an array of hashes allows you to explicitly specify the order in which the input files + * are concatenated. Whereas when you use a single hash the order is determined by the traversal order of object properties + */ + interface Source { + /** + * Path to file + */ + [path: string]: { + /** + * The contents of the file, should be css + */ + styles: string; + + /** + * The source map of the file, if needed + */ + sourceMap?: string; + }; + } + + /** + * Callback type when fetch is used + */ + type FetchCallback = (message: string | number, body: string) => void; + + /** + * Union of all types acceptable as input for the minify function + */ + type Sources = string | ReadonlyArray | Source | ReadonlyArray | Buffer; + + /** + * Union type for both types of minifier functions + */ + type Minifier = MinifierOutput | MinifierPromise; + + /** + * Interface exposed when a new CleanCSS object is created + */ + interface MinifierOutput { + minify(sources: Sources, callback?: (error: any, output: Output) => void): Output; + minify(sources: Sources, sourceMap: string, callback?: (error: any, output: Output) => void): Output; + } + /** + * Interface exposed when a new CleanCSS object is created with returnPromise set to true + */ + interface MinifierPromise { + minify(sources: Sources, sourceMap?: string): Promise; + } + + /** + * Options when returning a promise + */ + type OptionsPromise = OptionsBase & { + /** + * If you prefer clean-css to return a Promise object then you need to explicitly ask for it; defaults to `false` + */ + returnPromise: true + }; + + /** + * Options when returning an output + */ + type OptionsOutput = OptionsBase & { + /** + * If you prefer clean-css to return a Promise object then you need to explicitly ask for it; defaults to `false` + */ + returnPromise?: false + }; + + /** + * Discriminant union of both sets of options types. If you initialize without setting `returnPromise: true` + * and want to return a promise, you will need to cast to the correct options type so that TypeScript + * knows what the expected return type will be: + * `(options = options as CleanCSS.OptionsPromise).returnPromise = true` + */ + type Options = OptionsPromise | OptionsOutput; + + /** + * Constructor interface for CleanCSS + */ + interface Constructor { + new(options: OptionsPromise): MinifierPromise; + new(options?: OptionsOutput): MinifierOutput; + } } -declare class CleanCSS { - constructor(options?: CleanCSS.Options); - minify(sources: string | Array | Object, callback?: (error: any, minified: CleanCSS.Output) => void): CleanCSS.Output; -} +/** + * Creates a new CleanCSS object which can be used to minify css + */ +declare const CleanCSS: CleanCSS.Constructor; export = CleanCSS; diff --git a/types/clean-css/tslint.json b/types/clean-css/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/clean-css/tslint.json +++ b/types/clean-css/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/clean-css/v3/clean-css-tests.ts b/types/clean-css/v3/clean-css-tests.ts new file mode 100644 index 0000000000..b9b958d51b --- /dev/null +++ b/types/clean-css/v3/clean-css-tests.ts @@ -0,0 +1,54 @@ + +import * as CleanCSS from 'clean-css'; + +var source = 'a{font-weight:bold;}'; +var minified = new CleanCSS().minify(source).styles; + +var source = '@import url(http://path/to/remote/styles);'; +new CleanCSS().minify(source, function (error, minified) { + console.log(minified.styles); +}); + +const pathToOutputDirectory = 'path'; + +new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) + .minify(source, function (error, minified) { + // access minified.sourceMap for SourceMapGenerator object + // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details + // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI + console.log(minified.sourceMap); +}); + +const inputSourceMapAsString = 'input'; +new CleanCSS({ sourceMap: inputSourceMapAsString, target: pathToOutputDirectory }) + .minify(source, function (error, minified) { + // access minified.sourceMap to access SourceMapGenerator object + // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details + // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI + console.log(minified.sourceMap); +}); + +new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ + 'path/to/source/1': { + styles: '...styles...', + sourceMap: '...source-map...' + }, + 'path/to/source/2': { + styles: '...styles...', + sourceMap: '...source-map...' + } +}, function (error, minified) { + // access minified.sourceMap as above + console.log(minified.sourceMap); +}); + +new CleanCSS().minify(['path/to/file/one', 'path/to/file/two']); + +new CleanCSS().minify({ + 'path/to/file/one': { + styles: 'contents of file one' + }, + 'path/to/file/two': { + styles: 'contents of file two' + } +}); \ No newline at end of file diff --git a/types/clean-css/v3/index.d.ts b/types/clean-css/v3/index.d.ts new file mode 100644 index 0000000000..87fb7e7f6c --- /dev/null +++ b/types/clean-css/v3/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for clean-css v3.4.9 +// Project: https://github.com/jakubpawlowicz/clean-css +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare namespace CleanCSS { + interface Options { + // Set to false to disable advanced optimizations - selector & property merging, reduction, etc. + advanced?: boolean; + + // Set to false to disable aggressive merging of properties. + aggressiveMerging?: boolean; + + // Turns on benchmarking mode measuring time spent on cleaning up (run npm run bench to see example) + benchmark?: boolean; + + // Enables compatibility mode + compatibility?: Object; + + // Set to true to get minification statistics under stats property (see test/custom-test.js for examples) + debug?: boolean; + + // A hash of options for @import inliner, see test/protocol-imports-test.js for examples, or this comment for a proxy use case. + inliner?: Object; + + // Whether to keep line breaks (default is false) + keepBreaks?: boolean; + + // * for keeping all (default), 1 for keeping first one only, 0 for removing all + keepSpecialComments?: string | number; + + // Whether to merge @media at-rules (default is true) + mediaMerging?: boolean; + + // Whether to process @import rules + processImport?: boolean; + + // A list of @import rules, can be ['all'] (default), ['local'], ['remote'], or a blacklisted path e.g. ['!fonts.googleapis.com'] + processImportFrom?: Array; + + // Set to false to skip URL rebasing + rebase?: boolean; + + // Path to resolve relative @import rules and URLs + relativeTo?: string; + + // Set to false to disable restructuring in advanced optimizations + restructuring?: boolean; + + // Path to resolve absolute @import rules and rebase relative URLs + root?: string; + + // Rounding precision; defaults to 2; -1 disables rounding + roundingPrecision?: number; + + // Set to true to enable semantic merging mode which assumes BEM-like content (default is false as it's highly likely this will break your stylesheets - use with caution!) + semanticMerging?: boolean; + + // Set to false to skip shorthand compacting (default is true unless sourceMap is set when it's false) + shorthandCompacting?: boolean; + + // Exposes source map under sourceMap property, e.g. new CleanCSS().minify(source).sourceMap (default is false) If input styles are a product of CSS preprocessor (Less, Sass) an input source map can be passed as a string. + sourceMap?: boolean | string; + + // Set to true to inline sources inside a source map's sourcesContent field (defaults to false) It is also required to process inlined sources from input source maps. + sourceMapInlineSources?: boolean; + + // Path to a folder or an output file to which rebase all URLs + target?: string; + } + + interface Output { + // Optimized output CSS as a string + styles: string; + + // Output source map (if requested with sourceMap option) + sourceMap: string; + + // A list of errors raised + errors: Array; + + // A list of warnings raised + warnings: Array; + + // A hash of statistic information (if requested with debug option) + stats: { + // Original content size (after import inlining) + originalSize: number; + + // Optimized content size + minifiedSize: number; + + // Time spent on optimizations + timeSpent: number; + + // A ratio of output size to input size (e.g. 25% if content was reduced from 100 bytes to 75 bytes) + efficiency: number; + }; + } +} + +declare class CleanCSS { + constructor(options?: CleanCSS.Options); + minify(sources: string | Array | Object, callback?: (error: any, minified: CleanCSS.Output) => void): CleanCSS.Output; +} + +export = CleanCSS; \ No newline at end of file diff --git a/types/clean-css/v3/tsconfig.json b/types/clean-css/v3/tsconfig.json new file mode 100644 index 0000000000..8a2c2eae67 --- /dev/null +++ b/types/clean-css/v3/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "clean-css": [ + "clean-css/v3" + ], + "clean-css/*": [ + "clean-css/v3/*" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clean-css-tests.ts" + ] +} \ No newline at end of file diff --git a/types/clean-css/v3/tslint.json b/types/clean-css/v3/tslint.json new file mode 100644 index 0000000000..a4c53997aa --- /dev/null +++ b/types/clean-css/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "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 newline at end of file diff --git a/types/clean-regexp/clean-regexp-tests.ts b/types/clean-regexp/clean-regexp-tests.ts new file mode 100644 index 0000000000..e111e4e78e --- /dev/null +++ b/types/clean-regexp/clean-regexp-tests.ts @@ -0,0 +1,12 @@ +import cleanRegexp = require('clean-regexp'); + +// $ExpectType string +cleanRegexp('[0-9]'); +cleanRegexp('[^0-9]'); +cleanRegexp('[a-zA-Z0-9_]'); +cleanRegexp('[a-z0-9_]', 'i'); +cleanRegexp('[^a-zA-Z0-9_]'); +cleanRegexp('[^a-z0-9_]', 'i'); +cleanRegexp('[a-zA-Z\\d_]'); +cleanRegexp('[^a-zA-Z\\d_]'); +cleanRegexp('[0-9]+\\.[a-zA-Z0-9_]?'); diff --git a/types/clean-regexp/index.d.ts b/types/clean-regexp/index.d.ts new file mode 100644 index 0000000000..7418cfd253 --- /dev/null +++ b/types/clean-regexp/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for clean-regexp 1.0 +// Project: https://github.com/samverschueren/clean-regexp#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = cleanRegexp; + +declare function cleanRegexp(regexp: string, flags?: string): string; diff --git a/types/clean-regexp/tsconfig.json b/types/clean-regexp/tsconfig.json new file mode 100644 index 0000000000..e1bbe6de0b --- /dev/null +++ b/types/clean-regexp/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", + "clean-regexp-tests.ts" + ] +} diff --git a/types/clean-regexp/tslint.json b/types/clean-regexp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/clean-regexp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cleave.js/cleave.js-tests.tsx b/types/cleave.js/cleave.js-tests.tsx index a826d2607a..461e4f4d05 100644 --- a/types/cleave.js/cleave.js-tests.tsx +++ b/types/cleave.js/cleave.js-tests.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import Cleave = require("cleave.js"); import CleaveReact = require("cleave.js/react"); -import { Props } from "cleave.js/react/props"; +import { Props, ChangeEvent } from "cleave.js/react/props"; const ExampleSelector1 = () => { const cleave = new Cleave("#my-input", { phone: true }); @@ -41,3 +41,17 @@ const ExampleReact2 = (props: Props) => { /> ); }; + +const ExampleReact3 = (props: Props) => { + const handleChange = (e: ChangeEvent) => { + return e.target.rawValue; + }; + return ( + + ); +}; diff --git a/types/cleave.js/index.d.ts b/types/cleave.js/index.d.ts index 77d2e818ca..11067195ea 100644 --- a/types/cleave.js/index.d.ts +++ b/types/cleave.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cleave.js 1.3 +// Type definitions for cleave.js 1.4 // Project: https://github.com/nosir/cleave.js // Definitions by: C Lentfort , // J Giancono , diff --git a/types/cleave.js/react/props.d.ts b/types/cleave.js/react/props.d.ts index 6ce47db62c..d881e1b319 100644 --- a/types/cleave.js/react/props.d.ts +++ b/types/cleave.js/react/props.d.ts @@ -3,8 +3,15 @@ import { CleaveOptions } from "../options"; export type InitHandler = (owner: React.ReactInstance) => void; +export interface ChangeEvent extends React.ChangeEvent { + target: { rawValue: string } & EventTarget & T; +} + +export type ChangeEventHandler = React.EventHandler>; + export interface Props extends React.InputHTMLAttributes { onInit?: InitHandler; options: CleaveOptions; htmlRef?: (i: any) => void; + onChange?: ChangeEventHandler; } diff --git a/types/cli-box/cli-box-tests.ts b/types/cli-box/cli-box-tests.ts new file mode 100644 index 0000000000..a26b436e21 --- /dev/null +++ b/types/cli-box/cli-box-tests.ts @@ -0,0 +1,47 @@ +import Box = require('cli-box'); + +// Create a simple box +const b1: Box = Box("20x10"); +// console.log(b1.toString()); + +// Set custom marks +const b2: Box = new Box({ + w: 10 + , h: 10 + , stringify: false + , marks: { + nw: "╔" + , n: "══" + , ne: "╗" + , e: "║" + , se: "╝" + , s: "══" + , sw: "╚" + , w: "║" + , b: "░░" + } +}); +// console.log(b2.stringify()); + +// Box with text and use the stringify +const b3: Box = Box("20x10", "I will be \u001b[31mdis\u001b[0mplayed inside! \n A\u001b[34mnd I'm in a\u001b[0m new line!"); +// console.log(b3); + +// Box with aligned text to top-right +const b4: Box = Box("30x20", { + text: "Box content" + , stretch: true + , autoEOL: true + , vAlign: "top" + , hAlign: "right" +}); +// console.log(b4); + +// Full screen box +const b5: Box = Box({fullscreen: true, marks: {}}, "Hello World!"); +// console.log(b5.toString()); + +const b5s: string = Box({stringify: true, fullscreen: true, marks: {}}, "Hello World!"); +const b5ns: Box = Box({stringify: false, fullscreen: true, marks: {}}, "Hello World!"); + +const defaults = Box.defaults; diff --git a/types/cli-box/index.d.ts b/types/cli-box/index.d.ts new file mode 100644 index 0000000000..c2466853a6 --- /dev/null +++ b/types/cli-box/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for cli-box 6.0 +// Project: https://github.com/IonicaBizau/node-cli-box +// Definitions by: Kent Wong +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/*~ Note that ES6 modules cannot directly export callable functions. + *~ This file should be imported using the CommonJS-style: + *~ import x = require('someLibrary'); + *~ + *~ Refer to the documentation to understand common + *~ workarounds for this limitation of ES6 modules. + */ + +/*~ This declaration specifies that the function + *~ is the exported object from the file + */ +export = Box; + +type MarksKeys = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'b'; +type Marks = Record; + +interface Options { + w?: number; + width?: number; + h?: number; + height?: number; + fullscreen?: boolean; + stringify?: boolean; + marks?: Partial; +} + +interface Text { + text?: string; + stretch?: boolean; + autoEOL?: boolean; + hAlign?: 'left' | 'middle' | 'right'; + vAlign?: 'top' | 'center' | 'bottom'; +} + +interface Box { + stringify(): string; + settings: { + width: number; + height: number; + marks: Marks; + lines: Array<{ + text: string; + offset: { + y: number; + } + }> + }; + options: { + width: number; + height: number; + marks: Marks; + fullscreen: boolean; + stringify: boolean; + }; +} + +interface BoxConstructor { + new(options: Options | string, text?: Text | string): Box; + (options: (Exclude & { stringify: true }), text?: Text | string): string; + (options: Options | string, text?: Text | string): Box; + defaults: { marks: Marks }; +} + +declare const Box: BoxConstructor; diff --git a/types/cli-box/tsconfig.json b/types/cli-box/tsconfig.json new file mode 100644 index 0000000000..d9a3d38876 --- /dev/null +++ b/types/cli-box/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", + "cli-box-tests.ts" + ] +} diff --git a/types/cli-box/tslint.json b/types/cli-box/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-box/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-boxes/cli-boxes-tests.ts b/types/cli-boxes/cli-boxes-tests.ts new file mode 100644 index 0000000000..9885f28777 --- /dev/null +++ b/types/cli-boxes/cli-boxes-tests.ts @@ -0,0 +1,17 @@ +import cliBoxes = require('cli-boxes'); + +cliBoxes.single; // $ExpectType BoxDefinition +cliBoxes.double; // $ExpectType BoxDefinition +cliBoxes.round; // $ExpectType BoxDefinition +cliBoxes['single-double']; // $ExpectType BoxDefinition +cliBoxes['double-single']; // $ExpectType BoxDefinition +cliBoxes.classic; // $ExpectType BoxDefinition + +const single = cliBoxes.single; + +single.bottomLeft; // $ExpectType string +single.bottomRight; // $ExpectType string +single.horizontal; // $ExpectType string +single.topLeft; // $ExpectType string +single.topRight; // $ExpectType string +single.vertical; // $ExpectType string diff --git a/types/cli-boxes/index.d.ts b/types/cli-boxes/index.d.ts new file mode 100644 index 0000000000..e3b4c7be79 --- /dev/null +++ b/types/cli-boxes/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for cli-boxes 1.0 +// Project: https://github.com/sindresorhus/cli-boxes +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = boxes; +declare const boxes: boxes.Boxes; + +declare namespace boxes { + type BoxNames = 'single' | 'double' | 'round' | 'single-double' | 'double-single' | 'classic'; + + type Boxes = Record; + + interface BoxDefinition { + topLeft: string; + topRight: string; + bottomRight: string; + bottomLeft: string; + vertical: string; + horizontal: string; + } +} diff --git a/types/cli-boxes/tsconfig.json b/types/cli-boxes/tsconfig.json new file mode 100644 index 0000000000..f8a8653c69 --- /dev/null +++ b/types/cli-boxes/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-boxes-tests.ts" + ] +} diff --git a/types/cli-boxes/tslint.json b/types/cli-boxes/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-boxes/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-cursor/cli-cursor-tests.ts b/types/cli-cursor/cli-cursor-tests.ts new file mode 100644 index 0000000000..877ce32f94 --- /dev/null +++ b/types/cli-cursor/cli-cursor-tests.ts @@ -0,0 +1,11 @@ +import { show, hide, toggle } from 'cli-cursor'; + +hide(); +hide(process.stderr); + +show(); +show(process.stderr); + +toggle(); +toggle(false); +toggle(false, process.stderr); diff --git a/types/cli-cursor/index.d.ts b/types/cli-cursor/index.d.ts new file mode 100644 index 0000000000..d6decf8479 --- /dev/null +++ b/types/cli-cursor/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for cli-cursor 2.1 +// Project: https://github.com/sindresorhus/cli-cursor#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * Show cursor. + * + * @param stream defaults to `process.stderr` + */ +export function show(stream?: NodeJS.WritableStream): void; + +/** + * Hide cursor. + * + * @param stream defaults to `process.stderr` + */ +export function hide(stream?: NodeJS.WritableStream): void; + +/** + * Toggle cursor visibility. + * + * @param force is useful to show or hide the cursor based on a boolean. + * @param stream defaults to `process.stderr` + */ +export function toggle(force?: boolean, stream?: NodeJS.WritableStream): void; diff --git a/types/cli-cursor/tsconfig.json b/types/cli-cursor/tsconfig.json new file mode 100644 index 0000000000..2d57093f55 --- /dev/null +++ b/types/cli-cursor/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-cursor-tests.ts" + ] +} diff --git a/types/cli-cursor/tslint.json b/types/cli-cursor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-cursor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-spinners/cli-spinners-tests.ts b/types/cli-spinners/cli-spinners-tests.ts new file mode 100644 index 0000000000..45acb25db7 --- /dev/null +++ b/types/cli-spinners/cli-spinners-tests.ts @@ -0,0 +1,3 @@ +import cliSpinners = require('cli-spinners'); + +cliSpinners.dots; // $ExpectType Spinner diff --git a/types/cli-spinners/index.d.ts b/types/cli-spinners/index.d.ts new file mode 100644 index 0000000000..db04ab5cc1 --- /dev/null +++ b/types/cli-spinners/index.d.ts @@ -0,0 +1,87 @@ +// Type definitions for cli-spinners 1.3 +// Project: https://github.com/sindresorhus/cli-spinners#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = cliSpinners; + +declare const cliSpinners: Record; + +declare namespace cliSpinners { + type SpinnerName = + | 'dots' + | 'dots2' + | 'dots3' + | 'dots4' + | 'dots5' + | 'dots6' + | 'dots7' + | 'dots8' + | 'dots9' + | 'dots10' + | 'dots11' + | 'dots12' + | 'line' + | 'line2' + | 'pipe' + | 'simpleDots' + | 'simpleDotsScrolling' + | 'star' + | 'star2' + | 'flip' + | 'hamburger' + | 'growVertical' + | 'growHorizontal' + | 'balloon' + | 'balloon2' + | 'noise' + | 'bounce' + | 'boxBounce' + | 'boxBounce2' + | 'triangle' + | 'arc' + | 'circle' + | 'squareCorners' + | 'circleQuarters' + | 'circleHalves' + | 'squish' + | 'toggle' + | 'toggle2' + | 'toggle3' + | 'toggle4' + | 'toggle5' + | 'toggle6' + | 'toggle7' + | 'toggle8' + | 'toggle9' + | 'toggle10' + | 'toggle11' + | 'toggle12' + | 'toggle13' + | 'arrow' + | 'arrow2' + | 'arrow3' + | 'bouncingBar' + | 'bouncingBall' + | 'smiley' + | 'monkey' + | 'hearts' + | 'clock' + | 'earth' + | 'moon' + | 'runner' + | 'pong' + | 'shark' + | 'dqpb' + | 'weather' + | 'christmas' + | 'grenade' + | 'point' + | 'layer'; + + interface Spinner { + interval: number; + frames: string[]; + } +} diff --git a/types/cli-spinners/tsconfig.json b/types/cli-spinners/tsconfig.json new file mode 100644 index 0000000000..8b4a54bd83 --- /dev/null +++ b/types/cli-spinners/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-spinners-tests.ts" + ] +} diff --git a/types/cli-spinners/tslint.json b/types/cli-spinners/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-spinners/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/clovelced-plugin-audiomanagement/clovelced-plugin-audiomanagement-tests.ts b/types/clovelced-plugin-audiomanagement/clovelced-plugin-audiomanagement-tests.ts new file mode 100644 index 0000000000..ed544553b9 --- /dev/null +++ b/types/clovelced-plugin-audiomanagement/clovelced-plugin-audiomanagement-tests.ts @@ -0,0 +1,29 @@ +import * as AudioManagement from 'clovelced-plugin-audiomanagement'; + +AudioManagement.setAudioMode(AudioManagement.AudioMode.NORMAL, () => { +}, (error: any) => { +}); + +AudioManagement.getAudioMode((results) => { + results.audioMode; + results.label; +}, (error: any) => { +}); + +AudioManagement.setVolume(AudioManagement.VolumeType.MUSIC, 5, () => { +}, (error: any) => { +}); + +AudioManagement.getVolume(AudioManagement.VolumeType.NOTIFICATION, (results) => { + results.volume; +}, (error: any) => { +}); + +AudioManagement.getMaxVolume(AudioManagement.VolumeType.RING, (results) => { + results.maxVolume; +}, (error: any) => { +}); + +AudioManagement.AudioMode.SILENT; +AudioManagement.AudioMode.VIBRATE; +AudioManagement.VolumeType.SYSTEM; diff --git a/types/clovelced-plugin-audiomanagement/index.d.ts b/types/clovelced-plugin-audiomanagement/index.d.ts new file mode 100644 index 0000000000..efd51a941a --- /dev/null +++ b/types/clovelced-plugin-audiomanagement/index.d.ts @@ -0,0 +1,67 @@ +// Type definitions for clovelced-plugin-audiomanagement 1.0 +// Project: https://github.com/clovelCed/cordova-plugin-audiomanagement#readme +// Definitions by: Marc Kassay +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export enum AudioMode { + SILENT = 0, + VIBRATE, + NORMAL +} + +export enum VolumeType { + RING = 0, + MUSIC, + NOTIFICATION, + SYSTEM +} + +/** + * Sets the `AudioManagement.AudioMode` for the device. + * + * @param mode the device can be set to: Silent, Normal, Vibrate + * @param onSuccess a callback when setting succeeds. + * @param onError a callback when setting fails. + * @returns void + */ +export function setAudioMode(mode: AudioMode, onSuccess: () => void, onError: (error: any) => void): void; + +/** + * Gets the current `AudioManagement.AudioMode` of the device. + * + * @param onSuccess a callback when succeeds with an object with `label` and `audioMode` properties. + * @param onError a callback when getting fails. + * @returns void + */ +export function getAudioMode(onSuccess: (results: { audioMode: AudioMode, label: string }) => void, onError: (error: any) => void): void; + +/** + * Sets the specified `AudioManagement.VolumeType` for the device with the value from `volume`. + * + * @param type the `AudioManagement.VolumeType` to set + * @param volume the volume value + * @param onSuccess a callback when setting succeeds. + * @param onError a callback when setting fails. + * @returns void + */ +export function setVolume(type: VolumeType, volume: number, onSuccess: () => void, onError: (error: any) => void): void; + +/** + * Gets the specified `AudioManagement.VolumeType`'s `volume`. + * + * @param type the `AudioManagement.VolumeType` to get + * @param onSuccess a callback when getting succeeds with an object with numeric `volume` property. + * @param onError a callback when getting fails. + * @returns void + */ +export function getVolume(type: VolumeType, onSuccess: (results: { volume: number }) => void, onError: (error: any) => void): void; + +/** + * Gets the specified `AudioManagement.VolumeType`'s maximum `volume` that the device is currently set to. + * + * @param type the `AudioManagement.VolumeType` to get + * @param onSuccess a callback when getting succeeds with an object with numeric `maxVolume` property. + * @param onError a callback when getting fails. + * @returns void + */ +export function getMaxVolume(type: VolumeType, onSuccess: (results: { maxVolume: number }) => void, onError: (error: any) => void): void; diff --git a/types/clovelced-plugin-audiomanagement/tsconfig.json b/types/clovelced-plugin-audiomanagement/tsconfig.json new file mode 100644 index 0000000000..5798a1f280 --- /dev/null +++ b/types/clovelced-plugin-audiomanagement/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", + "clovelced-plugin-audiomanagement-tests.ts" + ] +} diff --git a/types/clovelced-plugin-audiomanagement/tslint.json b/types/clovelced-plugin-audiomanagement/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/clovelced-plugin-audiomanagement/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/clusterize.js/index.d.ts b/types/clusterize.js/index.d.ts index 7c549761d6..47da5a2140 100644 --- a/types/clusterize.js/index.d.ts +++ b/types/clusterize.js/index.d.ts @@ -32,9 +32,9 @@ declare namespace Clusterize { } interface Callbacks { - clusterWillChange?(cb: () => void): void; - clusterChanged?(cb: () => void): void; - scrollingProgress?(cb: (progress: number) => void): void; + clusterWillChange?: () => void; + clusterChanged?: () => void; + scrollingProgress?: (progress: number) => void; } } diff --git a/types/code/code-tests.ts b/types/code/code-tests.ts index 9e5f12645f..f9b55ca72e 100644 --- a/types/code/code-tests.ts +++ b/types/code/code-tests.ts @@ -103,6 +103,7 @@ expect("abcd").to.have.length(4); expect(5).to.equal(5); expect({ a: 1 }).to.equal({ a: 1 }); +expect([1, 2, 3]).to.equal([1, 2, 3]); expect(Object.create(null)).to.equal({}, { prototype: false }); diff --git a/types/code/index.d.ts b/types/code/index.d.ts index 3bdca4be9a..7047fc0702 100644 --- a/types/code/index.d.ts +++ b/types/code/index.d.ts @@ -125,9 +125,9 @@ export interface Values { /** Asserts that the reference value has a length property matching the provided size or an object with the specified number of keys. */ length(size: number): AssertionChain; /** Asserts that the reference value equals the provided value. */ - equal(value: T, options?: any): AssertionChain; + equal(value: T | T[], options?: any): AssertionChain; /** Asserts that the reference value equals the provided value. */ - equals(value: T, options?: any): AssertionChain; + equals(value: T | T[], options?: any): AssertionChain; /** Asserts that the reference value is greater than (>) the provided value. */ above(value: T): AssertionChain; /** Asserts that the reference value is greater than (>) the provided value. */ diff --git a/types/codemirror/codemirror-comment.d.ts b/types/codemirror/codemirror-comment.d.ts new file mode 100644 index 0000000000..706e42e807 --- /dev/null +++ b/types/codemirror/codemirror-comment.d.ts @@ -0,0 +1,43 @@ +// 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; + } +} diff --git a/types/codemirror/codemirror-panel.d.ts b/types/codemirror/codemirror-panel.d.ts new file mode 100644 index 0000000000..a361992641 --- /dev/null +++ b/types/codemirror/codemirror-panel.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_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; + + } +} diff --git a/types/codemirror/codemirror-showhint.d.ts b/types/codemirror/codemirror-showhint.d.ts index c6f367d0d2..dfbbcdc4e1 100644 --- a/types/codemirror/codemirror-showhint.d.ts +++ b/types/codemirror/codemirror-showhint.d.ts @@ -76,7 +76,3 @@ declare module "codemirror" { hintOptions?: ShowHintOptions; } } - -declare module "codemirror/addon/hint/show-hint" { - export = CodeMirror; -} diff --git a/types/codemirror/codemirror-tern.d.ts b/types/codemirror/codemirror-tern.d.ts new file mode 100644 index 0000000000..32a6f54e46 --- /dev/null +++ b/types/codemirror/codemirror-tern.d.ts @@ -0,0 +1,96 @@ +// 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_tern and https://codemirror.net/addon/tern/tern.js (comments in the beginning of the file) +// Docs for tern itself might also be helpful: http://ternjs.net/doc/manual.html + +import * as CodeMirror from "codemirror"; +import * as Tern from "tern"; + +declare module "codemirror" { + + interface TernServer { + readonly options: TernOptions; + readonly docs: { + readonly [key: string]: { + doc: CodeMirror.Doc, + name: string, + changed?: { + from: CodeMirror.Position | number, + to: CodeMirror.Position | number + } + } + }; + readonly server: Tern.Server; + addDoc(name: string, doc: CodeMirror.Doc): { doc: CodeMirror.Doc, name: string, changed: { from: number, to: number } | null }; + delDoc(id: string | CodeMirror.Editor | CodeMirror.Doc): void; + hideDoc(id: string | CodeMirror.Editor | CodeMirror.Doc): void; + complete(cm: CodeMirror.Doc): void; + showType(cm: CodeMirror.Doc, pos?: CodeMirror.Position | number, callback?: Function): void; + showDocs(cm: CodeMirror.Doc, pos?: CodeMirror.Position | number, callback?: Function): void; + updateArgHints(cm: CodeMirror.Doc): void; + jumpToDef(cm: CodeMirror.Doc): void; + jumpBack(cm: CodeMirror.Doc): void; + rename(cm: CodeMirror.Doc): void; + selectName(cm: CodeMirror.Doc): void; + request(cm: CodeMirror.Doc, query: Q, callback: (error?: Error, data?: Tern.QueryRegistry[Q["type"]]["result"]) => void, pos?: CodeMirror.Position): void; + request(cm: CodeMirror.Doc, query: Q, callback: (error?: Error, data?: Tern.QueryRegistry[Q]["result"]) => void, pos?: CodeMirror.Position): void; + destroy(): void; + } + + interface TernConstructor { + new(options?: TernOptions): TernServer; + } + export const TernServer: TernConstructor; + + interface TernOptions { + /** An object mapping plugin names to configuration options. */ + plugins?: Tern.ConstructorOptions["plugins"]; + /** An array of JSON definition data structures. */ + defs?: Tern.Def[]; + /** + * Can be used to access files in + * the project that haven't been loaded yet. Simply do callback(null) to + * indicate that a file is not available. + */ + getFile?(name: string, callback: (doc: CodeMirror.Doc | null) => any): any; + /** + * This function will be applied + * to documents before passing them on to Tern. + */ + fileFilter?(value: string, docName: string, doc: CodeMirror.Doc): string; + /** This function should, when providing a multi-file view, switch the view or focus to the named file. */ + switchToDoc?(name: string, doc: CodeMirror.Doc): any; + /** Can be used to override the way errors are displayed. */ + showError?(editor: CodeMirror.Editor, message: Error): any; + /** + * Customize the content in tooltips for completions. + * Is passed a single argument — the completion's data as returned by + * Tern — and may return a string, DOM node, or null to indicate that + * no tip should be shown. By default the docstring is shown. + */ + completionTip?(data: Tern.CompletionsQueryResult): string | HTMLElement | null; + /** Like completionTip, but for the tooltips shown for type queries. */ + typeTip?(data: Tern.TypeQueryResult): string | HTMLElement | null; + /** This function will be applied to the Tern responses before treating them */ + responseFilter?(doc: CodeMirror.Doc, query: Tern.Query, request: Tern.Document, error: Error | undefined, data: Tern.QueryRegistry[Tern.Query["type"]]["result"] | undefined): any; + /** + * Set to true to enable web worker mode. You'll probably + * want to feature detect the actual value you use here, for example + * !!window.Worker. + */ + useWorker?: boolean; + /** The main script of the worker. Point this to wherever you are hosting worker.js from this directory. */ + workerScript?: string; + /** + * An array of paths pointing (relative to workerScript) + * to the Acorn and Tern libraries and any Tern plugins you want to + * load. Or, if you minified those into a single script and included + * them in the workerScript, simply leave this undefined. + */ + workerDeps?: string[]; + } + +} diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index 730fc1cb65..bfef4c5e88 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -4,7 +4,9 @@ // nrbernard // Pr1st0n // rileymiller +// toddself // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 export = CodeMirror; export as namespace CodeMirror; @@ -260,16 +262,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). @@ -364,6 +357,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: @@ -672,6 +671,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 +713,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 +745,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/test/tern.ts b/types/codemirror/test/tern.ts new file mode 100644 index 0000000000..2f80a9aabd --- /dev/null +++ b/types/codemirror/test/tern.ts @@ -0,0 +1,24 @@ +const options: CodeMirror.TernOptions = { + + completionTip: (data) => { + const d = data.completions; + return ""; + }, + + showError: (editor, message) => { + alert(message); + } + +}; + +const ts = new CodeMirror.TernServer(options); + +ts.request(cm.getDoc(), "completions", (_e, d) => { + if (d) { + const c = d.completions; + } +}, { ch: 0, line: 0 }); + +ts.complete(cm.getDoc()); + +ts.showType(cm.getDoc()); \ No newline at end of file diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index a2c6a52430..ffa5de2be5 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -19,14 +19,20 @@ }, "files": [ "index.d.ts", + "codemirror-comment.d.ts", "codemirror-matchbrackets.d.ts", + "codemirror-panel.d.ts", "codemirror-runmode.d.ts", "codemirror-showhint.d.ts", + "codemirror-tern.d.ts", "searchcursor.d.ts", + "test/comment.ts", "test/index.ts", "test/matchbrackets.ts", + "test/panel.ts", "test/runmode.ts", "test/searchcursor.ts", - "test/showhint.ts" + "test/showhint.ts", + "test/tern.ts" ] } \ No newline at end of file diff --git a/types/coinbase/coinbase-tests.ts b/types/coinbase/coinbase-tests.ts index fb804ac566..65ec9693bd 100644 --- a/types/coinbase/coinbase-tests.ts +++ b/types/coinbase/coinbase-tests.ts @@ -25,7 +25,7 @@ client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => { account.getBuy("abcdef", (error: Error, buy: coinbase.Buy): void => undefined); - account.getBuys((error: Error, buy: coinbase.Buy[]): void => undefined); + account.getBuys(null, (error: Error, buy: coinbase.Buy[]): void => undefined); account.getDeposit("abcdef", (error: Error, deposit: coinbase.Deposit): void => undefined); @@ -33,7 +33,7 @@ client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => { account.getSell("abcdef", (error: Error, deposit: coinbase.Sell): void => undefined); - account.getSells((error: Error, deposit: coinbase.Sell[]): void => undefined); + account.getSells(null, (error: Error, deposit: coinbase.Sell[]): void => undefined); account.getTransaction("abcdef", (error: Error, deposit: coinbase.Transaction): void => undefined); diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 6057f58142..82fc32a7d3 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -536,6 +536,21 @@ export class Account implements Resource { */ balance: MoneyHash; + /** + * Allow deposits + */ + allow_deposits: boolean; + + /** + * Allow withdrawls + */ + allow_withdrawals: boolean; + + /** + * Account worth in fiat. + */ + native_balance: MoneyHash; + /** * Promote an account as primary account. * Scope: wallet:accounts:update @@ -630,7 +645,7 @@ export class Account implements Resource { * Lists buys for an account. * Scope: wallet:buys:read */ - getBuys(cb: (error: Error, result: Buy[]) => void): void; + getBuys(opts: null, cb: (error: Error, result: Buy[]) => void): void; /** * Show an individual buy. @@ -663,7 +678,7 @@ export class Account implements Resource { * Lists sells for an account. * Scope: wallet:sells:read */ - getSells(cb: (error: Error, result: Sell[]) => void): void; + getSells(opts: null, cb: (error: Error, result: Sell[]) => void): void; /** * Show an individual sell. @@ -883,7 +898,7 @@ export class Buy implements Resource { /** * Fee associated to this buy */ - fee: MoneyHash; + fees: Fee[]; /** * Has this buy been committed? @@ -900,6 +915,26 @@ export class Buy implements Resource { */ payout_at?: string; + /** + * Unit price of the base currency. + */ + unit_price: UnitPrice; + + /** + * Hold period for transfer. + */ + hold_business_days: number; + + /** + * Is it the first buy for this symbol? + */ + is_first_buy: boolean; + + /** + * Is there another action required to make the transfer pass? + */ + requires_completion_step: boolean; + /** * Completes a buy that is created in commit: false state. * If the exchange rate has changed since the buy was created, this call will fail with the error “The exchange rate updated while you @@ -910,6 +945,32 @@ export class Buy implements Resource { commit(cb: (error: Error, transaction: Buy) => void): void; } +export interface Fee { + /** + * Amount associated to this fee + */ + amount: MoneyHash; + /** + * Fee beneficiary ("bank", "coinbase", ...) + */ + type: string; +} + +export interface UnitPrice { + /** + * Amount as floating-point in a string + */ + amount: string; + /** + * Currency e.g. "BTC" (see Client#getCurrencies() for available strings) + */ + currency: string; + /** + * Type of price + */ + scale: number; +} + export type SellStatus = "created" | "completed" | "canceled"; /** diff --git a/types/coinlist/coinlist-tests.ts b/types/coinlist/coinlist-tests.ts new file mode 100644 index 0000000000..17dbbae3df --- /dev/null +++ b/types/coinlist/coinlist-tests.ts @@ -0,0 +1,36 @@ +import coins = require('coinlist'); +import coinsJson = require('coinlist/src/coins.json'); + +// $ExpectType Coin[] & CoinsAPI +coins; + +// $ExpectType Coin[] +coinsJson; + +let coinsArr = [ + { + id: 'bitcoin', + symbol: 'BTC', + name: 'Bitcoin', + }, + { + id: 'litecoin', + symbol: 'LTC', + name: 'Litecoin', + }, +]; + +coinsArr = coins; +coinsArr = coinsJson; + +// $ExpectType Coin | undefined +coins.get('BTC'); + +// $ExpectType string | undefined +coins.get('BTC', 'name'); +// $ExpectType string | undefined +coins.get('BTC', 'symbol'); +// $ExpectType string | undefined +coins.get('BTC', 'id'); + +coins.map(coin => coin.name); diff --git a/types/coinlist/index.d.ts b/types/coinlist/index.d.ts new file mode 100644 index 0000000000..29aaa1dcaa --- /dev/null +++ b/types/coinlist/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for coinlist 3.1 +// Project: https://github.com/lukechilds/coinlist +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import coinsJson = require('./src/coins.json'); + +export = coins; + +declare const coins: coins.Coin[] & coins.CoinsAPI; + +declare namespace coins { + type Coin = coinsJson.Coin; + + interface CoinsAPI { + get(symbol: string): Coin | undefined; + get(symbol: string, property: 'id' | 'symbol' | 'name'): string | undefined; + } +} diff --git a/types/coinlist/src/coins.json.d.ts b/types/coinlist/src/coins.json.d.ts new file mode 100644 index 0000000000..96c947bd8a --- /dev/null +++ b/types/coinlist/src/coins.json.d.ts @@ -0,0 +1,11 @@ +export = coins; + +declare const coins: coins.Coin[]; + +declare namespace coins { + interface Coin { + id: string; + symbol: string; + name: string; + } +} diff --git a/types/coinlist/tsconfig.json b/types/coinlist/tsconfig.json new file mode 100644 index 0000000000..86b93f8380 --- /dev/null +++ b/types/coinlist/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", + "src/coins.json.d.ts", + "coinlist-tests.ts" + ] +} diff --git a/types/coinlist/tslint.json b/types/coinlist/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/coinlist/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/color-diff/color-diff-tests.ts b/types/color-diff/color-diff-tests.ts new file mode 100644 index 0000000000..684858c203 --- /dev/null +++ b/types/color-diff/color-diff-tests.ts @@ -0,0 +1,17 @@ +import diff from "color-diff"; + +const color = { R: 255, G: 1, B: 30 }; +// red, green, blue +const palette = [ + { R: 255, G: 0, B: 0 }, + { R: 0, G: 255, B: 0 }, + { R: 0, G: 0, B: 255 } +]; + +diff.closest(color, palette); // {R: 255, G: 0, B: 0 }, red + +const color1 = { R: 255, G: 255, B: 255 }; +// black, white +const palette1 = [{ R: 0, G: 0, B: 0 }, { R: 255, G: 255, B: 255 }]; + +diff.furthest(color1, palette1); // {R: 0, G: 0, B: 0 }, black diff --git a/types/color-diff/index.d.ts b/types/color-diff/index.d.ts new file mode 100644 index 0000000000..f331b7203c --- /dev/null +++ b/types/color-diff/index.d.ts @@ -0,0 +1,67 @@ +// Type definitions for color-diff 1.1 +// Project: https://github.com/markusn/color-diff#readme +// Definitions by: katsanva +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +export interface RGBColor { + R: number; + G: number; + B: number; + A?: number; +} + +export interface LabColor { + L: number; + a: number; + b: number; +} + +export function diff(c1: LabColor, c2: LabColor): number; + +export function rgb_to_lab(c: RGBColor): LabColor; +export function rgba_to_lab(c: RGBColor, bc?: RGBColor): LabColor; + +export function closest( + color: RGBColor, + palette: ReadonlyArray, + backgroundColor?: RGBColor +): RGBColor; + +export function furthest( + color: RGBColor, + palette: ReadonlyArray, + backgroundColor?: RGBColor +): RGBColor; + +export function map_palette( + a: ReadonlyArray, + b: ReadonlyArray, + type?: "closest" | "furthest", + backgroundColor?: RGBColor +): { [key: string]: RGBColor }; + +export function palette_map_key(c: RGBColor): string; + +export function closest_lab( + color: LabColor, + palette: ReadonlyArray +): LabColor; + +export function furthest_lab( + color: LabColor, + palette: ReadonlyArray +): LabColor; + +export function map_palette_lab( + p1: ReadonlyArray, + p2: ReadonlyArray +): { [key: string]: LabColor }; + +export function lab_palette_map_key(c: LabColor): string; + +export function match_palette_lab( + target_color: LabColor, + palette: ReadonlyArray, + find_furthest: boolean +): LabColor; diff --git a/types/color-diff/tsconfig.json b/types/color-diff/tsconfig.json new file mode 100644 index 0000000000..b8a60d5c99 --- /dev/null +++ b/types/color-diff/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "color-diff-tests.ts"] +} diff --git a/types/color-diff/tslint.json b/types/color-diff/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/color-diff/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/colornames/colornames-tests.ts b/types/colornames/colornames-tests.ts new file mode 100644 index 0000000000..6fc9bb712a --- /dev/null +++ b/types/colornames/colornames-tests.ts @@ -0,0 +1,29 @@ +import colorNames = require("colornames"); + +// $ExpectType Color +const color = colorNames("red"); + +// $ExpectType string +color.value; +// $ExpectType boolean | undefined +color.css; +// $ExpectType boolean | undefined +color.vga; +// $ExpectType string +color.name; + +// $ExpectType Color +colorNames.get("blue"); +// $ExpectType Color[] +colorNames.get.all(); +// $ExpectType Color[] +colorNames.get.css(); +// $ExpectType Color +colorNames.get.css("orange"); +// $ExpectType Color[] +colorNames.get.vga(); +// $ExpectType Color +colorNames.get.vga("violet"); + +// $ExpectType Color[] +colorNames.all(); diff --git a/types/colornames/index.d.ts b/types/colornames/index.d.ts new file mode 100644 index 0000000000..d9b331167b --- /dev/null +++ b/types/colornames/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for colornames 1.1 +// Project: https://github.com/timoxley/colornames#readme +// Definitions by: Manuel Thalmann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Represents a color. + */ +interface Color { + /** + * Gets the value of the color. + */ + value: string; + + /** + * Gets a value indicating whether the color is a valid `CSS`-color. + */ + css?: boolean; + + /** + * Gets a value indicating whether the color is a valid `VGA`-color. + */ + vga?: boolean; + + /** + * Gets the name of the color. + */ + name: string; +} + +/** + * Povides the functionality to resolve colors of a specific type by its name. + */ +interface ColorResolver { + /** + * Gets the color with the specified name. + * + * @param name + * The name of the color to get. + */ + (name: string): Color; + + /** + * Gets all colors. + */ + (): Color[]; +} + +/** + * Provides the functionality to resolve any kind of color by its name. + */ +interface GlobalResolver { + /** + * Gets the color with the specified name. + */ + (name: string): Color; + + /** + * Provides the functionality to query colors. + */ + get: { + /** + * Gets the color with the specified name. + * + * @param name + * The name of the color to get. + */ + (name: string): Color; + + /** + * Gets all available colors. + */ + all(): Color[]; + + /** + * Provides the functionality to resolve `css`-colors. + */ + css: ColorResolver; + + /** + * Provides the functionality to resolve `vga`-colors. + */ + vga: ColorResolver; + }; + + /** + * Gets all available colors. + */ + all(): Color[]; +} + +declare let colorNames: GlobalResolver; +export = colorNames; diff --git a/types/colornames/tsconfig.json b/types/colornames/tsconfig.json new file mode 100644 index 0000000000..b494da59cd --- /dev/null +++ b/types/colornames/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", + "colornames-tests.ts" + ] +} diff --git a/types/colornames/tslint.json b/types/colornames/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/colornames/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/combined-stream/combined-stream-tests.ts b/types/combined-stream/combined-stream-tests.ts index ffdc0eaac7..540db77b68 100644 --- a/types/combined-stream/combined-stream-tests.ts +++ b/types/combined-stream/combined-stream-tests.ts @@ -1,17 +1,17 @@ -import CombinedStream = require("combined-stream"); -import { createReadStream, createWriteStream } from "fs"; +import CombinedStream = require('combined-stream'); +import { createReadStream, createWriteStream } from 'fs'; const stream1 = new CombinedStream(); -stream1.append(createReadStream("tsconfig.json")); -stream1.append(createReadStream("tslint.json")); -stream1.append(createReadStream("index.d.ts")); +stream1.append(createReadStream('tsconfig.json')); +stream1.append(createReadStream('tslint.json')); +stream1.append(createReadStream('index.d.ts')); -stream1.pipe(createWriteStream("combined.txt")); +stream1.pipe(createWriteStream('combined.txt')); const stream2 = CombinedStream.create({ maxDataSize: 1 << 32, - pauseStreams: false, + pauseStreams: false }); stream1.destroy(); @@ -19,12 +19,29 @@ stream1.destroy(); // should log true console.log(CombinedStream.isStreamLike(stream2)); -stream2.on("data", (data) => { +stream2.on('data', data => { console.log(data); }); -stream2.pipe(createWriteStream("combined.txt")); +stream2.pipe(createWriteStream('combined.txt')); stream2.write(CombinedStream.name); stream2.destroy(); + +const arrowFunction = (): CombinedStream => { + const stream3 = new CombinedStream(); + + // test next function + stream3.append(next => { + stream3.append('hello world'); + next(createReadStream('')); + }); + + // next function with no next + stream3.append(() => { + stream3.append('hello again'); + }); + + return stream3; +}; diff --git a/types/combined-stream/index.d.ts b/types/combined-stream/index.d.ts index 271814a4af..b82b399e7f 100644 --- a/types/combined-stream/index.d.ts +++ b/types/combined-stream/index.d.ts @@ -1,19 +1,27 @@ // Type definitions for combined-stream 1.0 // Project: https://github.com/felixge/node-combined-stream -// Definitions by: Felix Geisendörfer , Tomek Łaziuk +// Definitions by: Felix Geisendörfer , Tomek Łaziuk , Kon Pik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -import { Stream } from "stream"; +import { Stream } from 'stream'; -declare class CombinedStream extends Stream implements CombinedStream.Options { +type Appendable = NodeJS.ReadableStream | NodeJS.WritableStream | Buffer | string | NextFunction; +type NextFunction = (next: (stream: Appendable) => any) => any; + +interface Options { + maxDataSize?: number; + pauseStreams?: boolean; +} + +declare class CombinedStream extends Stream implements Options { readonly writable: boolean; readonly readable: boolean; readonly dataSize: number; maxDataSize: number; pauseStreams: boolean; - append(stream: NodeJS.ReadableStream | NodeJS.WritableStream | Buffer | string): this; + append(stream: Appendable): this; write(data: any): void; pause(): void; resume(): void; @@ -34,23 +42,15 @@ declare class CombinedStream extends Stream implements CombinedStream.Options { _emitError(error: Error): void; // events - on(event: "close" | "end" | "resume" | "pause", cb: () => void): this; - on(event: "error", cb: (err: Error) => void): this; - on(event: "data", cb: (data: any) => void): this; - once(event: "close" | "end" | "resume" | "pause", cb: () => void): this; - once(event: "error", cb: (err: Error) => void): this; - once(event: "data", cb: (data: any) => void): this; -} + on(event: 'close' | 'end' | 'resume' | 'pause', cb: () => void): this; + on(event: 'error', cb: (err: Error) => void): this; + on(event: 'data', cb: (data: any) => void): this; + once(event: 'close' | 'end' | 'resume' | 'pause', cb: () => void): this; + once(event: 'error', cb: (err: Error) => void): this; + once(event: 'data', cb: (data: any) => void): this; -declare namespace CombinedStream { - interface Options { - maxDataSize?: number; - pauseStreams?: boolean; - } - - function create(options?: Options): CombinedStream; - - function isStreamLike(stream: any): stream is Stream; + static create(options?: Options): CombinedStream; + static isStreamLike(stream: any): stream is Stream; } export = CombinedStream; diff --git a/types/cometd/cometd-tests.ts b/types/cometd/cometd-tests.ts index ada9412c04..ef56879d6f 100644 --- a/types/cometd/cometd-tests.ts +++ b/types/cometd/cometd-tests.ts @@ -1,4 +1,4 @@ -import { CometD, Listener, Message } from "cometd"; +import { CometD, Listener, Message, SubscriptionHandle } from "cometd"; const cometd = new CometD(); @@ -78,7 +78,7 @@ cometd.unsubscribe(subscription3, additionalInfoUnsubscribe, unsubscribeReply => // Subscribers versus Listeners // ============================ -let _reportListener: Listener | undefined; +let _reportListener: SubscriptionHandle | undefined; cometd.addListener("/meta/handshake", message => { // Only subscribe if the handshake is successful @@ -106,7 +106,7 @@ cometd.addListener("/meta/handshake", message => { // Dynamic Resubscription // ====================== -let _subscription: Listener | undefined; +let _subscription: SubscriptionHandle | undefined; class Controller { dynamicSubscribe = () => { diff --git a/types/cometd/index.d.ts b/types/cometd/index.d.ts index 32e4f962bb..cd829d444c 100644 --- a/types/cometd/index.d.ts +++ b/types/cometd/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for CometD 4.0 // Project: http://cometd.org -// Definitions by: Derek Cicerone , Daniel Perez Alvarez +// Definitions by: Derek Cicerone , Daniel Perez Alvarez , Alex Henry // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -75,6 +75,15 @@ export interface Message { } export type Listener = (message: Message) => void; +export type Callback = (data: any) => void; + +export interface SubscriptionHandle { + id: number; + channel: string; + listener: boolean; + callback: Callback; + scope?: any; +} export interface Extension { incoming?: Listener; @@ -202,14 +211,14 @@ export class CometD { * @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): Listener; + addListener(channel: string, callback: Listener): SubscriptionHandle; /** * Removes the subscription obtained with a call to `addListener`. * * @param subscription the subscription to unsubscribe. */ - removeListener(subscription: Listener): void; + removeListener(subscription: SubscriptionHandle): void; /** * Removes all listeners registered with `addListener` or `subscribe`. @@ -234,7 +243,7 @@ export class CometD { * @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: Listener, subscribeCallback?: Listener): Listener; + subscribe(channel: string, callback: Callback, subscribeCallback?: Listener): SubscriptionHandle; /** * Subscribes to the given channel, performing the given callback in the given scope when a @@ -255,7 +264,7 @@ export class CometD { * @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: Listener, subscribeProps: object, subscribeCallback?: Listener): Listener; + subscribe(channel: string, callback: Callback, subscribeProps: object, subscribeCallback?: Listener): SubscriptionHandle; /** * Unsubscribes the subscription obtained with a call to `subscribe`. @@ -263,7 +272,7 @@ export class CometD { * @param subscription the subscription to unsubscribe. * @param unsubscribeCallback a function to be invoked when the unsubscription is acknowledged */ - unsubscribe(subscription: Listener, unsubscribeCallback?: Listener): void; + unsubscribe(subscription: SubscriptionHandle, unsubscribeCallback?: Listener): void; /** * Unsubscribes the subscription obtained with a call to `subscribe`. @@ -272,12 +281,12 @@ export class CometD { * @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: Listener, unsubscribeProps: object, unsubscribeCallback?: Listener): void; + unsubscribe(subscription: SubscriptionHandle, unsubscribeProps: object, unsubscribeCallback?: Listener): void; /** * Resubscribes as necessary in case of a re-handshake. */ - resubscribe(subscription: Listener, subscribeProps?: object): Listener; + resubscribe(subscription: SubscriptionHandle, subscribeProps?: object): SubscriptionHandle; /** * Removes all subscriptions added via `subscribe`, but does not remove the listeners added via @@ -463,5 +472,5 @@ export class CometD { * @param isListener whether it was a listener * @param message the message received from the Bayeux server */ - onListenerException: (exception: any, subscriptionHandle: Listener, isListener: boolean, message: string) => void; + onListenerException: (exception: any, subscriptionHandle: SubscriptionHandle, isListener: boolean, message: string) => void; } diff --git a/types/command-exists/command-exists-tests.ts b/types/command-exists/command-exists-tests.ts new file mode 100644 index 0000000000..60efc1e0e5 --- /dev/null +++ b/types/command-exists/command-exists-tests.ts @@ -0,0 +1,14 @@ +import commandExists = require('command-exists'); + +commandExists('ls', (err, commandExists) => { + // $ExpectType boolean + commandExists; +}); + +commandExists('ls').then(command => { + // $ExpectType string + command; +}); + +// $ExpectType boolean +commandExists.sync('ls'); diff --git a/types/command-exists/index.d.ts b/types/command-exists/index.d.ts new file mode 100644 index 0000000000..634d2a035e --- /dev/null +++ b/types/command-exists/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for command-exists 1.2 +// Project: https://github.com/mathisonian/command-exists +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = commandExists; + +declare function commandExists(commandName: string): Promise; +declare function commandExists( + commandName: string, + cb: (error: null, exists: boolean) => void +): void; + +declare namespace commandExists { + function sync(commandName: string): boolean; +} diff --git a/types/command-exists/tsconfig.json b/types/command-exists/tsconfig.json new file mode 100644 index 0000000000..9782cd2715 --- /dev/null +++ b/types/command-exists/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", + "command-exists-tests.ts" + ] +} diff --git a/types/command-exists/tslint.json b/types/command-exists/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/command-exists/tslint.json @@ -0,0 +1 @@ +{ "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/common-errors/index.d.ts b/types/common-errors/index.d.ts index da0230b084..eda538b1f3 100644 --- a/types/common-errors/index.d.ts +++ b/types/common-errors/index.d.ts @@ -183,6 +183,11 @@ export class HttpStatusError extends global.Error { * @param req the request object */ constructor(err: Error, req?: express.Request); + + /** + * Status code for this error. + */ + statusCode: number; } /** diff --git a/types/common-tags/common-tags-tests.ts b/types/common-tags/common-tags-tests.ts index e504624943..37a1fba789 100644 --- a/types/common-tags/common-tags-tests.ts +++ b/types/common-tags/common-tags-tests.ts @@ -1,167 +1,242 @@ -import * as commonTags from 'common-tags'; +import { + html, + safeHtml, + oneLine, + oneLineTrim, + stripIndent, + stripIndents, + inlineLists, + oneLineInlineLists, + commaLists, + commaListsOr, + commaListsAnd, + oneLineCommaLists, + oneLineCommaListsOr, + oneLineCommaListsAnd, + id, + TemplateTag, + trimResultTransformer, + stripIndentTransformer, + replaceResultTransformer, + replaceSubstitutionTransformer, + inlineArrayTransformer, + splitStringTransformer, + createTag, + TemplateTransformer, + replaceStringTransformer, +} from 'common-tags'; -/* Test Built-in Tags */ - -commonTags.commaLists ` - I like ${['apples', 'bananas', 'watermelons']} - They're good! +const userMessages = ['hi', 'what are you up to?', '']; +html` +

+
    + ${userMessages.map(message => safeHtml`
  • ${message}
  • `)} +
+
`; -commonTags.commaListsAnd` - I like ${['apples', 'bananas', 'watermelons']} - They're good! -`; - -commonTags.commaListsOr` - I like ${['apples', 'bananas', 'watermelons']} - They're good! -`; - -let fruits = ['apple', 'orange', 'watermelon']; - -commonTags.html` -
-
    - ${fruits.map(fruit => `
  • ${fruit}
  • `)} - ${'
  • kiwi
  • \n
  • guava
  • '} -
-
-`; - -commonTags.codeBlock` -
-
    - ${fruits.map(fruit => `
  • ${fruit}
  • `)} - ${'
  • kiwi
  • \n
  • guava
  • '} -
-
-`; - -commonTags.source` -
-
    - ${fruits.map(fruit => `
  • ${fruit}
  • `)} - ${'
  • kiwi
  • \n
  • guava
  • '} -
-
-`; - -let userMessages = ['hi', 'what are you up to?', ''] -commonTags.html` -
-
    - ${userMessages.map(message => commonTags.safeHtml`
  • ${message}
  • `)} -
-
-` - -commonTags.oneLine` +oneLine` foo bar baz `; -commonTags.oneLineTrim` +oneLineTrim` https://news.com/article ?utm_source=designernews.co `; -commonTags.oneLineCommaLists` - I like ${['apples', 'bananas', 'watermelons']} - They're good! -`; - -commonTags.oneLineCommaListsOr` - I like ${['apples', 'bananas', 'watermelons']} - They're good! -`; - -commonTags.oneLineCommaListsAnd` - I like ${['apples', 'bananas', 'watermelons']} - They're good! -`; - -commonTags.inlineLists` - I like ${['apples', 'bananas', 'watermelons']} - They're good! -`; - -commonTags.oneLineInlineLists` - I like ${['apples', 'bananas', 'watermelons']} - They're good! -`; - -let verb = 'notice'; - -commonTags.stripIndent` +const verb = 'notice'; +stripIndent` This is a multi-line string. You'll ${verb} that it is indented. We don't want to output this indentation. But we do want to keep this line indented. `; -commonTags.stripIndents` +stripIndents` This is a multi-line string. You'll ${verb} that it is indented. We don't want to output this indentation. We don't want to keep this line indented either. `; -/* Test Tag Constructor */ +inlineLists` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; -new commonTags.TemplateTag(); +oneLineInlineLists` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; -const substitutionReplacer = (oldValue : string, newValue : string) => ({ - onSubstitution(substitution : string, resultSoFar : string) { +commaLists` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +commaListsOr` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +commaListsAnd` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +oneLineCommaLists` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +oneLineCommaListsOr` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +oneLineCommaListsAnd` + I like ${['apples', 'bananas', 'watermelons']} + They're good! +`; + +id`hello ${'world'}`; + +oneLine(String.raw)` + foo + bar\nbaz +`; + +stripIndent(' foo\n bar'); + +const doNothing = createTag(); +doNothing`foo bar`; + +const substitutionReplacer = (oldValue: string, newValue: string): TemplateTransformer => ({ + onSubstitution(substitution, resultSoFar) { if (substitution === oldValue) { return newValue; } return substitution; - } + }, }); -new commonTags.TemplateTag(substitutionReplacer('fizz', 'buzz')); +const replaceFizzWithBuzz = createTag(substitutionReplacer('fizz', 'buzz')); +replaceFizzWithBuzz`foo bar ${'fizz'}`; -new commonTags.TemplateTag( - substitutionReplacer('fizz', 'buzz'), - substitutionReplacer('foo', 'bar') +createTag(); +createTag(substitutionReplacer('fizz', 'buzz')); +createTag(substitutionReplacer('fizz', 'buzz'), substitutionReplacer('foo', 'bar')); +createTag([substitutionReplacer('fizz', 'buzz'), substitutionReplacer('foo', 'bar')]); +new TemplateTag(); +new TemplateTag(substitutionReplacer('fizz', 'buzz')); +new TemplateTag(substitutionReplacer('fizz', 'buzz'), substitutionReplacer('foo', 'bar')); +new TemplateTag([substitutionReplacer('fizz', 'buzz'), substitutionReplacer('foo', 'bar')]); + +const tt: TemplateTransformer<{ foo: string }> = { + getInitialContext() { + return { foo: 'bar' }; + }, + onString(str, context) { + // $ExpectType string + str; + // $ExpectType { foo: string; } + context; + return ''; + }, + onSubstitution(substitution, resultSoFar, context) { + // $ExpectType string + substitution; + // $ExpectType string + resultSoFar; + // $ExpectType { foo: string; } + context; + return ''; + }, + onEndResult(endResult, context) { + // $ExpectType string + endResult; + // $ExpectType { foo: string; } + context; + return ''; + }, +}; + +createTag({}); +createTag(tt); +createTag({ + onString: str => `${str}!`, +}); +createTag({ + onSubstitution: substitution => `${substitution}!`, +}); +createTag({ + onEndResult: endResult => `${endResult}!`, +}); +new TemplateTag({}); +new TemplateTag(tt); +new TemplateTag({ + onString: str => `${str}!`, +}); +new TemplateTag({ + onSubstitution: substitution => `${substitution}!`, +}); +new TemplateTag({ + onEndResult: endResult => `${endResult}!`, +}); + +createTag(trimResultTransformer()); +createTag(trimResultTransformer('')); +createTag(trimResultTransformer('start')); +createTag(trimResultTransformer('end')); +createTag(trimResultTransformer('left')); +createTag(trimResultTransformer('right')); + +createTag(stripIndentTransformer()); +createTag(stripIndentTransformer('initial')); +createTag(stripIndentTransformer('all')); + +createTag(replaceResultTransformer('foo', 'bar')); +createTag(replaceResultTransformer(/baz/g, 'bar')); +createTag( + replaceResultTransformer(/baz/g, (substring, ...matches) => { + // $ExpectType string + substring; + // $ExpectType any[] + matches; + return ''; + }) ); -new commonTags.TemplateTag([ - substitutionReplacer('fizz', 'buzz'), - substitutionReplacer('foo', 'bar') -]); +createTag(replaceSubstitutionTransformer('foo', 'bar')); +createTag(replaceSubstitutionTransformer(/baz/g, 'bar')); +createTag( + replaceSubstitutionTransformer(/baz/g, (substring, ...matches) => { + // $ExpectType string + substring; + // $ExpectType any[] + matches; + return ''; + }) +); -new commonTags.TemplateTag({}); +createTag(replaceStringTransformer('foo', 'bar')); +createTag(replaceStringTransformer(/baz/g, 'bar')); +createTag( + replaceStringTransformer(/baz/g, (substring, ...matches) => { + // $ExpectType string + substring; + // $ExpectType any[] + matches; + return ''; + }) +); -new commonTags.TemplateTag({ - onEndResult: endResult => `${endResult}!` -}); +createTag(inlineArrayTransformer()); +createTag(inlineArrayTransformer({})); +createTag(inlineArrayTransformer({ separator: 'foo' })); +createTag(inlineArrayTransformer({ conjunction: 'bar' })); +createTag(inlineArrayTransformer({ serial: true })); -new commonTags.TemplateTag({ - onSubstitution: substitution => `${substitution}!`, - onEndResult: endResult => `${endResult}!` -}); - -/* Tests Built-in Transformers */ - -new commonTags.TemplateTag(commonTags.trimResultTransformer()); -new commonTags.TemplateTag(commonTags.trimResultTransformer('left')); -new commonTags.TemplateTag(commonTags.trimResultTransformer('right')); - -new commonTags.TemplateTag(commonTags.stripIndentTransformer()); -new commonTags.TemplateTag(commonTags.stripIndentTransformer('initial')); -new commonTags.TemplateTag(commonTags.stripIndentTransformer('all')); - -new commonTags.TemplateTag(commonTags.replaceResultTransformer('foo', 'bar')); -new commonTags.TemplateTag(commonTags.replaceSubstitutionTransformer(/baz/g, 'bar')); - -new commonTags.TemplateTag(commonTags.replaceSubstitutionTransformer('foo', 'bar')); -new commonTags.TemplateTag(commonTags.replaceSubstitutionTransformer(/baz/g, 'bar')); - -new commonTags.TemplateTag(commonTags.inlineArrayTransformer()); -new commonTags.TemplateTag(commonTags.inlineArrayTransformer({})); -new commonTags.TemplateTag(commonTags.inlineArrayTransformer({separator: 'foo'})); -new commonTags.TemplateTag(commonTags.inlineArrayTransformer({conjunction: 'bar'})); - -new commonTags.TemplateTag(commonTags.splitStringTransformer('foo')); +createTag(splitStringTransformer('foo')); diff --git a/types/common-tags/index.d.ts b/types/common-tags/index.d.ts index 65f0b61673..3a12c91109 100644 --- a/types/common-tags/index.d.ts +++ b/types/common-tags/index.d.ts @@ -1,67 +1,220 @@ -// Type definitions for common-tags v1.4.0 +// Type definitions for common-tags 1.8 // Project: https://github.com/declandewet/common-tags // Definitions by: Viktor Zozuliak // Paul Wang +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -declare module 'common-tags' { - type TemplateTag = (literals: TemplateStringsArray, ...placeholders: any[]) => string; +export as namespace commonTags; - type TemplateTransformer = { - onSubstitution?: (substitution: string, resultSoFar: string) => string; - onEndResult?: (endResult : string) => string; - } +export type JSTag = (literals: TemplateStringsArray, ...placeholders: any[]) => string; - /* Built-in Tags */ - export var commaLists: TemplateTag; - - export var commaListsAnd: TemplateTag; - - export var commaListsOr: TemplateTag; - - export var html: TemplateTag; - - export var codeBlock: TemplateTag; - - export var source: TemplateTag; - - export var safeHtml: TemplateTag; - - export var oneLine: TemplateTag; - - export var oneLineTrim: TemplateTag; - - export var oneLineCommaLists: TemplateTag; - - export var oneLineCommaListsOr: TemplateTag; - - export var oneLineCommaListsAnd: TemplateTag; - - export var inlineLists: TemplateTag; - - export var oneLineInlineLists: TemplateTag; - - export var stripIndent: TemplateTag; - - export var stripIndents: TemplateTag; - - /* New Tag Constructor */ - export var TemplateTag: { - new(): TemplateTag; - new(...transformers: TemplateTransformer[]): TemplateTag; - new(transformers: TemplateTransformer[]): TemplateTag; - }; - - /* Built-in Transformers */ - export var trimResultTransformer: (side?: 'left'|'right') => TemplateTransformer; - - export var stripIndentTransformer: (type?: 'initial'|'all') => TemplateTransformer; - - export var replaceResultTransformer: (replaceWhat: string|RegExp, replaceWith: string) => TemplateTransformer; - - export var replaceSubstitutionTransformer: (replaceWhat: string|RegExp, replaceWith: string) => TemplateTransformer; - - export var inlineArrayTransformer: (opts?: {separator?: string, conjunction?: string}) => TemplateTransformer; - - export var splitStringTransformer: (splitBy: string) => TemplateTransformer; +export interface TemplateTag { + (str: string): string; + (tag: JSTag): TemplateTag; + (literals: TemplateStringsArray, ...placeholders: any[]): string; } + +/** + * You'll often find that you might want to include an array in a template. + * Typically, doing something like `${array.join(', ')}` would work - but what if you're printing a list of items + * in an HTML template and want to maintain the indentation? You'd have to count the spaces manually and include + * them in the `.join()` call - which is a bit ugly for my taste. + * This tag properly indents arrays, as well as newline characters in string substitutions, + * by converting them to an array split by newline and re-using the same array inclusion logic. + */ +export const html: TemplateTag; + +/** + * alias for `html` + */ +export const codeBlock: TemplateTag; + +/** + * alias for `html` + */ +export const source: TemplateTag; + +/** + * A tag very similar to `html` but it does safe HTML escaping for strings coming from substitutions. + * When combined with regular `html` tag, you can do basic HTML templating that is safe from + * XSS (Cross-Site Scripting) attacks. + */ +export const safeHtml: TemplateTag; + +/** + * Allows you to keep your single-line strings under 80 characters without resorting to crazy string concatenation. + */ +export const oneLine: TemplateTag; + +/** + * Allows you to keep your single-line strings under 80 characters while trimming the new lines. + */ +export const oneLineTrim: TemplateTag; + +/** + * If you want to strip the initial indentation from the beginning of each line in a multiline string. + * Important note: this tag will not indent multiline strings coming from the substitutions. + * If you want that behavior, use the `html` tag (aliases: `source`, `codeBlock`). + */ +export const stripIndent: TemplateTag; + +/** + * If you want to strip *all* of the indentation from the beginning of each line in a multiline string. + */ +export const stripIndents: TemplateTag; + +/** + * Allows you to inline an array substitution as a list. + */ +export const inlineLists: TemplateTag; + +/** + * Allows you to inline an array substitution as a list, rendered out on a single line. + */ +export const oneLineInlineLists: TemplateTag; + +/** + * Allows you to inline an array substitution as a comma-separated list. + */ +export const commaLists: TemplateTag; + +/** + * Allows you to inline an array substitution as a comma-separated list, the last of which is preceded by the word "or". + */ +export const commaListsOr: TemplateTag; + +/** + * Allows you to inline an array substitution as a comma-separated list, the last of which is preceded by the word "and". + */ +export const commaListsAnd: TemplateTag; + +/** + * Allows you to inline an array substitution as a comma-separated list, and is rendered out on to a single line. + */ +export const oneLineCommaLists: TemplateTag; + +/** + * Allows you to inline an array substitution as a comma-separated list, the last of which is preceded by the word "or", and is rendered out on to a single line. + */ +export const oneLineCommaListsOr: TemplateTag; + +/** + * Allows you to inline an array substitution as a comma-separated list, the last of which is preceded by the word "and", and is rendered out on to a single line. + */ +export const oneLineCommaListsAnd: TemplateTag; + +/** + * A no-op tag that might come in useful in some scenarios, e.g. mocking. + */ +export const id: TemplateTag; + +export interface TemplateTransformer { + /** + * Called before everything else. + * The result of this hook will be passed to other hooks as `context`. + * If omitted, `context` will be an empty object. + */ + getInitialContext?: () => TCtx; + /** + * Called when the tag encounters a string. + * (a string is whatever's not inside "${}" in your template literal) + * `str` is the value of the current string + */ + onString?: (str: string, context: TCtx) => string; + /** + * Called when the tag encounters a substitution. + * (a substitution is whatever's inside "${}" in your template literal) + * `substitution` is the value of the current substitution + * `resultSoFar` is the end result up to the point of this substitution + */ + onSubstitution?: (substitution: string, resultSoFar: string, context: TCtx) => string; + /** + * Called when all substitutions have been parsed + * `endResult` is the final value. + */ + onEndResult?: (endResult: string, context: TCtx) => string; +} + +export type PluginFunction = (oldValue: string, newValue: string) => TemplateTransformer; + +/** + * New Tag factory + */ +export function createTag(transformers?: Array>): TemplateTag; +export function createTag(...transformers: Array>): TemplateTag; +export function createTag(...pluginFunctions: PluginFunction[]): TemplateTag; + +export const TemplateTag: { + /** + * New Tag Constructor + * @deprecated + */ + new (transformers?: Array>): TemplateTag; + new (...transformers: Array>): TemplateTag; + new (...pluginFunctions: PluginFunction[]): TemplateTag; +}; + +/** + * TemplateTag transformer that trims whitespace on the end result of a tagged template + * @param [side=''] The side of the string to trim. Can be 'start' or 'end' (alternatively 'left' or 'right') + * @return a TemplateTag transformer + */ +export function trimResultTransformer( + side?: 'start' | 'end' | 'left' | 'right' | '' +): TemplateTransformer; + +/** + * strips indentation from a template literal + * @param [type='initial'] whether to remove all indentation or just leading indentation. can be 'all' or 'initial' + * @return a TemplateTag transformer + */ +export function stripIndentTransformer(type?: 'initial' | 'all'): TemplateTransformer; + +/** + * Replaces a value or pattern in the end result with a new value. + * @param replaceWhat the value or pattern that should be replaced + * @param replaceWith the replacement value + * @return a TemplateTag transformer + */ +export function replaceResultTransformer( + replaceWhat: string | RegExp, + replaceWith: string | ((substring: string, ...args: any[]) => string) +): TemplateTransformer; + +/** + * Replaces the result of all substitutions (results of calling ${ ... }) with a new value. + * Same as for `replaceResultTransformer`, replaceWhat can be a string or regular expression and replaceWith is the new value. + */ +export function replaceSubstitutionTransformer( + replaceWhat: string | RegExp, + replaceWith: string | ((substring: string, ...args: any[]) => string) +): TemplateTransformer; + +/** + * Replaces the result of all strings (what's not in ${ ... }) with a new value. + * Same as for `replaceResultTransformer`, replaceWhat can be a string or regular expression and replaceWith is the new value. + */ +export function replaceStringTransformer( + replaceWhat: string | RegExp, + replaceWith: string | ((substring: string, ...args: any[]) => string) +): TemplateTransformer; + +/** + * Converts an array substitution to a string containing a list + * @param [opts.separator=''] what to separate each item with (always followed by a space) + * @param [opts.conjunction=''] replace the last separator with this value + * @param [opts.serial=false] should the separator be included before the conjunction? As in the case of serial/oxford commas + * @return a TemplateTag transformer + */ +export function inlineArrayTransformer(opts?: { + separator?: string; + conjunction?: string; + serial?: boolean; +}): TemplateTransformer; + +/** + * Splits a string substitution into an array by the provided splitBy substring, only if the string contains the splitBy substring. + */ +export function splitStringTransformer(splitBy: string): TemplateTransformer; diff --git a/types/common-tags/tslint.json b/types/common-tags/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/common-tags/tslint.json +++ b/types/common-tags/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/commonmark/index.d.ts b/types/commonmark/index.d.ts index 96bb2774c5..2f2899b44a 100644 --- a/types/commonmark/index.d.ts +++ b/types/commonmark/index.d.ts @@ -4,15 +4,18 @@ // Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export type NodeType = + 'text' |'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' | + 'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block'; + export class Node { - constructor(nodeType: string, sourcepos?: Position); + constructor(nodeType: NodeType, sourcepos?: Position); /** * (read-only): a String, one of text, softbreak, linebreak, emph, strong, html_inline, link, image, code, document, paragraph, * block_quote, item, list, heading, code_block, html_block, thematic_break. */ - readonly type: 'text' | 'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' | - 'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block'; + readonly type: NodeType; /** * (read-only): a Node or null. */ 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/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts index 423ca4cea7..a679b7f599 100644 --- a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts +++ b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -1,15 +1,76 @@ import { Configuration } from 'webpack'; import CompressionPlugin = require('compression-webpack-plugin'); -const c: Configuration = { +new CompressionPlugin(); + +new CompressionPlugin({ + include: ["a"] as ReadonlyArray, + exclude: [/a/g] as ReadonlyArray, + test: "a", +}); + +const config: Configuration = { plugins: [ new CompressionPlugin({ - asset: "[path].gz[query]", algorithm: "gzip", cache: true, + filename: "[path].gz[query]", + minRatio: 0.8, test: /\.js$|\.html$/, threshold: 10240, - minRatio: 0.8 + deleteOriginalAssets: true + }) + ] +}; + +const configDefaultAlgo = new CompressionPlugin({ + compressionOptions: { level: 7 } +}); + +// $ExpectError +new CompressionPlugin({ asset: "[path].gz[query]" }); + +const zlib: Configuration = { + plugins: [ + new CompressionPlugin({ + algorithm: "deflate", + compressionOptions: { + flush: 5, + windowBits: 20, + level: 7 + } + }) + ] +}; + +const badZlib: Configuration = { + plugins: [ + // $ExpectError + new CompressionPlugin({ + algorithm: "deflate", + compressionOptions: 5 + }) + ] +}; + +function customAlgorithm(input: string, options: number, callback: (err: Error, result: Buffer) => void) { +} + +const custom: Configuration = { + plugins: [ + new CompressionPlugin({ + algorithm: customAlgorithm, + compressionOptions: 5 + }) + ] +}; + +const badCustom: Configuration = { + plugins: [ + // $ExpectError + new CompressionPlugin({ + algorithm: customAlgorithm, + compressionOptions: { flush: 5 } }) ] }; diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index a7b38383ef..5d72f1fca8 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -1,42 +1,47 @@ -// Type definitions for compression-webpack-plugin 0.4 +// Type definitions for compression-webpack-plugin 2.0 // Project: https://github.com/webpack-contrib/compression-webpack-plugin // Definitions by: Anton Kandybo +// Rhys van der Waerden // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 import { Plugin } from 'webpack'; +import { ZlibOptions as ZlibCompressionOptions } from 'zlib'; export = CompressionPlugin; -declare class CompressionPlugin extends Plugin { - constructor(options?: CompressionPlugin.Options); +declare class CompressionPlugin extends Plugin { + constructor(options?: CompressionPlugin.Options); } declare namespace CompressionPlugin { - interface Options { - asset?: string; - algorithm?: string; + type AlgorithmCallback = (error: Error | null, result: Buffer) => void; + type Algorithm = (source: string, options: O, callback: AlgorithmCallback) => void; + + // NOTE: These are the async compression algorithms on the zlib object. + type ZlibAlgorithm = 'deflate' | 'deflateRaw' | 'gzip'; + type Pattern = string | RegExp | ReadonlyArray | ReadonlyArray; + + interface BaseOptions { cache?: boolean | string; - test?: RegExp | RegExp[]; - regExp?: RegExp | RegExp[]; - threshold?: number; + deleteOriginalAssets?: boolean; + exclude?: Pattern; + filename?: string; + include?: Pattern; minRatio?: number; - - // zopfli options - verbose?: boolean; - verbose_more?: boolean; - numiterations?: number; - blocksplitting?: boolean; - blocksplittinglast?: boolean; - blocksplittingmax?: number; - - // zlib options - level?: number; - flush?: number; - chunkSize?: number; - windowBits?: number; - memLevel?: number; - strategy?: number; - dictionary?: any; + test?: Pattern; + threshold?: number; } + + interface ZlibOptions extends BaseOptions { + algorithm?: ZlibAlgorithm; + compressionOptions?: ZlibCompressionOptions; + } + + interface CustomOptions extends BaseOptions { + algorithm: Algorithm; + compressionOptions?: O; + } + + type Options = ZlibOptions | CustomOptions; } diff --git a/types/conf/conf-tests.ts b/types/conf/conf-tests.ts index 1da0e4de2d..ce67cd4799 100644 --- a/types/conf/conf-tests.ts +++ b/types/conf/conf-tests.ts @@ -4,18 +4,24 @@ const conf = new Conf(); new Conf({ defaults: { foo: 'bar', - unicorn: 'rainbow' + unicorn: 'rainbow', }, - configName: '', - projectName: 'foo', - cwd: '' }); +new Conf({ configName: '' }); +new Conf({ projectName: 'foo' }); +new Conf({ cwd: '' }); +new Conf({ encryptionKey: '' }); +new Conf({ encryptionKey: new Buffer('') }); +new Conf({ encryptionKey: new Uint8Array([1]) }); +new Conf({ encryptionKey: new DataView(new ArrayBuffer(2)) }); +new Conf({ fileExtension: '.foo' }); + // $ExpectError new Conf({ defaults: { foo: 'bar', - unicorn: ['rainbow'] - } + unicorn: ['rainbow'], + }, }); conf.set('foo', 'bar'); conf.set('hello', 1); @@ -28,10 +34,17 @@ conf.get('foo', null); // $ExpectError conf.delete('foo'); conf.has('foo'); // $ExpectType boolean conf.clear(); +conf.onDidChange('foo', (oldVal, newVal) => { + // $ExpectType string | number | boolean | undefined + oldVal; + // $ExpectType string | number | boolean | undefined + newVal; +}); +conf.size; // $ExpectType number conf.store = { foo: 'bar', - unicorn: 'rainbow' + unicorn: 'rainbow', }; conf.path; // $ExpectType string diff --git a/types/conf/index.d.ts b/types/conf/index.d.ts index e58dc3ede7..57d7285a3e 100644 --- a/types/conf/index.d.ts +++ b/types/conf/index.d.ts @@ -1,31 +1,37 @@ -// Type definitions for conf 1.4 +// Type definitions for conf 2.1 // Project: https://github.com/sindresorhus/conf // Definitions by: Sam Verschueren // BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -interface Options { - defaults?: {[key: string]: T}; - configName?: string; - projectName?: string; - cwd?: string; -} +/// declare class Conf implements Iterable<[string, T]> { - store: {[key: string]: T}; + store: { [key: string]: T }; readonly path: string; - readonly size: number; + readonly size: number; - constructor(options?: Options); - get(key: string, defaultValue?: T): T; - set(key: string, val: T): void; - set(object: {[key: string]: T}): void; - has(key: string): boolean; - delete(key: string): void; - clear(): void; - onDidChange(key: string, callback: (oldVal: any, newVal: any) => void): void; - [Symbol.iterator](): Iterator<[string, T]>; + constructor(options?: Conf.Options); + get(key: string, defaultValue?: T): T; + set(key: string, val: T): void; + set(object: { [key: string]: T }): void; + has(key: string): boolean; + delete(key: string): void; + clear(): void; + onDidChange(key: string, callback: (oldVal: T | undefined, newVal: T | undefined) => void): void; + [Symbol.iterator](): Iterator<[string, T]>; +} + +declare namespace Conf { + interface Options { + defaults?: { [key: string]: T }; + configName?: string; + projectName?: string; + cwd?: string; + encryptionKey?: string | Buffer | NodeJS.TypedArray | DataView; + fileExtension?: string; + } } export = Conf; diff --git a/types/conf/tsconfig.json b/types/conf/tsconfig.json index 84d6bf7657..479fa6b41f 100644 --- a/types/conf/tsconfig.json +++ b/types/conf/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "conf-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/conf/v1/conf-tests.ts b/types/conf/v1/conf-tests.ts new file mode 100644 index 0000000000..4ee492da8d --- /dev/null +++ b/types/conf/v1/conf-tests.ts @@ -0,0 +1,41 @@ +import Conf = require('conf'); + +const conf = new Conf(); +new Conf({ + defaults: { + foo: 'bar', + unicorn: 'rainbow', + }, + configName: '', + projectName: 'foo', + cwd: '', +}); +// $ExpectError +new Conf({ + defaults: { + foo: 'bar', + unicorn: ['rainbow'], + }, +}); +conf.set('foo', 'bar'); +conf.set('hello', 1); +conf.set('unicorn', false); +conf.set('null', null); // $ExpectError + +conf.get('foo'); // $ExpectType string | number | boolean +conf.get('foo', 'bar'); // $ExpectType string | number | boolean +conf.get('foo', null); // $ExpectError +conf.delete('foo'); +conf.has('foo'); // $ExpectType boolean +conf.clear(); + +conf.store = { + foo: 'bar', + unicorn: 'rainbow', +}; +conf.path; // $ExpectType string + +for (const [key, value] of conf) { + key; // $ExpectType string + value; // $ExpectType string | number | boolean +} diff --git a/types/conf/v1/index.d.ts b/types/conf/v1/index.d.ts new file mode 100644 index 0000000000..f08cff1584 --- /dev/null +++ b/types/conf/v1/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for conf 1.4 +// Project: https://github.com/sindresorhus/conf +// Definitions by: Sam Verschueren +// BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +interface Options { + defaults?: { [key: string]: T }; + configName?: string; + projectName?: string; + cwd?: string; +} + +declare class Conf implements Iterable<[string, T]> { + store: { [key: string]: T }; + readonly path: string; + readonly size: number; + + constructor(options?: Options); + get(key: string, defaultValue?: T): T; + set(key: string, val: T): void; + set(object: { [key: string]: T }): void; + has(key: string): boolean; + delete(key: string): void; + clear(): void; + onDidChange(key: string, callback: (oldVal: any, newVal: any) => void): void; + [Symbol.iterator](): Iterator<[string, T]>; +} + +export = Conf; diff --git a/types/conf/v1/tsconfig.json b/types/conf/v1/tsconfig.json new file mode 100644 index 0000000000..86b3a62f41 --- /dev/null +++ b/types/conf/v1/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "conf": [ + "conf/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "conf-tests.ts" + ] +} diff --git a/types/conf/v1/tslint.json b/types/conf/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/conf/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/configstore/configstore-tests.ts b/types/configstore/configstore-tests.ts index ffd04e31a7..9365afdbda 100644 --- a/types/configstore/configstore-tests.ts +++ b/types/configstore/configstore-tests.ts @@ -5,6 +5,7 @@ let value: any; let key: string; let num: number; let object: any; +let path: string; cs.set(key, value); value = cs.get(key); @@ -13,4 +14,12 @@ cs.delete(key); object = cs.all; cs.all = object; num = cs.size; -key = cs.path; +path = cs.path; + +const csWithPathOption = new Configstore('foo', null, { configPath: path }); + +csWithPathOption.set(key, value); +value = csWithPathOption.get(key); +csWithPathOption.delete(key); + +key = csWithPathOption.path; diff --git a/types/configstore/index.d.ts b/types/configstore/index.d.ts index 2617f2bce0..bbc0740c23 100644 --- a/types/configstore/index.d.ts +++ b/types/configstore/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for configstore 2.1 +// Type definitions for configstore 4.0 // Project: https://github.com/yeoman/configstore // Definitions by: ArcticLight // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -67,5 +67,6 @@ declare class Configstore { declare namespace Configstore { interface ConfigstoreOptions { globalConfigPath?: boolean; + configPath?: string; } } diff --git a/types/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts index ea39a13f42..7173cb50dc 100644 --- a/types/connect-mongo/index.d.ts +++ b/types/connect-mongo/index.d.ts @@ -110,6 +110,7 @@ declare namespace connectMongo { length: (callback: (err: any, length: number) => void) => void; clear: (callback?: (err?: any) => void) => void; touch: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void; + close: () => void; } } diff --git a/types/connect-redis/index.d.ts b/types/connect-redis/index.d.ts index 5675512795..c5a26de73a 100644 --- a/types/connect-redis/index.d.ts +++ b/types/connect-redis/index.d.ts @@ -1,7 +1,6 @@ // Type definitions for connect-redis // Project: https://npmjs.com/package/connect-redis // Definitions by: Xavier Stouder -// Albert Kurniawan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 diff --git a/types/connect-timeout/index.d.ts b/types/connect-timeout/index.d.ts index 93114c1469..05cb91cb15 100644 --- a/types/connect-timeout/index.d.ts +++ b/types/connect-timeout/index.d.ts @@ -14,10 +14,9 @@ declare namespace Express { clearTimeout(): void; /** - * - * @return {boolean} true if timeout fired; false otherwise. + * @summary true if timeout fired; false otherwise. */ - timedout(event: string, message: string): boolean; + timedout: boolean; } } 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/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/contains-path/contains-path-tests.ts b/types/contains-path/contains-path-tests.ts new file mode 100644 index 0000000000..896cf86fe4 --- /dev/null +++ b/types/contains-path/contains-path-tests.ts @@ -0,0 +1,5 @@ +import containsPath = require('contains-path'); + +containsPath('foo/bar', 'foo'); // $ExpectType boolean +containsPath('foo/bar', 'FOO', { nocase: true }); // $ExpectType boolean +containsPath('foobar', 'foo', { partialMatch: true }); // $ExpectType boolean diff --git a/types/contains-path/index.d.ts b/types/contains-path/index.d.ts new file mode 100644 index 0000000000..7d607c0cbb --- /dev/null +++ b/types/contains-path/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for contains-path 1.0 +// Project: https://github.com/jonschlinkert/contains-path +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = containsPath; + +declare function containsPath( + filepath: string, + substr: string, + options?: containsPath.Options +): boolean; + +declare namespace containsPath { + interface Options { + nocase?: boolean; + partialMatch?: boolean; + } +} diff --git a/types/contains-path/tsconfig.json b/types/contains-path/tsconfig.json new file mode 100644 index 0000000000..5302a9a8e0 --- /dev/null +++ b/types/contains-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", + "contains-path-tests.ts" + ] +} diff --git a/types/contains-path/tslint.json b/types/contains-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/contains-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/content-range/content-range-tests.ts b/types/content-range/content-range-tests.ts new file mode 100644 index 0000000000..c482d6f072 --- /dev/null +++ b/types/content-range/content-range-tests.ts @@ -0,0 +1,23 @@ +import { format, parse } from 'content-range'; + +format({ + first: 10, + last: 100, + length: 100, + limit: 20, + unit: 'items', +}); + +format({ + length: null, + unit: 'bytes', +}); + +const parts = parse('items 10-29/100'); + +if (parts) { + parts.first; + parts.last; + parts.length; + parts.unit; +} diff --git a/types/content-range/index.d.ts b/types/content-range/index.d.ts new file mode 100644 index 0000000000..b8ee780541 --- /dev/null +++ b/types/content-range/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for content-range 1.1 +// Project: https://github.com/neoziro/content-range +// Definitions by: Alex Brick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface ContentRangeFormatOptions { + first?: number; + last?: number; + length: number | null; + limit?: number; + unit: string; +} + +export interface ContentRangeParts { + first: number | null; + last: number | null; + length: number | null; + unit: string; +} + +export function format(options: ContentRangeFormatOptions): string; +export function parse(str: string): ContentRangeParts | null; diff --git a/types/content-range/tsconfig.json b/types/content-range/tsconfig.json new file mode 100644 index 0000000000..a2649416e0 --- /dev/null +++ b/types/content-range/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", + "content-range-tests.ts" + ] +} diff --git a/types/content-range/tslint.json b/types/content-range/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/content-range/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/continuation-local-storage/continuation-local-storage-tests.ts b/types/continuation-local-storage/continuation-local-storage-tests.ts index aee44866af..9ab06a89d2 100644 --- a/types/continuation-local-storage/continuation-local-storage-tests.ts +++ b/types/continuation-local-storage/continuation-local-storage-tests.ts @@ -438,10 +438,10 @@ test("simple tracer built on contexts", function (t) { this.harvester = harvester; } runHandler(callback: any) { - const wrapped = tracer.bind(function () { + const wrapped = tracer.bind(() => { callback(); this.harvester.emit('finished', tracer.get('transaction')); - }.bind(this)); + }); wrapped(); } } diff --git a/types/convict/index.d.ts b/types/convict/index.d.ts index 2c3dbf0547..fd605f5077 100644 --- a/types/convict/index.d.ts +++ b/types/convict/index.d.ts @@ -37,6 +37,24 @@ declare namespace convict { parse: (content: string) => any; } + type PredefinedFormat = + | '*' + | 'int' + | 'port' + | 'windows_named_pipe' + | 'port_or_windows_named_pipe' + | 'url' + | 'email' + | 'ipaddress' + | 'duration' + | 'timestamp' + | 'nat' + | String + | Object + | Number + | RegExp + | Boolean; + interface SchemaObj { default: T; doc?: string; @@ -52,7 +70,7 @@ declare namespace convict { * If omitted, format will be set to the value of Object.prototype.toString.call * for the default value */ - format?: string | any[] | ((val: any) => void); + format?: PredefinedFormat | any[] | ((val: any) => void); env?: string; arg?: string; sensitive?: boolean; diff --git a/types/cookie/index.d.ts b/types/cookie/index.d.ts index bb7fc2cb54..cb03c91980 100644 --- a/types/cookie/index.d.ts +++ b/types/cookie/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for cookie 0.3 // Project: https://github.com/jshttp/cookie -// Definitions by: Pine Mizune +// Definitions by: Pine Mizune // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface CookieSerializeOptions { diff --git a/types/cookiejar/index.d.ts b/types/cookiejar/index.d.ts index ba50b63ea2..b976a0e1dc 100644 --- a/types/cookiejar/index.d.ts +++ b/types/cookiejar/index.d.ts @@ -112,5 +112,5 @@ export class CookieJar { * grab all cookies matching this access_info * @param accessInfo CookieAccessInfo */ - getCookies(accessInfo: CookieAccessInfo): ReadonlyArray; + getCookies(accessInfo: CookieAccessInfo): ReadonlyArray & { toValueString(): string }; } 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/copy/copy-tests.ts b/types/copy/copy-tests.ts new file mode 100644 index 0000000000..c72ad3532a --- /dev/null +++ b/types/copy/copy-tests.ts @@ -0,0 +1,35 @@ +import copy = require('copy'); +import File = require('vinyl'); + +copy.each(['a', 'b'], '.', { cwd: '..' }, () => {}); +copy.each(['a', 'b'], '.', { cwd: '..' }, (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); +copy.each(['a', 'b'], '.', () => {}); +copy.each(['a', 'b'], '.', (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); + +copy.one('a', '.', { cwd: '..' }, () => {}); +copy.one('a', '.', { cwd: '..' }, (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); +copy.one('a', '.', () => {}); +copy.one('a', '.', (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); + +copy(['a', 'b'], '.', { cwd: '..' }, () => {}); +copy(['a', 'b'], '.', { cwd: '..' }, (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); +copy(['a', 'b'], '.', () => {}); +copy(['a', 'b'], '.', (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); diff --git a/types/copy/index.d.ts b/types/copy/index.d.ts new file mode 100644 index 0000000000..567d6594d3 --- /dev/null +++ b/types/copy/index.d.ts @@ -0,0 +1,78 @@ +// Type definitions for copy 0.3 +// Project: https://github.com/jonschlinkert/copy +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import File = require('vinyl'); + +declare namespace copy { + /** + * Copy an array of files to the given destination `directory`, with + * `options` and callback function that exposes `err` and the array of + * vinyl files that are created by the copy operation. + * + * ```js + * copy.each(['foo.txt', 'bar.txt', 'baz.txt'], 'dist', function(err, files) { + * // exposes the vinyl `files` created when the files are copied + * }); + * ``` + * @param `files` Filepaths or vinyl files. + * @param `dir` Destination directory + * @param `options` or callback function + * @param `cb` Callback function if no options are specified + */ + function each(files: string[] | File[], dir: string, options: Options, cb: Callback): void; + function each(files: string[] | File[], dir: string, cb: Callback): void; + + /** + * Copy a single `file` to the given `dest` directory, using + * the specified options and callback function. + * + * ```js + * copy.one('foo.txt', 'dist', function(err, file) { + * if (err) throw err; + * // exposes the vinyl `file` that is created when the file is copied + * }); + * ``` + * @param `file` Filepath or vinyl file + * @param `dir` Destination directory + * @param `options` or callback function + * @param `cb` Callback function if no options are specified + */ + function one(pattern: string | File, dir: string, options: Options, cb: Callback): void; + function one(pattern: string | File, dir: string, cb: Callback): void; + + type Callback = (error: Error | null, files?: File[]) => void; + + interface Options { + cwd?: string; + srcBase?: string; + } +} + +/** + * Copy a filepath, vinyl file, array of files, or glob of files to the + * given destination `directory`, with `options` and callback function that + * exposes `err` and the array of vinyl files that are created by the copy + * operation. + * + * ```js + * copy('*.js', 'dist', function(err, file) { + * // exposes the vinyl `file` created when the file is copied + * }); + * ``` + * @param `patterns` Filepath(s), vinyl file(s) or glob of files. + * @param `dir` Destination directory + * @param `options` or callback function + * @param `cb` Callback function if no options are specified + */ +declare function copy( + patterns: string | File | string[] | File[], + dir: string, + options: copy.Options, + callback: copy.Callback, +): void; +declare function copy(patterns: string | File | string[] | File[], dir: string, callback: copy.Callback): void; + +export = copy; diff --git a/types/copy/tsconfig.json b/types/copy/tsconfig.json new file mode 100644 index 0000000000..0b3e1bd3d3 --- /dev/null +++ b/types/copy/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", + "copy-tests.ts" + ] +} diff --git a/types/copy/tslint.json b/types/copy/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/copy/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/copyfiles/copyfiles-tests.ts b/types/copyfiles/copyfiles-tests.ts new file mode 100644 index 0000000000..e1549c3c82 --- /dev/null +++ b/types/copyfiles/copyfiles-tests.ts @@ -0,0 +1,6 @@ +import copyfiles = require('copyfiles'); + +copyfiles(['file'], () => {}); +copyfiles(['file'], error => {}); +copyfiles(['file'], {all: true}, error => {}); +copyfiles(['file'], 10, error => {}); diff --git a/types/copyfiles/index.d.ts b/types/copyfiles/index.d.ts new file mode 100644 index 0000000000..9fc6ecde87 --- /dev/null +++ b/types/copyfiles/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for copyfiles 2.1 +// Project: https://github.com/calvinmetcalf/copyfiles#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace copyfiles { + interface Options { + /** include files & directories begining with a dot (.) */ + all?: boolean; + /** throw error if nothing is copied */ + error?: boolean; + /** pattern or glob to exclude */ + exclude?: string; + /** flatten the output */ + flat?: boolean; + /** do not overwrite destination files if they exist */ + soft?: boolean; + /** slice a path off the bottom of the paths */ + up?: number; + /** print more information to console */ + verbose?: boolean; + } + + type Callback = (error?: Error) => void; +} + +declare function copyfiles(paths: string[], options: copyfiles.Options | number, callback: copyfiles.Callback): void; +declare function copyfiles(paths: string[], callback: copyfiles.Callback): void; + +export = copyfiles; diff --git a/types/copyfiles/tsconfig.json b/types/copyfiles/tsconfig.json new file mode 100644 index 0000000000..83672e27b7 --- /dev/null +++ b/types/copyfiles/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", + "copyfiles-tests.ts" + ] +} diff --git a/types/copyfiles/tslint.json b/types/copyfiles/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/copyfiles/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts b/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts index 6e4317ac9d..f7830c18b2 100644 --- a/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts +++ b/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts @@ -61,59 +61,89 @@ var demoExtendedData : BLECentralPlugin.PeripheralDataExtended = { //get updates about the bluethooth states ble.startStateNotifications((state) => log(`BLE state ${state}`)); +ble.startStateNotifications((state) => log(`BLE state ${state}`), (err: string) => log(`things when wrong ${err}`)); -ble.isEnabled(()=> log(`bluetooth is enabled`), ()=>log(`bluetooth is not enabled`)); +ble.isEnabled(()=> log(`bluetooth is enabled`), err =>log(`bluetooth is not enabled: ${err}`)); //here we try to enable bluetooth -ble.enable(() => log(`yes it worked, or it was already enabled `), () => log(`nope it didn't work, the user pressed cancel, or we are in iOS`)); +ble.enable(() => log(`yes it worked, or it was already enabled `), err => log(`nope it didn't work, the user pressed cancel, or we are in iOS: ${err}`)); ble.showBluetoothSettings(() => log(`yes it worked`), () => log(`nope it didn't work`)) //stop getting updates about the bluethooth states ble.stopStateNotifications() +ble.stopStateNotifications(() => log(`yes it worked`)) +ble.stopStateNotifications(() => log(`yes it worked`), () => log(`nope it didn't work`)) //scan 5 seconds -ble.scan([], 5000, (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ); +ble.scan([], 5000, (data) => { devices.push(data); }); +ble.scan([], 5000, (data) => { devices.push(data); }, () => log(`couldn't connect`) ); +ble.scan([], 5000, (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`) ); //scan continously -ble.startScan([], (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ) +ble.startScan([], (data) => { devices.push(data); }) +ble.startScan([], (data) => { devices.push(data); }, () => log('couldn\'t connect') ) +ble.startScan([], (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`) ); ////scan continously -ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ) +ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }); +ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`)); //stop scanning ble.stopScan(()=> log('all good'), ()=> log('couldn\'t stop scanning')); //are we conenected to that device? +ble.isConnected(demoDevice.id, () => log(`already connected to this device`)); ble.isConnected(demoDevice.id, () => log(`already connected to this device`), ()=> log(`not yet connected to that device`)); //connect to a specific device var extendedData : BLECentralPlugin.PeripheralDataExtended; -ble.connect(demoDevice.id, (data)=> extendedData = data, () => log(`couldn't connect to the device`) ); +ble.connect(demoDevice.id, (data)=> extendedData = data, err => log(`couldn't connect to the device: ${err}`) ); //read some data from a characteristic var charsOfOneOfItsServices = demoExtendedData.characteristics.filter((value) => value.service == demoExtendedData.services[0]); +ble.read(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic); ble.read(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, (data) => log(`we've received some data`), ()=> log(`couldn't read any data`)); //read the rssi ble.readRSSI(demoDevice.id, (rssi)=>log(`Device ${demoDevice.name} has an RSSI of ${rssi}`)); +ble.readRSSI(demoDevice.id, (rssi)=>log(`Device ${demoDevice.name} has an RSSI of ${rssi}`), err => log(`Unable to read RSSI: ${err}`)); + + +// request mtu +ble.requestMtu(demoDevice.id, 10); +ble.requestMtu(demoDevice.id, 10, () => log('it worked')); +ble.requestMtu(demoDevice.id, 10, () => log('it worked'), () => log('it failed')); + +// refreshDeviceCache +ble.refreshDeviceCache(demoDevice.id, 10); +ble.refreshDeviceCache(demoDevice.id, 10, () => log('it worked')); +ble.refreshDeviceCache(demoDevice.id, 10, () => log('it worked'), () => log('it failed')); var notificationsReceived : number = 0; //get notified of changes for that characteristic -ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, (data)=> notificationsReceived++, ()=> log(`darn`)); +ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, + (data)=> notificationsReceived++); +ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, + (data)=> notificationsReceived++, err => log(`darn: ${err}`)); //write some data +ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40)); +ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`)); ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`), ()=> log(`could't write`)); //write some data without getting notified +ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40)); +ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`)); ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`), ()=> log(`could't write`)); //stop getting notified of changes. ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic); +ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, () => log('it worked')); +ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, () => log('it worked'), () => log('it failed')); //notificationsReceived == 1 //just disconnect ble.disconnect(demoDevice.id); - - - +ble.disconnect(demoDevice.id, () => log('it worked')); +ble.disconnect(demoDevice.id, () => log('it worked'), () => log('it failed')); diff --git a/types/cordova-plugin-ble-central/index.d.ts b/types/cordova-plugin-ble-central/index.d.ts index ccf2396833..070b62ff9e 100644 --- a/types/cordova-plugin-ble-central/index.d.ts +++ b/types/cordova-plugin-ble-central/index.d.ts @@ -1,12 +1,13 @@ -// Type definitions for cordova-plugin-ble-central 1.1.2 +// Type definitions for cordova-plugin-ble-central 1.2.2 // Project: https://github.com/don/cordova-plugin-ble-central // Definitions by: Gidon Junge +// Philip Peitsch // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace BLECentralPlugin { - interface PeripheralCharacteristic { + interface PeripheralCharacteristic { service: string; characteristic: string; properties: string[]; @@ -26,7 +27,12 @@ declare namespace BLECentralPlugin { characteristics: PeripheralCharacteristic[] } - + + interface BLEError { + name: string; + id: string; + errorMessage: string; + } interface StartScanOptions { @@ -34,75 +40,80 @@ declare namespace BLECentralPlugin { } export interface BLECentralPluginStatic { - scan(services: string[], seconds: number, success : (data: PeripheralData) => any): void; - scan(services: string[], seconds: number, success : (data: PeripheralData) => any, failure : () => any): void; - - startScan(services: string[], success: (data: PeripheralData) => any): void; - startScan(services: string[], success: (data: PeripheralData) => any, failure: () => any): void; + scan(services: string[], seconds: number, success : (data: PeripheralData) => any, failure? : (error: string) => any): void; - startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any): void; - startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure: () => any): void; + startScan(services: string[], success: (data: PeripheralData) => any, failure?: (error: string|BLEError) => any): void; + + startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure?: (error: string) => any): void; stopScan(): void; - stopScan(success: () => any): void; - stopScan(success: () => any, failure: () => any): void; - - connect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: () => any): void; + stopScan(success: () => any, failure?: () => any): void; - disconnect(device_id:string): void; - disconnect(device_id:string, success: () => any): void; - disconnect(device_id:string, success: () => any, failure: () => any): void; + connect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void; - read(device_id: string, service_uuid:string, characteristic_uuid:string): void; - read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any): void; - read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: () => any): void; + /* Automatically connect to a device when it is in range of the phone + [iOS] background notifications on ios must be enabled if you want to run in the background + [Android] this relies on the autoConnect argument of BluetoothDevice.connectGatt(). Not all Android devices implement this feature correctly. */ + autoConnect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void; - write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer): void; - write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any): void; - write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: () => any): void; + disconnect(device_id:string, success?: () => any, failure?: (error: string|BLEError) => any): void; - /* Writes data to a characteristic without a response from the peripheral. You are not notified if the write fails in the BLE stack. + read(device_id: string, service_uuid:string, characteristic_uuid:string, success?: (rawData: ArrayBuffer) => any, failure?: (error: string|BLEError) => any): void; + + write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success?: () => any, failure?: (error: string|BLEError) => any): void; + + /* Writes data to a characteristic without a response from the peripheral. You are not notified if the write fails in the BLE stack. The success callback is be called when the characteristic is written.*/ - writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer): void; - writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any): void; - writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: () => any): void; + writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success?: () => any, failure?: (error: string) => any): void; /* Register to be notified when the value of a characteristic changes. */ - startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any): void; - startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: () => any): void; - - stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string): void; - stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any): void; - stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any, failure: () => any): void; + startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure?: (error: string|BLEError) => any): void; + + stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success?: () => any, failure?: (error: string|BLEError) => any): void; /* Reports if bluetooth is enabled. */ - isEnabled(success: () => any , failure: () => any): void; + isEnabled(success: () => any , failure: (error: string) => any): void; /* Calls the success callback when the peripheral is connected and the failure callback when not connected. */ - isConnected(device_id: string, success: () => any): void; - isConnected(device_id: string, success: () => any, failure: () => any): void; + isConnected(device_id: string, success: () => any, failure?: (error: string) => any): void; - startStateNotifications(success: (state: string) => any): void; - startStateNotifications(success: (state: string) => any, failure: () => any): void; + /* May be used to request (on Android) a larger MTU size to be able to send more data at once + [iOS] requestMtu is not supported on iOS. */ + requestMtu(device_id: string, mtu: number, success?: () => any, failure?: () => any): void; + + /* Clears cached services and characteristics info for some poorly behaved devices. Uses an undocumented API, + so it is not guaranteed to work. + [iOS] refreshDeviceCache is not supported on iOS. */ + refreshDeviceCache(device_id: string, timeout_millis: number, success?: (data: PeripheralDataExtended) => any, failure?: (error: string|BLEError) => any): void; + + startStateNotifications(success: (state: string) => any, failure?: (error: string) => any): void; + + stopStateNotifications(success?: () => any, failure?: () => any): void; - stopStateNotifications(): void; - stopStateNotifications(success: () => any): void; - stopStateNotifications(success: () => any, failure: () => any): void; - /* Opens the Bluetooth settings for the operating systems. [iOS] showBluetoothSettings is not supported on iOS. */ - showBluetoothSettings(): void; - showBluetoothSettings(success: () => any): void; showBluetoothSettings(success: () => any, failure: () => any): void; - + /* Enable Bluetooth on the device. [iOS] enable is not supported on iOS. */ - enable(success: () => any, failure: () => any): void; - + enable(success: () => any, failure: (error: string) => any): void; - readRSSI(device_id:string, success: (rssi: number) => any): void; - readRSSI(device_id:string, success: (rssi: number) => any, failure: () => any): void; + readRSSI(device_id:string, success: (rssi: number) => any, failure?: (error: string) => any): void; + + /* Find connected peripherals offering the listed service UUIDs. + This function wraps CBCentralManager.retrieveConnectedPeripheralsWithServices. + [Android] peripheralsWithIdentifiers is not supported on Android. */ + connectedPeripheralsWithServices(services: string[], success: (data: PeripheralData[]) => any, failure: () => any): void; + + /* Find known (but not necessarily connected) peripherals offering the listed service UUIDs. + This function wraps CBCentralManager.retrievePeripheralsWithIdentifiers + [Android] peripheralsWithIdentifiers is not supported on Android. */ + peripheralsWithIdentifiers(services: string[], success: (data: PeripheralData[]) => any, failure: () => any): void; + + /* Find the bonded devices. + [iOS] bondedDevices is not supported on iOS. */ + bondedDevices(success: (data: PeripheralData[]) => any, failure: () => any): void; } } -declare var ble: BLECentralPlugin.BLECentralPluginStatic; \ No newline at end of file +declare var ble: BLECentralPlugin.BLECentralPluginStatic; 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-plugin-x-socialsharing/index.d.ts b/types/cordova-plugin-x-socialsharing/index.d.ts index a5105c898c..d1a4740b58 100644 --- a/types/cordova-plugin-x-socialsharing/index.d.ts +++ b/types/cordova-plugin-x-socialsharing/index.d.ts @@ -1,13 +1,13 @@ -// Type definitions for SocialSharing-PhoneGap-Plugin v5.1.8 +// Type definitions for SocialSharing-PhoneGap-Plugin v5.1.9 // Project: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin // Definitions by: Markus Wagner , Larry Bahr // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Window { - plugins: Plugins; + plugins: CordovaPlugins; } -interface Plugins { +interface CordovaPlugins { socialsharing: SocialSharingPlugin.SocialSharing; } 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/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/country-data/country-data-tests.ts b/types/country-data/country-data-tests.ts new file mode 100644 index 0000000000..850116dc63 --- /dev/null +++ b/types/country-data/country-data-tests.ts @@ -0,0 +1,14 @@ +import * as lib from 'country-data'; + +lib.callingCodes.all; // $ExpectType ReadonlyArray +lib.callingCountries.all; // $ExpectType ReadonlyArray +lib.continents.africa; // $ExpectType Continent +lib.continents.africa.countries; // $ExpectType ReadonlyArray +lib.countries.all; // $ExpectType ReadonlyArray +lib.currencies.all; // $ExpectType ReadonlyArray +lib.languages.all; // $ExpectType ReadonlyArray +lib.regions.antarctica; // $ExpectType Region +lib.regions.antarctica.countries; // $ExpectType ReadonlyArray +lib.lookup.countries(""); // $ExpectType ReadonlyArray +lib.lookup.currencies(""); // $ExpectType ReadonlyArray +lib.lookup.languages(""); // $ExpectType ReadonlyArray diff --git a/types/country-data/index.d.ts b/types/country-data/index.d.ts new file mode 100644 index 0000000000..80acbbcbba --- /dev/null +++ b/types/country-data/index.d.ts @@ -0,0 +1,103 @@ +// Type definitions for country-data 0.0 +// Project: https://github.com/OpenBookPrices/country-data +// Definitions by: Logan Dam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Country { + readonly alpha2: string; + readonly alpha3: string; + readonly countryCallingCodes: ReadonlyArray; + readonly currencies: ReadonlyArray; + readonly emoji: string; + readonly ioc: string; + readonly languages: ReadonlyArray; + readonly name: string; + readonly status: string; +} + +export interface Currency { + readonly code: string; + readonly decimals: number; + readonly name: string; + readonly number: number; +} + +export interface Language { + readonly alpha2: string; + readonly alpha3: string; + readonly bibliographic: string; + readonly name: string; +} + +export interface Continent { + readonly name: string; + readonly regions: ReadonlyArray; + readonly countries: ReadonlyArray; +} + +export interface Region { + readonly name: string; + readonly countries: ReadonlyArray; +} + +export const countries: { + readonly all: ReadonlyArray; +}; + +export const continents: { + readonly africa: Continent; + readonly antarctica: Continent; + readonly asia: Continent; + readonly europe: Continent; + readonly northAmerica: Continent; + readonly oceania: Continent; + readonly southAmerica: Continent; +}; + +export const callingCodes: { + readonly all: ReadonlyArray; +}; + +export const callingCountries: { + readonly all: ReadonlyArray; +}; + +export const currencies: { + readonly all: ReadonlyArray; +}; + +export const languages: { + readonly all: ReadonlyArray; +}; + +export const regions: { + readonly centralAsia: Region; + readonly southernAsia: Region; + readonly southeastAsia: Region; + readonly eastAsia: Region; + readonly westernAsia: Region; + readonly centralAfrica: Region; + readonly northAfrica: Region; + readonly southernAfrica: Region; + readonly eastAfrica: Region; + readonly westAfrica: Region; + readonly centralAmerica: Region; + readonly northernAmerica: Region; + readonly caribbean: Region; + readonly southAmerica: Region; + readonly antarctica: Region; + readonly northernEurope: Region; + readonly southernEurope: Region; + readonly easternEurope: Region; + readonly westernEurope: Region; + readonly australia: Region; + readonly melanesia: Region; + readonly micronesia: Region; + readonly polynesia: Region; +}; + +export const lookup: { + readonly countries: (query: any) => ReadonlyArray; + readonly currencies: (query: any) => ReadonlyArray; + readonly languages: (query: any) => ReadonlyArray; +}; diff --git a/types/country-data/tsconfig.json b/types/country-data/tsconfig.json new file mode 100644 index 0000000000..ccbbf6ecd6 --- /dev/null +++ b/types/country-data/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", + "country-data-tests.ts" + ] +} diff --git a/types/country-data/tslint.json b/types/country-data/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/country-data/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/country-list/country-list-tests.ts b/types/country-list/country-list-tests.ts index d96fe630e2..50952d2a87 100644 --- a/types/country-list/country-list-tests.ts +++ b/types/country-list/country-list-tests.ts @@ -1,5 +1,4 @@ -import countries from 'country-list'; -const Countries = countries(); +import * as Countries from 'country-list'; Countries.getCode('Barbados'); // BB @@ -14,3 +13,5 @@ Countries.getName('BB'); // Barbados Countries.getNameList(); Countries.getNames(); + +Countries.overwrite([{ code: 'TW', name: 'Taiwan' }]); diff --git a/types/country-list/index.d.ts b/types/country-list/index.d.ts index 6c1747ff2a..ac3c80c9d5 100644 --- a/types/country-list/index.d.ts +++ b/types/country-list/index.d.ts @@ -1,41 +1,45 @@ -// Type definitions for country-list 1.1 +// Type definitions for country-list 2.1 // Project: https://github.com/fannarsh/country-list // Definitions by: Kyle Roach +// Adam Binford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export default function Countries(): { - /** - * Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined. - */ - getName(code: string): string | undefined; +/** + * Expects an array of code and country name pairs to add to the list. Doesn't return anything. + */ +export function overwrite(countries: Array<{ code: string, name: string}>): void; - /** - * Expects the English country name. Returns the code for that country. If not found, it returns undefined. - */ - getCode(name: string): string | undefined; +/** + * Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined. + */ +export function getName(code: string): string | undefined; - /** - * Returns an array of all country names. - */ - getNames(): string[]; +/** + * Expects the English country name. Returns the code for that country. If not found, it returns undefined. + */ +export function getCode(name: string): string | undefined; - /** - * Returns an array of all country codes. - */ - getCodes(): string[]; +/** + * Returns an array of all country names. + */ +export function getNames(): string[]; - /** - * Returns a key-value object of all countries using the name as key. - */ - getNameList(): {[name: string]: string}; +/** + * Returns an array of all country codes. + */ +export function getCodes(): string[]; - /** - * Returns a key-value object of all countries using the code as key. - */ - getCodeList(): {[code: string]: string}; +/** + * Returns a key-value object of all countries using the name as key. + */ +export function getNameList(): {[name: string]: string}; - /** - * Returns an array of all country information, in the same format as it gets imported. - */ - getData(): Array<{ code: string, name: string }>; -}; +/** + * Returns a key-value object of all countries using the code as key. + */ +export function getCodeList(): {[code: string]: string}; + +/** + * Returns an array of all country information, in the same format as it gets imported. + */ +export function getData(): Array<{ code: string, name: string }>; diff --git a/types/country-list/v1/country-list-tests.ts b/types/country-list/v1/country-list-tests.ts new file mode 100644 index 0000000000..d96fe630e2 --- /dev/null +++ b/types/country-list/v1/country-list-tests.ts @@ -0,0 +1,16 @@ +import countries from 'country-list'; +const Countries = countries(); + +Countries.getCode('Barbados'); // BB + +Countries.getCodes(); + +Countries.getCodeList(); + +Countries.getData(); + +Countries.getName('BB'); // Barbados + +Countries.getNameList(); + +Countries.getNames(); diff --git a/types/country-list/v1/index.d.ts b/types/country-list/v1/index.d.ts new file mode 100644 index 0000000000..e225845bde --- /dev/null +++ b/types/country-list/v1/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for country-list 1.1 +// Project: https://github.com/fannarsh/country-list +// Definitions by: Kyle Roach +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default function Countries(): { + /** + * Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined. + */ + getName(code: string): string | undefined; + + /** + * Expects the English country name. Returns the code for that country. If not found, it returns undefined. + */ + getCode(name: string): string | undefined; + + /** + * Returns an array of all country names. + */ + getNames(): string[]; + + /** + * Returns an array of all country codes. + */ + getCodes(): string[]; + + /** + * Returns a key-value object of all countries using the name as key. + */ + getNameList(): {[name: string]: string}; + + /** + * Returns a key-value object of all countries using the code as key. + */ + getCodeList(): {[code: string]: string}; + + /** + * Returns an array of all country information, in the same format as it gets imported. + */ + getData(): Array<{ code: string, name: string }>; +}; diff --git a/types/country-list/v1/tsconfig.json b/types/country-list/v1/tsconfig.json new file mode 100644 index 0000000000..f10adfdde5 --- /dev/null +++ b/types/country-list/v1/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "country-list": ["country-list/v1"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "country-list-tests.ts" + ] +} \ No newline at end of file diff --git a/types/country-list/v1/tslint.json b/types/country-list/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/country-list/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-hash/create-hash-tests.ts b/types/create-hash/create-hash-tests.ts new file mode 100644 index 0000000000..d039a5a704 --- /dev/null +++ b/types/create-hash/create-hash-tests.ts @@ -0,0 +1,9 @@ +import createHash = require('create-hash'); + +const hash = createHash('sha224'); + +hash.update('synchronous write'); +hash.digest(); +hash.write('write to it as a stream'); +hash.end(); +hash.read(); diff --git a/types/create-hash/index.d.ts b/types/create-hash/index.d.ts new file mode 100644 index 0000000000..712be2520f --- /dev/null +++ b/types/create-hash/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for create-hash 1.2 +// Project: https://github.com/crypto-browserify/createHash +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { Hash } from 'crypto'; + +export = createHash; + +declare function createHash(algo: createHash.Algorithm): Hash; + +declare namespace createHash { + type Algorithm = + | 'md5' + | 'rmd160' + | 'ripemd160' + | 'sha' + | 'sha1' + | 'sha224' + | 'sha256' + | 'sha384' + | 'sha512'; +} diff --git a/types/create-hash/tsconfig.json b/types/create-hash/tsconfig.json new file mode 100644 index 0000000000..83e50b425c --- /dev/null +++ b/types/create-hash/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", + "create-hash-tests.ts" + ] +} diff --git a/types/create-hash/tslint.json b/types/create-hash/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/create-hash/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-hmac/create-hmac-tests.ts b/types/create-hmac/create-hmac-tests.ts new file mode 100644 index 0000000000..f233a0390a --- /dev/null +++ b/types/create-hmac/create-hmac-tests.ts @@ -0,0 +1,9 @@ +import createHmac = require('create-hmac'); + +const hmac = createHmac('sha224', Buffer.from('secret key')); + +hmac.update('synchronous write'); +hmac.digest(); +hmac.write('write to it as a stream'); +hmac.end(); +hmac.read(); diff --git a/types/create-hmac/index.d.ts b/types/create-hmac/index.d.ts new file mode 100644 index 0000000000..3d6bcfeafa --- /dev/null +++ b/types/create-hmac/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for create-hmac 1.1 +// Project: https://github.com/crypto-browserify/createHmac +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { Hmac } from 'crypto'; + +export = createHmac; + +declare function createHmac(algo: createHmac.Algorithm, key: string | Buffer): Hmac; + +declare namespace createHmac { + type Algorithm = + | 'rmd160' + | 'ripemd160' + | 'md5' + | 'sha' + | 'sha1' + | 'sha224' + | 'sha256' + | 'sha384' + | 'sha512'; +} diff --git a/types/create-hmac/tsconfig.json b/types/create-hmac/tsconfig.json new file mode 100644 index 0000000000..badd99da29 --- /dev/null +++ b/types/create-hmac/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", + "create-hmac-tests.ts" + ] +} diff --git a/types/create-hmac/tslint.json b/types/create-hmac/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/create-hmac/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-html-element/create-html-element-tests.ts b/types/create-html-element/create-html-element-tests.ts new file mode 100644 index 0000000000..e94b6cb617 --- /dev/null +++ b/types/create-html-element/create-html-element-tests.ts @@ -0,0 +1,48 @@ +import createHtmlElement = require('create-html-element'); + +createHtmlElement(); // $ExpectType HTMLDivElement +// $ExpectType HTMLDivElement +createHtmlElement({ + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ html: '🦄' }); // $ExpectType HTMLDivElement +createHtmlElement({ text: 'Hello World' }); // $ExpectType HTMLDivElement +createHtmlElement({ html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'h1' }); // $ExpectType HTMLHeadingElement +// $ExpectType HTMLHeadingElement +createHtmlElement({ + name: 'h1', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'h1', html: '🦄' }); // $ExpectType HTMLHeadingElement +createHtmlElement({ name: 'h1', text: 'Hello World' }); // $ExpectType HTMLHeadingElement +createHtmlElement({ name: 'h1', html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'foo' }); // $ExpectType HTMLElement +// $ExpectType HTMLElement +createHtmlElement({ + name: 'foo', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'foo', html: '🦄' }); // $ExpectType HTMLElement +createHtmlElement({ name: 'foo', text: 'Hello World' }); // $ExpectType HTMLElement +createHtmlElement({ name: 'foo', html: '🦄', text: 'Hello World' }); // $ExpectError diff --git a/types/create-html-element/index.d.ts b/types/create-html-element/index.d.ts new file mode 100644 index 0000000000..86fd758b3e --- /dev/null +++ b/types/create-html-element/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for create-html-element 2.0 +// Project: https://github.com/sindresorhus/create-html-element#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export = createHtmlElement; + +declare function createHtmlElement( + options?: createHtmlElement.OptionsWithoutTagName +): HTMLDivElement; +declare function createHtmlElement( + options: createHtmlElement.Options +): HTMLElementTagNameMap[K]; +declare function createHtmlElement(options: createHtmlElement.Options): HTMLElement; + +declare namespace createHtmlElement { + type Without = { [P in Exclude]?: never }; + type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; + + interface AttributesOptions { + attributes?: { [key: string]: string | boolean | number | string[] }; + } + + interface HtmlOptions { + html?: string; + } + + interface TextOptions { + text?: string; + } + + type OptionsWithoutTagName = AttributesOptions & XOR; + + interface OptionsWithTagName extends AttributesOptions { + name: K; + } + + type Options = OptionsWithTagName & XOR; +} diff --git a/types/create-html-element/package.json b/types/create-html-element/package.json new file mode 100644 index 0000000000..bb80441dc0 --- /dev/null +++ b/types/create-html-element/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { "*": ["ts3.1/*"] } + } +} diff --git a/types/create-html-element/ts3.1/create-html-element-tests.ts b/types/create-html-element/ts3.1/create-html-element-tests.ts new file mode 100644 index 0000000000..6d44f3df60 --- /dev/null +++ b/types/create-html-element/ts3.1/create-html-element-tests.ts @@ -0,0 +1,64 @@ +import createHtmlElement = require('create-html-element'); + +createHtmlElement(); // $ExpectType HTMLDivElement +// $ExpectType HTMLDivElement +createHtmlElement({ + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ html: '🦄' }); // $ExpectType HTMLDivElement +createHtmlElement({ text: 'Hello World' }); // $ExpectType HTMLDivElement +createHtmlElement({ html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'h1' }); // $ExpectType HTMLHeadingElement +// $ExpectType HTMLHeadingElement +createHtmlElement({ + name: 'h1', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'h1', html: '🦄' }); // $ExpectType HTMLHeadingElement +createHtmlElement({ name: 'h1', text: 'Hello World' }); // $ExpectType HTMLHeadingElement +createHtmlElement({ name: 'h1', html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'listing' }); // $ExpectType HTMLPreElement +// $ExpectType HTMLPreElement +createHtmlElement({ + name: 'listing', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'listing', html: '🦄' }); // $ExpectType HTMLPreElement +createHtmlElement({ name: 'listing', text: 'Hello World' }); // $ExpectType HTMLPreElement +createHtmlElement({ name: 'listing', html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'foo' }); // $ExpectType HTMLElement +// $ExpectType HTMLElement +createHtmlElement({ + name: 'foo', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'foo', html: '🦄' }); // $ExpectType HTMLElement +createHtmlElement({ name: 'foo', text: 'Hello World' }); // $ExpectType HTMLElement +createHtmlElement({ name: 'foo', html: '🦄', text: 'Hello World' }); // $ExpectError diff --git a/types/create-html-element/ts3.1/index.d.ts b/types/create-html-element/ts3.1/index.d.ts new file mode 100644 index 0000000000..113f9ba588 --- /dev/null +++ b/types/create-html-element/ts3.1/index.d.ts @@ -0,0 +1,38 @@ +export = createHtmlElement; + +declare function createHtmlElement( + options?: createHtmlElement.OptionsWithoutTagName +): HTMLDivElement; +declare function createHtmlElement( + options: createHtmlElement.Options +): HTMLElementTagNameMap[K]; +/** @deprecated */ +declare function createHtmlElement( + options: createHtmlElement.Options +): HTMLElementDeprecatedTagNameMap[K]; +declare function createHtmlElement(options: createHtmlElement.Options): HTMLElement; + +declare namespace createHtmlElement { + type Without = { [P in Exclude]?: never }; + type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; + + interface AttributesOptions { + attributes?: { [key: string]: string | boolean | number | string[] }; + } + + interface HtmlOptions { + html?: string; + } + + interface TextOptions { + text?: string; + } + + type OptionsWithoutTagName = AttributesOptions & XOR; + + interface OptionsWithTagName extends AttributesOptions { + name: K; + } + + type Options = OptionsWithTagName & XOR; +} diff --git a/types/create-html-element/ts3.1/tsconfig.json b/types/create-html-element/ts3.1/tsconfig.json new file mode 100644 index 0000000000..6c82d9de10 --- /dev/null +++ b/types/create-html-element/ts3.1/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", + "create-html-element-tests.ts" + ] +} diff --git a/types/create-html-element/ts3.1/tslint.json b/types/create-html-element/ts3.1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/create-html-element/ts3.1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-html-element/tsconfig.json b/types/create-html-element/tsconfig.json new file mode 100644 index 0000000000..44a7146986 --- /dev/null +++ b/types/create-html-element/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", + "create-html-element-tests.ts" + ] +} diff --git a/types/create-html-element/tslint.json b/types/create-html-element/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/create-html-element/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-xpub/create-xpub-tests.ts b/types/create-xpub/create-xpub-tests.ts new file mode 100644 index 0000000000..c202d819d8 --- /dev/null +++ b/types/create-xpub/create-xpub-tests.ts @@ -0,0 +1,23 @@ +import createXpub = require('create-xpub'); + +// $ExpectType string +createXpub({ + depth: 3, + childNumber: 2147483648, + chainCode: '84cf7d9029cdd9fcadbb3717fd92ec0db7d7d9787c57c13c08fc887c389b566b', + publicKey: + '048bcdcf59f046b13f1eb35b608d1211265fde8cc44fc7a5a7f7107c5cf238095328a0e0d7be17c7d3e48490e8c6433af6d2c3dacc687f3fecaa98a3d05f17de97', +}); + +// $ExpectType string +createXpub({ + networkVersion: createXpub.testnet, + depth: 3, + childNumber: 2147483648, + chainCode: '84cf7d9029cdd9fcadbb3717fd92ec0db7d7d9787c57c13c08fc887c389b566b', + publicKey: + '048bcdcf59f046b13f1eb35b608d1211265fde8cc44fc7a5a7f7107c5cf238095328a0e0d7be17c7d3e48490e8c6433af6d2c3dacc687f3fecaa98a3d05f17de97', +}); + +createXpub.mainnet; // $ExpectType 76067358 +createXpub.testnet; // $ExpectType 70617039 diff --git a/types/create-xpub/index.d.ts b/types/create-xpub/index.d.ts new file mode 100644 index 0000000000..13057396eb --- /dev/null +++ b/types/create-xpub/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for create-xpub 2.1 +// Project: https://github.com/lukechilds/create-xpub#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = createXpub; + +/** + * Creates a Base58 encoded extended public key (xpub) for use in a + * [BIP32 hierarchical deterministic wallet](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki). + * + * Tip: If you're working with ledgerjs you can pass the output of + * [`getWalletPublicKey()`](http://ledgerhq.github.io/ledgerjs/docs/#btcgetwalletpublickey) almost directly in. + * + * @returns A Base58 encoded extended public key. + */ +declare function createXpub(options: createXpub.Options): string; + +declare namespace createXpub { + /** + * Mainnet (xpub) version bytes. + */ + const mainnet: 0x0488B21E; + /** + * Testnet (tpub) version bytes. + */ + const testnet: 0x043587CF; + + interface Options { + /** + * Network version bytes. + * @default 0x0488B21E + */ + networkVersion?: number; + /** + * The depth of the derived key. + */ + depth: number; + /** + * The child number. + */ + childNumber: number; + /** + * The chain code. + */ + chainCode: string; + /** + * The public key in compressed or uncompressed form. + */ + publicKey: string; + } +} diff --git a/types/create-xpub/tsconfig.json b/types/create-xpub/tsconfig.json new file mode 100644 index 0000000000..53e9b64c11 --- /dev/null +++ b/types/create-xpub/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", + "create-xpub-tests.ts" + ] +} diff --git a/types/create-xpub/tslint.json b/types/create-xpub/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/create-xpub/tslint.json @@ -0,0 +1 @@ +{ "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; + // TODO: The return type should reflect newly selected types. + /** + * 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 | JQuery.Node): 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.TriggeredEvent, + 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.TriggeredEvent, + 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.TriggeredEvent, + 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.TriggeredEvent, + 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: TType, + eventData: TData, + handler: JQuery.TypeEventHandler + ): 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: TType, + handler_preventBubble: JQuery.TypeEventHandler | + 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.TypeEventHandlers): 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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: TType, + eventData: TData, + handler: JQuery.TypeEventHandler + ): 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: TType, + handler: JQuery.TypeEventHandler | + 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.TypeEventHandlers + ): 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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 two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + * @param handlerIn A function to execute when the mouse pointer enters 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 + * @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" ); +``` + */ + hover(handlerIn: JQuery.TypeEventHandler | + false, + handlerOut: JQuery.TypeEventHandler | + false): this; + /** + * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + * @see \`{@link https://api.jquery.com/hover/ }\` + * @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 ​ ````Slide the next sibling LI up or down on hover, and toggle a class. +```html + + + + + hover demo + + + + +​ +
      +
    • Milk
    • +
    • White
    • +
    • Carrots
    • +
    • Orange
    • +
    • Broccoli
    • +
    • Green
    • +
    +​ + +​ + + +``` + */ + hover(handlerInOut: JQuery.TypeEventHandler | + 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 | + JQuery.Node | + ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString | JQuery.Node)): 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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: TType, + selector: JQuery.Selector, + handler: JQuery.TypeEventHandler | + 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: TType, + selector_handler?: JQuery.Selector | + JQuery.TypeEventHandler | + 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.TypeEventHandlers, + 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.TriggeredEvent): 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: TType, + selector: JQuery.Selector, + data: TData, + handler: JQuery.TypeEventHandler + ): 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: TType, + selector: null | undefined, + data: TData, + handler: JQuery.TypeEventHandler + ): 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 | undefined, + 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: TType, + selector: JQuery.Selector, + handler: JQuery.TypeEventHandler | + 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 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: TType, + data: TData, + handler: JQuery.TypeEventHandler + ): 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_data _@param_ `selector_data` + *
      + * * `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.
      + * * `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 ​ ````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(); +}); +``` + * @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, + selector_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: TType, + handler: JQuery.TypeEventHandler | + 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, + 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.TypeEventHandlers, + selector: JQuery.Selector, + 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. + * @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.TypeEventHandlers, + selector: null | undefined, + 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.TypeEventHandlers, + 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.TypeEventHandlers, + 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.TypeEventHandlers): 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: TType, + selector: JQuery.Selector, + data: TData, + handler: JQuery.TypeEventHandler + ): 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: TType, + selector: null | undefined, + data: TData, + handler: JQuery.TypeEventHandler + ): 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: TType, + selector: JQuery.Selector, + handler: JQuery.TypeEventHandler | + 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: TType, + data: TData, + handler: JQuery.TypeEventHandler + ): 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: TType, + handler: JQuery.TypeEventHandler| + 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.TypeEventHandlers, + selector: JQuery.Selector, + 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. + * @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.TypeEventHandlers, + selector: null | undefined, + 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.TypeEventHandlers, + 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.TypeEventHandlers, + 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.TypeEventHandlers): 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 | + JQuery.Node | + ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString | + JQuery | + JQuery.TypeOrArray | + JQuery.Node)): 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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.TypeEventHandler): 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.TypeEventHandler | + 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: TType, + handler: JQuery.TypeEventHandler | + 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.TriggeredEvent): 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: TType, + handler: JQuery.TypeEventHandler | + 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 eventType_events _@param_ `eventType_events` + *
      + * * `eventType` — A string containing a JavaScript event type, such as "click" or "keydown"
      + * * `events` — 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, + eventType_events: string | + JQuery.TypeEventHandlers): 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..4ba7653e69 --- /dev/null +++ b/types/jquery/JQueryStatic.d.ts @@ -0,0 +1,13521 @@ +// 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" ); +``` + */ + // NOTE: `HTMLSelectElement` is both an Element and an Array-Like Object but jQuery treats it as an Element. + (element: HTMLSelectElement): 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_elementArray _@param_ `element_elementArray` + *
      + * * `element` — A DOM element to wrap in a jQuery object.
      + * * `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 ​ ````Set the background color of the page to black. +```javascript +$( document.body ).css( "background", "black" ); +``` + * @example ​ ````Hide all the input elements within a form. +```javascript +$( myForm.elements ).hide(); +``` + */ + (element_elementArray: T | ArrayLike): 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 299ba7a7d3..2d4171320b 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -25,62392 +25,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// tslint:disable:jsdoc-format -// tslint:disable:max-line-length -// tslint:disable:no-irregular-whitespace +/// +/// +/// +/// +/// -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 https://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/ }\`. - * @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; - 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 - * @example ​ ````Listen for document ready using jQuery.when. -```html - - - - - jQuery.ready demo - - - -​​ - - - -``` - * @example ​ ````Typical usage involving another promise, using jQuery.when. -```html - - - - - jQuery.ready demo - - - -​​ - - - -``` - */ - 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 - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Find all div elements within an XML document from an Ajax response. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Set the background color of the page to black. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Hide all the input elements within a form. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Create some DOM elements. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Execute the function when the DOM is ready to be used. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - */ - // 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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Find all div elements within an XML document from an Ajax response. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Set the background color of the page to black. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Hide all the input elements within a form. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Create some DOM elements. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Execute the function when the DOM is ready to be used. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - */ - // 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 ​ ````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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Find all div elements within an XML document from an Ajax response. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Set the background color of the page to black. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Hide all the input elements within a form. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Create some DOM elements. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Execute the function when the DOM is ready to be used. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - */ - // 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 - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Find all div elements within an XML document from an Ajax response. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Set the background color of the page to black. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Hide all the input elements within a form. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Create some DOM elements. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Execute the function when the DOM is ready to be used. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - */ - // 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 - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Find all div elements within an XML document from an Ajax response. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Set the background color of the page to black. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Hide all the input elements within a form. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Create some DOM elements. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Execute the function when the DOM is ready to be used. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - */ - (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 ​ ````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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Find all div elements within an XML document from an Ajax response. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Set the background color of the page to black. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Hide all the input elements within a form. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Create some DOM elements. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Execute the function when the DOM is ready to be used. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - */ - // 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 - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Find all div elements within an XML document from an Ajax response. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Set the background color of the page to black. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Hide all the input elements within a form. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Create some DOM elements. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Execute the function when the DOM is ready to be used. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - */ - (object: T): JQuery; - /** - * Returns an empty jQuery set. - * - * @see \`{@link https://api.jquery.com/jQuery/ }\` - * @since 1.4 - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Find all div elements within an XML document from an Ajax response. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Set the background color of the page to black. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Hide all the input elements within a form. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Create some DOM elements. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @example ​ ````Execute the function when the DOM is ready to be used. -```html - - - - - jQuery demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery demo - - - -​​ - - - -``` - */ - // 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 - * @example ​ ````Save some data to the server and notify the user once it's complete. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - * @example ​ ````Retrieve the latest version of an HTML page. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - * @example ​ ````Load and execute a JavaScript file. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - * @example ​ ````Retrieve the latest version of an HTML page. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - * @example ​ ````Load and execute a JavaScript file. -```html - - - - - jQuery.ajax demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - jQuery.ajaxSetup demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Check if an element is a descendant of another. -```html - - - - - jQuery.contains demo - - - -​​ - - - -``` - */ - 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 ​ ````Store then retrieve a value from the div element. -```html - - - - - jQuery.data demo - - - - -​ -
      - The values stored were - - and - -
      -​ - - - -``` - * @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, 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 - * @example ​ ````Store then retrieve a value from the div element. -```html - - - - - jQuery.data demo - - - - -​ -
      - The values stored were - - and - -
      -​ - - - -``` - * @example ​ ````Get the data named "blah" stored at for an element. -```html - - - - - jQuery.data demo - - - - -​ -
      A div
      - - - - -

      The "blah" value of this div is ?

      -​ - - - -``` - */ - // `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, 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 - -
      -​ - - - -``` - * @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, 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. -```html - - - - - jQuery.each demo - - - -​​ - - - -``` - * @example ​ ````Iterates over the properties in an object, accessing both the current item and its key. -```html - - - - - jQuery.each demo - - - -​​ - - - -``` - */ - 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 - * @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. -```html - - - - - jQuery.each demo - - - -​​ - - - -``` - * @example ​ ````Iterates over the properties in an object, accessing both the current item and its key. -```html - - - - - jQuery.each demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Override jQuery.error for display in Firebug. -```html - - - - - jQuery.error demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - jQuery.escapeSelector demo - - - -​​ - - - -``` - * @example ​ ````Select all the elements having a class name of .box inside a div. -```html - - - - - jQuery.escapeSelector demo - - - -​​ - - - -``` - */ - 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, modifying the first. -```html - - - - - jQuery.extend demo - - - -​ -
      -​ - - - -``` - * @example ​ ````Merge two objects recursively, 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(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, modifying the first. -```html - - - - - jQuery.extend demo - - - -​ -
      -​ - - - -``` - * @example ​ ````Merge two objects recursively, 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(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, modifying the first. -```html - - - - - jQuery.extend demo - - - -​ -
      -​ - - - -``` - * @example ​ ````Merge two objects recursively, 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(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, modifying the first. -```html - - - - - jQuery.extend demo - - - -​ -
      -​ - - - -``` - * @example ​ ````Merge two objects recursively, 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(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, modifying the first. -```html - - - - - jQuery.extend demo - - - -​ -
      -​ - - - -``` - * @example ​ ````Merge two objects recursively, 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(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, modifying the first. -```html - - - - - jQuery.extend demo - - - -​ -
      -​ - - - -``` - * @example ​ ````Merge two objects recursively, 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(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. - * @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, modifying the first. -```html - - - - - jQuery.extend demo - - - -​ -
      -​ - - - -``` - * @example ​ ````Merge two objects recursively, 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(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 two objects recursively, 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 two objects recursively, 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 two objects recursively, 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 two objects recursively, 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 two objects recursively, 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 two objects recursively, 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. - * @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 two objects recursively, 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 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 ​ ````Request the test.php page, but ignore the return results. -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Request the test.php page, but ignore the return results. -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Request the test.php page, but ignore the return results. -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Request the test.php page, but ignore the return results. -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.get demo - - - -​​ - - - -``` - */ - 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 - * @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. -```html - - - - - jQuery.getJSON demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.getJSON demo - - - -​​ - - - -``` - */ - 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 - * @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. -```html - - - - - jQuery.getJSON demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.getJSON demo - - - -​​ - - - -``` - */ - 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: -```html - - - - - jQuery.getScript demo - - - -​​ - - - -``` - * @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; - /** - * 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. -```html - - - - - jQuery.globalEval demo - - - -​​ - - - -``` - */ - 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 - * @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. -```html - - - - - jQuery.grep demo - - - -​​ - - - -``` - * @example ​ ````Filter an array of numbers to include numbers that are not bigger than zero. -```html - - - - - jQuery.grep demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Set data on an element and see the results of hasData. -```html - - - - - jQuery.hasData demo - - - -​ -

      Results:

      -​ - - - -``` - */ - 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 }\`. - * @example ​ ````Delay the ready event until a custom plugin has loaded. -```html - - - - - jQuery.holdReady demo - - - -​​ - - - -``` - */ - 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 - * @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 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. -```html - - - - - jQuery.isEmptyObject demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - jQuery.isFunction demo - - - -​​ - - - -``` - */ - // 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. -```html - - - - - jQuery.isNumeric demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - jQuery.isPlainObject demo - - - -​​ - - - -``` - */ - 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 }\`. - * @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. -```html - - - - - jQuery.isXMLDoc demo - - - -​​ - - - -``` - */ - 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 -```html - - - - - jQuery.makeArray demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map the original array to a new one; each element is added with its original value and the value plus one. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map the original object to a new array and double each value. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map an object's keys to an array. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map the original array to a new one; each element is squared. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Augment the resulting array by returning an array inside the function. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - */ - 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 ​ ````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. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map the original array to a new one; each element is added with its original value and the value plus one. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map the original object to a new array and double each value. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map an object's keys to an array. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map the original array to a new one; each element is squared. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - * @example ​ ````Augment the resulting array by returning an array inside the function. -```html - - - - - jQuery.map demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - jQuery.merge demo - - - -​​ - - - -``` - * @example ​ ````Merges two arrays, altering the first argument. -```html - - - - - jQuery.merge demo - - - -​​ - - - -``` - * @example ​ ````Merges two arrays, but uses a copy, so the original isn't altered. -```html - - - - - jQuery.merge demo - - - -​​ - - - -``` - */ - 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 $. -```html - - - - - jQuery.noConflict demo - - - -​​ - - - -``` - * @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. -```html - - - - - jQuery.noConflict demo - - - -​​ - - - -``` - * @example ​ ````Create a different alias instead of jQuery to use in the rest of the script. -```html - - - - - jQuery.noConflict demo - - - -​​ - - - -``` - * @example ​ ````Completely move jQuery to a new namespace in another object. -```html - - - - - jQuery.noConflict demo - - - -​​ - - - -``` - * @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; - /** - * 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 - * @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 - * @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: 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 - * @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 }\`. - * @example ​ ````Parse a JSON string. -```html - - - - - jQuery.parseJSON demo - - - -​​ - - - -``` - */ - 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 ​ ````Request the test.php page, but ignore the return results. -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Send form data using Ajax requests -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @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")); ?>). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Post a form using Ajax and put results in a div -```html - - - - - jQuery.post demo - - - -​ -
      - - -
      - -
      -​ - - - -``` - */ - 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 - * @example ​ ````Request the test.php page, but ignore the return results. -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Send form data using Ajax requests -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @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")); ?>). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Post a form using Ajax and put results in a div -```html - - - - - jQuery.post demo - - - -​ -
      - - -
      - -
      -​ - - - -``` - */ - 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 - * @example ​ ````Request the test.php page, but ignore the return results. -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Send form data using Ajax requests -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @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")); ?>). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @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 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 - * @example ​ ````Request the test.php page, but ignore the return results. -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Pass arrays of data to the server (while still ignoring the return results). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Send form data using Ajax requests -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @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")); ?>). -```html - - - - - jQuery.post demo - - - -​​ - - - -``` - * @example ​ ````Post a form using Ajax and put results in a div -```html - - - - - jQuery.post demo - - - -​ -
      - - -
      - -
      -​ - - - -``` - */ - post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; - - // region proxy - // #region proxy - - // region (fn, null | undefined) - // #region (fn, 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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: () => 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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: (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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: (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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: (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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 - // #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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 - // #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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 - // #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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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+ additional arguments - // #region 8+ additional 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: (...args: any[]) => TReturn, - context: null | undefined, - ...additionalArguments: any[]): (...args: any[]) => TReturn; - - // #endregion - - // #endregion - - // region (fn, context) - // #region (fn, 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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: () => TReturn, - context: TContext): (this: 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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: (t: T) => TReturn, - context: TContext): (this: 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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: (t: T, u: U) => TReturn, - context: TContext): (this: 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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: (t: T, u: U, v: V) => TReturn, - context: TContext): (this: 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 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 - // #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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 - // #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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 - // #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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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+ additional arguments - // #region 8+ additional 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 }\`. - * @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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(fn: (...args: any[]) => TReturn, - context: TContext, - ...additionalArguments: any[]): (this: TContext, ...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 ​ ````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 ​ ````Enforce the context of the function using the "context, function name" signature. Unbind the 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(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 - * @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. -```html - - - - - jQuery.readyException demo - - - -​​ - - - -``` - */ - 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, 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 - * @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.
      -```html
      -
      -
      -
      -  
      -  jQuery.trim demo
      -  
      -
      -
      -​​
      -
      -
      -
      -```
      -     */
      -    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';
      -    /**
      -     * @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 }`.
      -     * @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). -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - */ - 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 - * @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). -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - */ - 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 - * @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). -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - */ - 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 - * @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). -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - */ - 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 - * @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). -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - */ - 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 - * @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). -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. -```html - - - - - jQuery.when demo - - - -​​ - - - -``` - */ - when(...deferreds: any[]): JQuery.Promise; -} - -interface JQuery extends Iterable { - /** - * A string containing the jQuery version number. - * - * @see \`{@link https://api.jquery.com/jquery-2/#jquery1 }\` - * @since 1.0 - * @example ​ ````Determine if an object is a jQuery object -```html - - - - - jquery demo - - - -​​ - - - -``` - * @example ​ ````Get the current version of jQuery running on the page -```html - - - - - jquery demo - - - -​​ - - - -``` - */ - jquery: string; - /** - * The number of elements in the jQuery object. - * - * @see \`{@link https://api.jquery.com/length/ }\` - * @since 1.0 - * @example ​ ````Count the divs. Click to add more. -```html - - - - - length demo - - - - -​ -
      ​ - - - -``` - */ - 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 - * @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: 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 - * @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: 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 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 - * @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: 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 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 - * @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(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 - * @example ​ ````Show a message when an Ajax request completes. -```html - - - - - ajaxComplete demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - ajaxError demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - ajaxSend demo - - - -​​ - - - -``` - */ - 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). -```html - - - - - ajaxStart demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - ajaxStop demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - ajaxSuccess demo - - - -​​ - - - -``` - */ - 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 ​ ````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 ​ ````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 all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. -```html - - - - - animate demo - - - -​​ - - - -``` - * @example ​ ````Animate all paragraphs to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. -```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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @example ​ ````Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - */ - 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 - * @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 ​ ````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 all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. -```html - - - - - animate demo - - - -​​ - - - -``` - * @example ​ ````Animate all paragraphs to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. -```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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @example ​ ````Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - */ - 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 ​ ````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 ​ ````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 all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. -```html - - - - - animate demo - - - -​​ - - - -``` - * @example ​ ````Animate all paragraphs to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. -```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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @example ​ ````Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - */ - 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 - * @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 ​ ````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 all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. -```html - - - - - animate demo - - - -​​ - - - -``` - * @example ​ ````Animate all paragraphs to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. -```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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @example ​ ````Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - * @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. -```html - - - - - animate demo - - - -​​ - - - -``` - */ - 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 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 - * @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(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 - * @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 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 - * @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:
      -​ - - - -``` - * @example ​ ````Set some attributes for all <img>s in the page. -```html - - - - - attr demo - - - - -​ - - - -​ -
      Attribute of Ajax
      -​ - - - -``` - * @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: 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 ​ ````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:
      -​ - - - -``` - * @example ​ ````Set some attributes for all <img>s in the page. -```html - - - - - attr demo - - - - -​ - - - -​ -
      Attribute of Ajax
      -​ - - - -``` - * @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(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:
      -​ - - - -``` - * @example ​ ````Set some attributes for all <img>s in the page. -```html - - - - - attr demo - - - - -​ - - - -​ -
      Attribute of Ajax
      -​ - - - -``` - * @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): 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 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 - * @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(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 }\`. - * @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: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````You can pass some extra data before the event handler: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Cancel a default action and prevent it from bubbling up by returning false: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using the .preventDefault() method. -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Stop an event from bubbling without preventing the default action by using the .stopPropagation() method. -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Bind custom events. -```html - - - - - bind demo - - - - -​ -

      Has an attached custom event.

      - - -​ - - - -``` - * @example ​ ````Bind multiple events simultaneously. -```html - - - - - bind demo - - - -​​ - - - -``` - */ - 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 }\`. - * @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: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````You can pass some extra data before the event handler: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Cancel a default action and prevent it from bubbling up by returning false: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using the .preventDefault() method. -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Stop an event from bubbling without preventing the default action by using the .stopPropagation() method. -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Bind custom events. -```html - - - - - bind demo - - - - -​ -

      Has an attached custom event.

      - - -​ - - - -``` - * @example ​ ````Bind multiple events simultaneously. -```html - - - - - bind demo - - - -​​ - - - -``` - */ - 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 }\`. - * @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: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````You can pass some extra data before the event handler: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Cancel a default action and prevent it from bubbling up by returning false: -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using the .preventDefault() method. -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Stop an event from bubbling without preventing the default action by using the .stopPropagation() method. -```html - - - - - bind demo - - - -​​ - - - -``` - * @example ​ ````Bind custom events. -```html - - - - - bind demo - - - - -​ -

      Has an attached custom event.

      - - -​ - - - -``` - * @example ​ ````Bind multiple events simultaneously. -```html - - - - - bind demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````To trigger the blur event on all paragraphs: -```html - - - - - blur demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````To trigger the blur event on all paragraphs: -```html - - - - - blur demo - - - -​​ - - - -``` - */ - 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 }\`. - * @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: -```html - - - - - change demo - - - -​​ - - - -``` - */ - 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 }\`. - * @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: -```html - - - - - change demo - - - -​​ - - - -``` - */ - 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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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: -```html - - - - - click demo - - - -​​ - - - -``` - */ - 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 }\`. - * @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: -```html - - - - - click demo - - - -​​ - - - -``` - */ - 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 - * @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: 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 - * @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: 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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @example ​ ````To show a "Hello World!" alert box when the contextmenu event is triggered on a paragraph on the page: -```html - - - - - contextmenu demo - - - -​​ - - - -``` - * @example ​ ````Right click to toggle background color. -```html - - - - - contextmenu demo - - - - -​ -
      -Right click the block -​ - - - -``` - */ - 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 }\`. - * @example ​ ````To show a "Hello World!" alert box when the contextmenu event is triggered on a paragraph on the page: -```html - - - - - contextmenu demo - - - -​​ - - - -``` - * @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 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 - * @example ​ ````Get the background color of a clicked div. -```html - - - - - css demo - - - - -​ -  -
      -
      -
      -
      -​ - - - -``` - * @example ​ ````Get the width, height, text color, and background color of a clicked div. -```html - - - - - css demo - - - - -​ -

       

      -
      1
      -
      2
      -
      3
      -
      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. -

      -​ - - - -``` - * @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(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 - * @example ​ ````Get the background color of a clicked div. -```html - - - - - css demo - - - - -​ -  -
      -
      -
      -
      -​ - - - -``` - * @example ​ ````Get the width, height, text color, and background color of a clicked div. -```html - - - - - css demo - - - - -​ -

       

      -
      1
      -
      2
      -
      3
      -
      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. -

      -​ - - - -``` - * @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. - * An array of one or more CSS properties. - * @see \`{@link https://api.jquery.com/css/ }\` - * @since 1.0 - * @example ​ ````Get the background color of a clicked div. -```html - - - - - css demo - - - - -​ -  -
      -
      -
      -
      -​ - - - -``` - * @example ​ ````Get the width, height, text color, and background color of a clicked div. -```html - - - - - css demo - - - - -​ -

       

      -
      1
      -
      2
      -
      3
      -
      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. -

      -​ - - - -``` - * @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(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 background color of a clicked div. -```html - - - - - css demo - - - - -​ -  -
      -
      -
      -
      -​ - - - -``` - * @example ​ ````Get the width, height, text color, and background color of a clicked div. -```html - - - - - css demo - - - - -​ -

       

      -
      1
      -
      2
      -
      3
      -
      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. -

      -​ - - - -``` - * @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(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 - -
      -​ - - - -``` - * @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, 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 - * @example ​ ````Store then retrieve a value from the div element. -```html - - - - - data demo - - - - -​ -
      - The values stored were - - and - -
      -​ - - - -``` - * @example ​ ````Get the data named "blah" stored at for an element. -```html - - - - - data demo - - - - -​ -
      A div
      - - - - -

      The "blah" value of this div is ?

      -​ - - - -``` - */ - 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 - * @example ​ ````Store then retrieve a value from the div element. -```html - - - - - data demo - - - - -​ -
      - The values stored were - - and - -
      -​ - - - -``` - * @example ​ ````Get the data named "blah" stored at for an element. -```html - - - - - data demo - - - - -​ -
      A div
      - - - - -

      The "blah" value of this div is ?

      -​ - - - -``` - */ - // `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 ​ ````Store then retrieve a value from the div element. -```html - - - - - data demo - - - - -​ -
      - The values stored were - - and - -
      -​ - - - -``` - * @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 - * @example ​ ````Store then retrieve a value from the div element. -```html - - - - - data demo - - - - -​ -
      - The values stored were - - and - -
      -​ - - - -``` - * @example ​ ````Get the data named "blah" stored at for an element. -```html - - - - - data demo - - - - -​ -
      A div
      - - - - -

      The "blah" value of this div is ?

      -​ - - - -``` - */ - 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 }\`. - * @example ​ ````To bind a "Hello World!" alert box to the dblclick event on every paragraph on the page: -```html - - - - - dblclick demo - - - -​​ - - - -``` - * @example ​ ````Double click to toggle background color. -```html - - - - - dblclick demo - - - - -​ -
      -Double click the block -​ - - - -``` - */ - 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 }\`. - * @example ​ ````To bind a "Hello World!" alert box to the dblclick event on every paragraph on the page: -```html - - - - - dblclick demo - - - -​​ - - - -``` - * @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 JQuery.on }\`. - * @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: -```html - - - - - delegate demo - - - -​​ - - - -``` - * @example ​ ````To cancel a default action and prevent it from bubbling up, return false: -```html - - - - - delegate demo - - - -​​ - - - -``` - * @example ​ ````To cancel only the default action by using the preventDefault method. -```html - - - - - delegate demo - - - -​​ - - - -``` - * @example ​ ````Can bind custom events too. -```html - - - - - delegate demo - - - - -​ -

      Has an attached custom event.

      - - -​ - - - -``` - */ - 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 }\`. - * @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: -```html - - - - - delegate demo - - - -​​ - - - -``` - * @example ​ ````To cancel a default action and prevent it from bubbling up, return false: -```html - - - - - delegate demo - - - -​​ - - - -``` - * @example ​ ````To cancel only the default action by using the preventDefault method. -```html - - - - - delegate demo - - - -​​ - - - -``` - * @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 JQuery.on }\`. - * @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: -```html - - - - - delegate demo - - - -​​ - - - -``` - * @example ​ ````To cancel a default action and prevent it from bubbling up, return false: -```html - - - - - delegate demo - - - -​​ - - - -``` - * @example ​ ````To cancel only the default action by using the preventDefault method. -```html - - - - - delegate demo - - - -​​ - - - -``` - * @example ​ ````Can bind custom events too. -```html - - - - - delegate demo - - - - -​ -

      Has an attached custom event.

      - - -​ - - - -``` - */ - 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 fn 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(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 - * @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 - * @example ​ ````Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds. -```html - - - - - fadeIn demo - - - - -​ -Click here... -
      -
      -
      -​ - - - -``` - * @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: 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 - * @example ​ ````Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds. -```html - - - - - fadeIn demo - - - - -​ -Click here... -
      -
      -
      -​ - - - -``` - * @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 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 - * @example ​ ````Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds. -```html - - - - - fadeIn demo - - - - -​ -Click here... -
      -
      -
      -​ - - - -``` - * @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_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 ​ ````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. -

      -​ - - - -``` - * @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. -

      -​ - - - -``` - * @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 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 - * @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. -

      -​ - - - -``` - * @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. -

      -​ - - - -``` - * @example ​ ````Fades out two divs, one with a "linear" easing and one with the default, "swing," easing. -```html - - - - - fadeOut demo - - - - -​ - - -​ -
      -​ -
      linear
      -
      swing
      -​ - - - -``` - */ - 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 - * @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. -

      -​ - - - -``` - * @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. -

      -​ - - - -``` - * @example ​ ````Fades out two divs, one with a "linear" easing and one with the default, "swing," easing. -```html - - - - - fadeOut demo - - - - -​ - - -​ -
      -​ -
      linear
      -
      swing
      -​ - - - -``` - */ - 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 - * @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, 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 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 - * @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 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 - * @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_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 - * @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". -```html - - - - - filter demo - - - -​​ - - - -``` - * @example ​ ````Select all divs and filter the selection with a jQuery object, keeping only the one with an id of "unique". -```html - - - - - filter demo - - - -​​ - - - -``` - */ - 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 - * @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: 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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @example ​ ````Fire focus. -```html - - - - - focus demo - - - - -​ -

      focus fire

      -

      focus fire

      -​ - - - -``` - * @example ​ ````To stop people from writing in text input boxes, try: -```html - - - - - focus demo - - - -​​ - - - -``` - * @example ​ ````To focus on a login input box with id 'login' on page startup, try: -```html - - - - - focus demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Fire focus. -```html - - - - - focus demo - - - - -​ -

      focus fire

      -

      focus fire

      -​ - - - -``` - * @example ​ ````To stop people from writing in text input boxes, try: -```html - - - - - focus demo - - - -​​ - - - -``` - * @example ​ ````To focus on a login input box with id 'login' on page startup, try: -```html - - - - - focus demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Watch for a focus to occur within the paragraphs on the page. -```html - - - - - focusin demo - - - - -​ -

      focusin fire

      -

      focusin fire

      -​ - - - -``` - */ - 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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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(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 }\`. - * @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

      -
      -​ - - - -``` - * @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(index: number): TElement; - /** - * Retrieve the elements matched by the jQuery object. - * - * @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

      -
      -​ - - - -``` - * @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 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 - * @example ​ ````Check if an element is inside another. -```html - - - - - has demo - - - - -​ -
      • Does the UL contain an LI?
      -​ - - - -``` - */ - 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 - * @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 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 - * @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 -

      -​ - - - -``` - * @example ​ ````To set the height of each div on click to 30px plus a color change. -```html - - - - - height demo - - - - -​ -
      -
      -
      -
      -
      -​ - - - -``` - */ - 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 - * @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 -

      -​ - - - -``` - * @example ​ ````To set the height of each div on click to 30px plus a color change. -```html - - - - - height demo - - - - -​ -
      -
      -
      -
      -
      -​ - - - -``` - */ - 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 - * @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?

      -​ - - - -``` - * @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: 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 - * @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?

      -​ - - - -``` - * @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 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 - * @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?

      -​ - - - -``` - * @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_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 - * @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: -```html - - - - - hover demo - - - -​​ - - - -``` - * @example ​ ````To unbind the above example use: -```html - - - - - hover demo - - - -​​ - - - -``` - * @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 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 - * @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. -

      -​ - - - -``` - * @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: 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. -

      -​ - - - -``` - * @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(): 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 - * @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(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 - * @example ​ ````Get the innerHeight of a paragraph. -```html - - - - - innerHeight demo - - - - -​ -

      Hello

      -

      -​ - - - -``` - * @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: 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

      -

      -​ - - - -``` - * @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(): 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 - * @example ​ ````Get the innerWidth of a paragraph. -```html - - - - - innerWidth demo - - - - -​ -

      Hello

      -

      -​ - - - -``` - * @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: 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

      -

      -​ - - - -``` - * @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(): 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 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 - * @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: 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 }\`. - * @example ​ ````Show the event object for the keydown handler when a key is pressed in the input. -```html - - - - - keydown demo - - - - -​ -
      -
      - - -
      -
      - - -​ - - - -``` - */ - 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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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(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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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(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 }\`. - * @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 ​ ````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. -```html - - - - - load demo - - - -​​ - - - -``` - * @example ​ ````pass arrays of data to the server. -```html - - - - - load demo - - - -​​ - - - -``` - * @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. -```html - - - - - load demo - - - -​​ - - - -``` - */ - 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 - * @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. -```html - - - - - load demo - - - -​​ - - - -``` - * @example ​ ````pass arrays of data to the server. -```html - - - - - load demo - - - -​​ - - - -``` - * @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. -```html - - - - - load demo - - - -​​ - - - -``` - */ - 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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @example ​ ````Show texts when mouseup and mousedown event triggering. -```html - - - - - mousedown demo - - - -​ -

          Press mouse and release here.

          -​ - - - -``` - */ - 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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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(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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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(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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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(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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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(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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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(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 }\`. - * @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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @example ​ ````Show texts when mouseup and mousedown event triggering. -```html - - - - - mouseup demo - - - -​ -

          Press mouse and release here.

          -​ - - - -``` - */ - 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 }\`. - * @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 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 - * @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?: 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 - * @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. -```html - - - - - not demo - - - -​​ - - - -``` - * @example ​ ````Removes the element with the ID "selected" from the set of all paragraphs. -```html - - - - - not demo - - - -​​ - - - -``` - * @example ​ ````Removes all elements that match "div p.selected" from the total set of all paragraphs. -```html - - - - - not demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Add and remove event handlers on the colored button. -```html - - - - - off demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````Remove all event handlers from all paragraphs: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Remove all delegated click handlers from all paragraphs: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Remove just one previously bound handler by passing it as the third argument: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Unbind all delegated event handlers by their namespace: -```html - - - - - off demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Add and remove event handlers on the colored button. -```html - - - - - off demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````Remove all event handlers from all paragraphs: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Remove all delegated click handlers from all paragraphs: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Remove just one previously bound handler by passing it as the third argument: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Unbind all delegated event handlers by their namespace: -```html - - - - - off demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Add and remove event handlers on the colored button. -```html - - - - - off demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````Remove all event handlers from all paragraphs: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Remove all delegated click handlers from all paragraphs: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Remove just one previously bound handler by passing it as the third argument: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Unbind all delegated event handlers by their namespace: -```html - - - - - off demo - - - -​​ - - - -``` - */ - 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 ​ ````Add and remove event handlers on the colored button. -```html - - - - - off demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````Remove all event handlers from all paragraphs: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Remove all delegated click handlers from all paragraphs: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Remove just one previously bound handler by passing it as the third argument: -```html - - - - - off demo - - - -​​ - - - -``` - * @example ​ ````Unbind all delegated event handlers by their namespace: -```html - - - - - off demo - - - -​​ - - - -``` - */ - 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 - * @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. -

          -
          -
          -​ - - - -``` - * @example ​ ````Set the offset of the second paragraph: -```html - - - - - offset demo - - - - -​ -

          Hello

          2nd Paragraph

          -​ - - - -``` - */ - 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 - * @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. -

          -
          -
          -​ - - - -``` - * @example ​ ````Set the offset of the second paragraph: -```html - - - - - offset demo - - - - -​ -

          Hello

          2nd Paragraph

          -​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 ​ ````Display a paragraph's text in an alert when it is clicked: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler, which is specified here by name: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a form submit action and prevent the event from bubbling up by returning false: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel only the default action by using .preventDefault(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Stop submit events from bubbling without preventing form submit, using .stopPropagation(). -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Pass data to the event handler using the second argument to .trigger() -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Use the the second argument of .trigger() to pass an array of data to the event handler -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach and trigger custom (non-browser) events. -```html - - - - - on demo - - - - -​ -

          Has an attached custom event.

          - - -​ - - - -``` - * @example ​ ````Attach multiple event handlers simultaneously using a plain object. -```html - - - - - on demo - - - - -​ -
          test div
          -​ - - - -``` - * @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: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Cancel a link's default action using the .preventDefault() method: -```html - - - - - on demo - - - -​​ - - - -``` - * @example ​ ````Attach multiple events—one on mouseenter and one on mouseleave to the same element: -```html - - - - - on demo - - - -​​ - - - -``` - */ - 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 - * @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: -```html - - - - - one demo - - - -​​ - - - -``` - * @example ​ ````Event handlers will trigger once per element per event type -```html - - - - - one demo - - - -​ -
          0
          -
          Hover/click me
          -​ - - - -``` - */ - 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 - * @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: -```html - - - - - one demo - - - -​​ - - - -``` - * @example ​ ````Event handlers will trigger once per element per event type -```html - - - - - one demo - - - -​ -
          0
          -
          Hover/click me
          -​ - - - -``` - */ - 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 - * @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: -```html - - - - - one demo - - - -​​ - - - -``` - * @example ​ ````Event handlers will trigger once per element per event type -```html - - - - - one demo - - - -​ -
          0
          -
          Hover/click me
          -​ - - - -``` - */ - 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: -```html - - - - - one demo - - - -​​ - - - -``` - * @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 - * @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: -```html - - - - - one demo - - - -​​ - - - -``` - * @example ​ ````Event handlers will trigger once per element per event type -```html - - - - - one demo - - - -​ -
          0
          -
          Hover/click me
          -​ - - - -``` - */ - 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 - * @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: -```html - - - - - one demo - - - -​​ - - - -``` - * @example ​ ````Event handlers will trigger once per element per event type -```html - - - - - one demo - - - -​ -
          0
          -
          Hover/click me
          -​ - - - -``` - */ - 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 - * @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: -```html - - - - - one demo - - - -​​ - - - -``` - * @example ​ ````Event handlers will trigger once per element per event type -```html - - - - - one demo - - - -​ -
          0
          -
          Hover/click me
          -​ - - - -``` - */ - 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 - * @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: -```html - - - - - one demo - - - -​​ - - - -``` - * @example ​ ````Event handlers will trigger once per element per event type -```html - - - - - one demo - - - -​ -
          0
          -
          Hover/click me
          -​ - - - -``` - */ - 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 - * @example ​ ````Get the outerHeight of a paragraph. -```html - - - - - outerHeight demo - - - - -​ -

          Hello

          -​ - - - -``` - * @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: 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 - * @example ​ ````Get the outerHeight of a paragraph. -```html - - - - - outerHeight demo - - - - -​ -

          Hello

          -​ - - - -``` - * @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(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 - * @example ​ ````Get the outerWidth of a paragraph. -```html - - - - - outerWidth demo - - - - -​ -

          Hello

          -​ - - - -``` - * @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: 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 - * @example ​ ````Get the outerWidth of a paragraph. -```html - - - - - outerWidth demo - - - - -​ -

          Hello

          -​ - - - -``` - * @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(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 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 - * @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?: 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 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 - * @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(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 - * @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 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 - * @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?: 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 - * @example ​ ````Using .promise() on a collection with no active animation returns a resolved Promise: -```html - - - - - promise demo - - - -​​ - - - -``` - * @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, 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 - * @example ​ ````Using .promise() on a collection with no active animation returns a resolved Promise: -```html - - - - - promise demo - - - -​​ - - - -``` - * @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(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: -```html - - - - - promise demo - - - -​​ - - - -``` - * @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 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 - * @example ​ ````Display the checked property and attribute of a checkbox as it changes. -```html - - - - - prop demo - - - - -​ - - -

          -​ - - - -``` - * @example ​ ````Disable all checkboxes on the page. -```html - - - - - prop demo - - - - -​ - - - - -​ - - - -``` - */ - 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 - * @example ​ ````Display the checked property and attribute of a checkbox as it changes. -```html - - - - - prop demo - - - - -​ - - -

          -​ - - - -``` - * @example ​ ````Disable all checkboxes on the page. -```html - - - - - prop demo - - - - -​ - - - - -​ - - - -``` - */ - 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 - * @example ​ ````Display the checked property and attribute of a checkbox as it changes. -```html - - - - - prop demo - - - - -​ - - -

          -​ - - - -``` - * @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 - - - - -​ - - -

          -​ - - - -``` - * @example ​ ````Disable all checkboxes on the page. -```html - - - - - prop demo - - - - -​ - - - - -​ - - - -``` - */ - 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 - * @example ​ ````Add some elements onto the jQuery stack, then pop back off again. -```html - - - - - pushStack demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - pushStack demo - - - -​​ - - - -``` - */ - 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 ​ ````Show the length of the queue. -```html - - - - - queue demo - - - - -​ -

          The queue length is:

          -
          -​ - - - -``` - * @example ​ ````Queue a custom function. -```html - - - - - queue demo - - - - -​ -Click here... -
          -​ - - - -``` - * @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 ​ ````Show the length of the queue. -```html - - - - - queue demo - - - - -​ -

          The queue length is:

          -
          -​ - - - -``` - * @example ​ ````Queue a custom function. -```html - - - - - queue demo - - - - -​ -Click here... -
          -​ - - - -``` - * @example ​ ````Set a queue array to delete the queue. -```html - - - - - queue demo - - - - -​ - - -
          -​ - - - -``` - */ - 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:

          -
          -​ - - - -``` - * @example ​ ````Queue a custom function. -```html - - - - - queue demo - - - - -​ -Click here... -
          -​ - - - -``` - * @example ​ ````Set a queue array to delete the queue. -```html - - - - - queue demo - - - - -​ - - -
          -​ - - - -``` - */ - 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 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 - * @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?: 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 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 - * @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: 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 }\`. - * @example ​ ````To see the window width while (or after) it is resized, try: -```html - - - - - resize demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````To see the window width while (or after) it is resized, try: -```html - - - - - resize demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````To do something when your page is scrolled: -```html - - - - - scroll demo - - - - -​ -
          Try scrolling the iframe.
          -

          Paragraph - Scroll happened!

          -​ - - - -``` - */ - 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 }\`. - * @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 ​ ````Get the scrollLeft of a paragraph. -```html - - - - - scrollLeft demo - - - - -​ -

          Hello

          -​ - - - -``` - * @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

          -​ - - - -``` - * @example ​ ````Set the scrollLeft of a div. -```html - - - - - scrollLeft demo - - - - -​ -

          lalala

          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 ​ ````Get the scrollTop of a paragraph. -```html - - - - - scrollTop demo - - - - -​ -

          Hello

          -​ - - - -``` - * @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

          -​ - - - -``` - * @example ​ ````Set the scrollTop of a div. -```html - - - - - scrollTop demo - - - - -​ -

          lalala

          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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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: -```html - - - - - select demo - - - -​​ - - - -``` - */ - 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 }\`. - * @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: -```html - - - - - select demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds. -```html - - - - - show demo - - - - -​ - -

          Hello 2

          -​ - - - -``` - * @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: 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 - * @example ​ ````Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds. -```html - - - - - show demo - - - - -​ - -

          Hello 2

          -​ - - - -``` - * @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 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 - * @example ​ ````Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds. -```html - - - - - show demo - - - - -​ - -

          Hello 2

          -​ - - - -``` - * @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_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. -```html - - - - - slice demo - - - -​​ - - - -``` - * @example ​ ````Selects all paragraphs, then slices the selection to include only the first and second element. -```html - - - - - slice demo - - - -​​ - - - -``` - * @example ​ ````Selects all paragraphs, then slices the selection to include only the second element. -```html - - - - - slice demo - - - -​​ - - - -``` - * @example ​ ````Selects all paragraphs, then slices the selection to include only the second and third element. -```html - - - - - slice demo - - - -​​ - - - -``` - * @example ​ ````Selects all paragraphs, then slices the selection to include only the third element. -```html - - - - - slice demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Animates all divs to slide down and show themselves over 600 milliseconds. -```html - - - - - slideDown demo - - - - -​ -Click me! -
          -
          -
          -​ - - - -``` - * @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: 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 - * @example ​ ````Animates all divs to slide down and show themselves over 600 milliseconds. -```html - - - - - slideDown demo - - - - -​ -Click me! -
          -
          -
          -​ - - - -``` - * @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 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 - * @example ​ ````Animates all divs to slide down and show themselves over 600 milliseconds. -```html - - - - - slideDown demo - - - - -​ -Click me! -
          -
          -
          -​ - - - -``` - * @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_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 - * @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! -

          -​ - - - -``` - * @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: 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 - * @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! -

          -​ - - - -``` - * @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 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 - * @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! -

          -​ - - - -``` - * @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_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 - * @example ​ ````Animates all divs to slide up, completing the animation within 400 milliseconds. -```html - - - - - slideUp demo - - - - -​ -Click me! -
          -
          -
          -
          -
          -​ - - - -``` - * @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: 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 - * @example ​ ````Animates all divs to slide up, completing the animation within 400 milliseconds. -```html - - - - - slideUp demo - - - - -​ -Click me! -
          -
          -
          -
          -
          -​ - - - -``` - * @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 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 - * @example ​ ````Animates all divs to slide up, completing the animation within 400 milliseconds. -```html - - - - - slideUp demo - - - - -​ -Click me! -
          -
          -
          -
          -
          -​ - - - -``` - * @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_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 - * @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(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 JQuery.on }\` or \`{@link JQuery.trigger }\`. - * @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: -```html - - - - - submit demo - - - -​​ - - - -``` - * @example ​ ````To trigger the submit event on the first form on the page, try: -```html - - - - - submit demo - - - -​​ - - - -``` - */ - 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 }\`. - * @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: -```html - - - - - submit demo - - - -​​ - - - -``` - * @example ​ ````To trigger the submit event on the first form on the page, try: -```html - - - - - submit demo - - - -​​ - - - -``` - */ - 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 - * @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.

          -

          -​ - - - -``` - * @example ​ ````Add text to the paragraph (notice the bold tag is escaped). -```html - - - - - text demo - - - - -​ -

          Test Paragraph.

          -​ - - - -``` - */ - 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 - * @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.

          -

          -​ - - - -``` - * @example ​ ````Add text to the paragraph (notice the bold tag is escaped). -```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 - * @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: 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 - * @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: 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 - * @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 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 - * @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: 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 }\`. - * @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(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 - * @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: -```html - - - - - trigger demo - - - -​​ - - - -``` - * @example ​ ````To submit the first form without using the submit() function, try: -```html - - - - - trigger demo - - - -​​ - - - -``` - * @example ​ ````To pass arbitrary data to an event: -```html - - - - - trigger demo - - - -​​ - - - -``` - * @example ​ ````To pass arbitrary data through an event object: -```html - - - - - trigger demo - - - -​​ - - - -``` - * @example ​ ````Alternative way to pass data through an event object: -```html - - - - - trigger demo - - - -​​ - - - -``` - */ - trigger(eventType: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number | boolean): 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 - * @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: string | JQuery.Event, extraParameters?: any[] | JQuery.PlainObject | string | number | boolean): 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 }\`. - * @example ​ ````Can bind and unbind events to the colored button. -```html - - - - - unbind demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````To unbind all events from all paragraphs, write: -```html - - - - - unbind demo - - - -​​ - - - -``` - * @example ​ ````To unbind all click events from all paragraphs, write: -```html - - - - - unbind demo - - - -​​ - - - -``` - * @example ​ ````To unbind just one previously bound handler, pass the function in as the second argument: -```html - - - - - unbind demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Can bind and unbind events to the colored button. -```html - - - - - unbind demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````To unbind all events from all paragraphs, write: -```html - - - - - unbind demo - - - -​​ - - - -``` - * @example ​ ````To unbind all click events from all paragraphs, write: -```html - - - - - unbind demo - - - -​​ - - - -``` - * @example ​ ````To unbind just one previously bound handler, pass the function in as the second argument: -```html - - - - - unbind demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Can bind and unbind events to the colored button. -```html - - - - - undelegate demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````To unbind all delegated events from all paragraphs, write: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To unbind all delegated click events from all paragraphs, write: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To undelegate just one previously bound handler, pass the function in as the third argument: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To unbind all delegated events by their namespace: -```html - - - - - undelegate demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Can bind and unbind events to the colored button. -```html - - - - - undelegate demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````To unbind all delegated events from all paragraphs, write: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To unbind all delegated click events from all paragraphs, write: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To undelegate just one previously bound handler, pass the function in as the third argument: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To unbind all delegated events by their namespace: -```html - - - - - undelegate demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Can bind and unbind events to the colored button. -```html - - - - - undelegate demo - - - - -​ - - - -
          Click!
          -​ - - - -``` - * @example ​ ````To unbind all delegated events from all paragraphs, write: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To unbind all delegated click events from all paragraphs, write: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To undelegate just one previously bound handler, pass the function in as the third argument: -```html - - - - - undelegate demo - - - -​​ - - - -``` - * @example ​ ````To unbind all delegated events by their namespace: -```html - - - - - undelegate demo - - - -​​ - - - -``` - */ - 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 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 - * @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 - - - - -​ - -

          -​ - - - -``` - * @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: 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 - - - - -​ - -

          -​ - - - -``` - * @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(): 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 - * @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 -

          -​ - - - -``` - * @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: 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 -

          -​ - - - -``` - * @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(): 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 - * @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: 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 - * @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: 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 - * @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: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery | Element)): this; - - [n: number]: TElement; -} - -// region ES5 compatibility -// #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." - * - * **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; - } - - // region Ajax - // #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 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: 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 - // #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; - }; - - // 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 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 - - // 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: -```html - - - - - callbacks.add demo - - - -​​ - - - -``` - */ - 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: -```html - - - - - callbacks.disable demo - - - -​​ - - - -``` - */ - 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: -```html - - - - - callbacks.disabled demo - - - -​​ - - - -``` - */ - 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: -```html - - - - - callbacks.empty demo - - - -​​ - - - -``` - */ - 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: -```html - - - - - callbacks.fire demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Use callbacks.fireWith() to fire a list of callbacks with a specific context and an array of arguments: -```html - - - - - callbacks.fireWith demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Use callbacks.fired() to determine if the callbacks in a list have been called at least once: -```html - - - - - callbacks.fired demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Use callbacks.has() to check if a callback list contains a specific callback: -```html - - - - - callbacks.has demo - - - -​​ - - - -``` - */ - 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: -```html - - - - - callbacks.lock demo - - - -​​ - - - -``` - * @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: -```html - - - - - callbacks.locked demo - - - -​​ - - - -``` - */ - 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: -```html - - - - - callbacks.remove demo - - - -​​ - - - -``` - */ - remove(...callbacks: T[]): this; - } - - // #endregion - - // region CSS - // #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 - // #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. -```html - - - - - deferred.always demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.done demo - - - -​​ - - - -``` - * @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. -```html - - - - - deferred.fail demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.promise demo - - - -​​ - - - -``` - * @example ​ ````Use the target argument to promote an existing object to a Promise: -```html - - - - - deferred.promise demo - - - -​​ - - - -``` - */ - promise(target: TTarget): this & 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. -```html - - - - - deferred.promise demo - - - -​​ - - - -``` - * @example ​ ````Use the target argument to promote an existing object to a Promise: -```html - - - - - deferred.promise demo - - - -​​ - - - -``` - */ - 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 JQuery.PromiseBase.then }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.catch demo - - - -​​ - - - -``` - */ - 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; - (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. -```html - - - - - deferred.always demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.done demo - - - -​​ - - - -``` - * @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. -```html - - - - - deferred.fail demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.promise demo - - - -​​ - - - -``` - * @example ​ ````Use the target argument to promote an existing object to a Promise: -```html - - - - - deferred.promise demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.promise demo - - - -​​ - - - -``` - * @example ​ ````Use the target argument to promote an existing object to a Promise: -```html - - - - - deferred.promise demo - - - -​​ - - - -``` - */ - 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 JQuery.Deferred.then }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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 }\`. - * @example ​ ````Filter resolve value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.pipe demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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 ​ ````Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Filter the resolve value: -```html - - - - - deferred.then demo - - - -​ - -

          -​ - - - -``` - * @example ​ ````Filter reject value: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - * @example ​ ````Chain tasks: -```html - - - - - deferred.then demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - deferred.catch demo - - - -​​ - - - -``` - */ - 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 - // #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 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 { - /** - * 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; - /** - * 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 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; - /** - * 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. -```html - - - - - event.type demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - event.isDefaultPrevented demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - event.stopPropagation demo - - - -​​ - - - -``` - */ - 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 - * @example ​ ````Alert that currentTarget matches the `this` keyword. -```html - - - - - event.currentTarget demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - event.delegateTarget demo - - - -​​ - - - -``` - */ - 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. -```html - - - - - event.relatedTarget demo - - - -​​ - - - -``` - */ - 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> { } - - 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 -// #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 4d7c10b153..0acf6e0d24 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()); @@ -75,6 +160,9 @@ function JQueryStatic() { // $ExpectType JQuery $([new HTMLSelectElement()]); + // $ExpectType JQuery + $(document.querySelectorAll('p')); + // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19597#issuecomment-378218432 function issue_19597_378218432() { const myDiv = $(document.createElement('div')); @@ -111,123 +199,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 +296,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()); @@ -336,21 +314,23 @@ function JQueryStatic() { } function data() { + const element: Element | Document | Window | JQuery.PlainObject = {} as any; + const value: string | undefined = {} as any; // $ExpectError - $.data(new HTMLElement(), 'myKey', value); + $.data(element, 'myKey', value); // $ExpectType "myValue" - $.data(new HTMLElement(), 'myKey', 'myValue'); + $.data(element, 'myKey', 'myValue'); // $ExpectType any - $.data(new HTMLElement(), 'myKey', undefined); + $.data(element, 'myKey', undefined); // $ExpectType any - $.data(new HTMLElement(), 'myKey'); + $.data(element, 'myKey'); // $ExpectType any - $.data(new HTMLElement()); + $.data(element); } function dequeue() { @@ -486,6 +466,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); @@ -507,6 +490,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); } @@ -628,6 +614,11 @@ function JQueryStatic() { // $ExpectType jqXHR jqXHR; }); + + // $ExpectType jqXHR + $.getScript({ + url: 'url', + }); } function globalEval() { @@ -658,8 +649,10 @@ function JQueryStatic() { } function hasData() { + const element: Element | Document | Window | JQuery.PlainObject = {} as any; + // $ExpectType boolean - $.hasData(new HTMLElement()); + $.hasData(element); } function holdReady() { @@ -903,6 +896,13 @@ function JQueryStatic() { $.noConflict(); } + function nodeName() { + const node: Node = undefined!; + + // $ExpectType boolean + $.nodeName(node, 'name'); + } + function noop() { // $ExpectType undefined $.noop(); @@ -1042,23 +1042,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; @@ -1067,9 +1069,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); @@ -1095,203 +1096,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); @@ -1317,428 +1318,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'); } @@ -1773,11 +1993,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() { @@ -1815,6 +2037,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(); } @@ -1840,15 +2066,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; @@ -1998,22 +2224,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 @@ -2026,11 +2252,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 @@ -2042,9 +2268,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 }); @@ -2052,18 +2278,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 @@ -2080,8 +2306,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 @@ -2096,7 +2322,7 @@ function JQueryStatic() { const w = $.when(t1); w.then(a => { - a; // $ExpectType I1 + a; // $ExpectType J1 }, a => { a; // $ExpectType any }, a => { @@ -2207,7 +2433,7 @@ function JQuery() { $(document).ajaxComplete(function(event, jqXHR, ajaxOptions) { // $ExpectType Document this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; // $ExpectType jqXHR jqXHR; @@ -2223,7 +2449,7 @@ function JQuery() { $(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) { // $ExpectType Document this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; // $ExpectType jqXHR jqXHR; @@ -2241,7 +2467,7 @@ function JQuery() { $(document).ajaxSend(function(event, jqXHR, ajaxOptions) { // $ExpectType Document this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; // $ExpectType jqXHR jqXHR; @@ -2277,7 +2503,7 @@ function JQuery() { $(document).ajaxSuccess(function(event, jqXHR, ajaxOptions, data) { // $ExpectType Document this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; // $ExpectType jqXHR jqXHR; @@ -2621,12 +2847,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 @@ -2729,12 +2972,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 @@ -3626,21 +3886,11 @@ function JQuery() { function events() { // [bind() overloads] https://github.com/jquery/api.jquery.com/issues/1048 function bind() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').bind('myEvent', 'myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').bind('myEvent', 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); @@ -3648,77 +3898,51 @@ function JQuery() { $('p').bind('myEvent', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').bind('myEvent', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); // $ExpectType JQuery $('p').bind('myEvent', false); + // $ExpectType JQuery + $('p').bind('myEvent', null); + + // $ExpectType JQuery + $('p').bind('myEvent', undefined); + // $ExpectType JQuery $('p').bind({ myEvent1: false, myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }); - - // $ExpectType JQuery - $('p').bind('myEvent', null); - - // $ExpectType JQuery - $('p').bind('myEvent', undefined); - } + } function delegate() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('table').delegate('td', 'myEvent', 'myData', function(event) { - // $ExpectType HTMLElement + // $ExpectType any this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').delegate('td', 'myEvent', 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); // $ExpectType JQuery $('table').delegate('td', 'myEvent', function(event) { - // $ExpectType HTMLElement + // $ExpectType any this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').delegate('td', 'myEvent', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); @@ -3727,44 +3951,37 @@ function JQuery() { // $ExpectType JQuery $('table').delegate('td', { - myEvent1(event) { - // $ExpectType HTMLElement + myEvent1: false, + myEvent2(event) { + // $ExpectType any this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent2: false, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType any this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }); } function off() { - function defaultContext_defaultData(this: HTMLElement, event: JQuery.Event) { } + function defaultData(this: HTMLElement, event: JQuery.TriggeredEvent) { } - function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } + function customData(this: HTMLElement, event: JQuery.TriggeredEvent) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } - - function customContext_customData(this: I1, event: JQuery.Event) { } - - interface I1 { kind: 'I1'; } + function specificEventType(this: HTMLElement, event: JQuery.MouseDownEvent) { } // $ExpectType JQuery - $('table').off('myEvent', 'td', defaultContext_defaultData); + $('table').off('myEvent', 'td', defaultData); // $ExpectType JQuery - $('table').off('myEvent', 'td', defaultContext_customData); + $('table').off('myEvent', 'td', customData); // $ExpectType JQuery - $('table').off('myEvent', 'td', customContext_defaultData); - - // $ExpectType JQuery - $('table').off('myEvent', 'td', customContext_customData); + $('table').off('mousedown', 'td', specificEventType); // $ExpectType JQuery $('table').off('myEvent', 'td', false); @@ -3773,16 +3990,13 @@ function JQuery() { $('table').off('myEvent', 'td'); // $ExpectType JQuery - $('table').off('myEvent', defaultContext_defaultData); + $('table').off('myEvent', defaultData); // $ExpectType JQuery - $('table').off('myEvent', defaultContext_customData); + $('table').off('myEvent', customData); // $ExpectType JQuery - $('table').off('myEvent', customContext_defaultData); - - // $ExpectType JQuery - $('table').off('myEvent', customContext_customData); + $('table').off('mousedown', specificEventType); // $ExpectType JQuery $('table').off('myEvent', false); @@ -3793,52 +4007,30 @@ function JQuery() { // $ExpectType JQuery $('table').off({ myEvent1: false, - defaultContext_defaultData, - defaultContext_customData, - customContext_defaultData, - customContext_customData + defaultData, + customData }, 'td'); // $ExpectType JQuery $('table').off({ myEvent1: false, - defaultContext_defaultData, - defaultContext_customData, - customContext_defaultData, - customContext_customData + defaultData, + customData }); + const ev: JQuery.TriggeredEvent = undefined!; // $ExpectType JQuery - $('table').off($.Event('myEvent')); + $('table').off(ev); // $ExpectType JQuery $('table').off(); } function on() { - interface I1 { kind: 'I1'; } - - // $ExpectType JQuery $('table').on('myEvent', 'td', 'myData', function(event) { - // $ExpectType HTMLElement + // $ExpectType any this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').on('myEvent', 'td', 'myData', function(event: JQueryEventObject) { - // $ExpectType HTMLElement - this; - // $ExpectType JQueryEventObject - event; - }); - - // $ExpectType JQuery - $('table').on('myEvent', 'td', 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); @@ -3846,12 +4038,29 @@ function JQuery() { $('table').on('myEvent', null, 'myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent + event; + }); + + // $ExpectType JQuery + $('table').on('myEvent', undefined, 'myData', function(event) { + // $ExpectType HTMLElement + this; + // $ExpectType TriggeredEvent + event; + }); + + // $ExpectType JQuery + $('table').on('myEvent', 'td', 'myData', function(event: JQueryEventObject) { + // $ExpectType any + this; + // $ExpectType JQueryEventObject event; }); // $ExpectType JQuery $('table').on('myEvent', null, 'myData', function(event: JQueryEventObject) { + // TODO: Why is this HTMLElement? The callback signature doesn't even have `this` declared. // $ExpectType HTMLElement this; // $ExpectType JQueryEventObject @@ -3859,34 +4068,19 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', null, 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', undefined, 'myData', function(event: JQueryEventObject) { + // TODO: Why is this HTMLElement? The callback signature doesn't even have `this` declared. + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType JQueryEventObject event; }); // $ExpectType JQuery $('table').on('myEvent', 'td', function(event) { - // $ExpectType HTMLElement + // $ExpectType any this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').on('myEvent', 'td', function(event: JQueryEventObject) { - // $ExpectType HTMLElement - this; - // $ExpectType JQueryEventObject - event; - }); - - // $ExpectType JQuery - $('table').on('myEvent', 'td', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); @@ -3897,7 +4091,15 @@ function JQuery() { $('table').on('myEvent', 3, function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent + event; + }); + + // $ExpectType JQuery + $('table').on('myEvent', 'td', function(event: JQueryEventObject) { + // $ExpectType any + this; + // $ExpectType JQueryEventObject event; }); @@ -3910,20 +4112,15 @@ function JQuery() { }); // $ExpectType JQuery - $('table').on('myEvent', 3, function(this: I1, event) { - // $ExpectType I1 + $('table').on('myEvent', function(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); // $ExpectType JQuery - $('table').on('myEvent', function(event) { - // $ExpectType HTMLElement - this; - // $ExpectType Event - event; - }); + $('table').on('myEvent', false); // $ExpectType JQuery $('table').on('myEvent', function(event: JQueryEventObject) { @@ -3957,30 +4154,19 @@ function JQuery() { event; }); - // $ExpectType JQuery - $('table').on('myEvent', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').on('myEvent', false); - // $ExpectType JQuery $('table').on({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // $ExpectType any this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType any this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }, 'td', 'myData'); @@ -3991,13 +4177,13 @@ function JQuery() { myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }, null, 'myData'); @@ -4008,13 +4194,30 @@ function JQuery() { myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent + event; + } + }, undefined, 'myData'); + + // $ExpectType JQuery + $('table').on({ + myEvent1: false, + myEvent2(event) { + // $ExpectType any + this; + // $ExpectType TriggeredEvent + event; + }, + click(event) { + // $ExpectType any + this; + // $ExpectType ClickEvent event; } }, 'td'); @@ -4025,13 +4228,13 @@ function JQuery() { myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }, 3); @@ -4042,34 +4245,37 @@ function JQuery() { myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }); + + // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31124 + function issue_31124(el: Element, mouseX: number) { + $(el) + .on("mousedown touchstart", (evt) => { + // tslint:disable-next-line:prefer-conditional-expression + if (evt.type === "mousedown") { + mouseX = (evt.originalEvent as MouseEvent).clientX; + } else { + mouseX = (evt.originalEvent as TouchEvent).touches[0].clientX; + } + }); + } } function one() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('table').one('myEvent', 'td', 'myData', function(event) { - // $ExpectType HTMLElement + // $ExpectType any this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').one('myEvent', 'td', 'myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); @@ -4077,31 +4283,23 @@ function JQuery() { $('table').one('myEvent', null, 'myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); // $ExpectType JQuery - $('table').one('myEvent', null, 'myData', function(this: I1, event) { - // $ExpectType I1 + $('table').one('myEvent', undefined, 'myData', function(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); // $ExpectType JQuery $('table').one('myEvent', 'td', function(event) { - // $ExpectType HTMLElement + // $ExpectType any this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').one('myEvent', 'td', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); @@ -4112,15 +4310,7 @@ function JQuery() { $('table').one('myEvent', 3, function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').one('myEvent', 3, function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); @@ -4128,15 +4318,7 @@ function JQuery() { $('table').one('myEvent', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('table').one('myEvent', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }); @@ -4147,15 +4329,15 @@ function JQuery() { $('table').one({ myEvent1: false, myEvent2(event) { - // $ExpectType HTMLElement + // $ExpectType any this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType any this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }, 'td', 'myData'); @@ -4166,13 +4348,13 @@ function JQuery() { myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }, null, 'myData'); @@ -4183,13 +4365,30 @@ function JQuery() { myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent + event; + } + }, undefined, 'myData'); + + // $ExpectType JQuery + $('table').one({ + myEvent1: false, + myEvent2(event) { + // $ExpectType any + this; + // $ExpectType TriggeredEvent + event; + }, + click(event) { + // $ExpectType any + this; + // $ExpectType ClickEvent event; } }, 'td'); @@ -4200,13 +4399,13 @@ function JQuery() { myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }, 3); @@ -4217,13 +4416,13 @@ function JQuery() { myEvent2(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType TriggeredEvent event; }, - myEvent3(this: I1, event) { - // $ExpectType I1 + click(event) { + // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType ClickEvent event; } }); @@ -4294,27 +4493,20 @@ function JQuery() { } function unbind() { - function defaultContext_defaultData(this: HTMLElement, event: JQuery.Event) { } + function defaultData(this: HTMLElement, event: JQuery.TriggeredEvent) { } - function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } + function customData(this: HTMLElement, event: JQuery.TriggeredEvent) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } - - function customContext_customData(this: I1, event: JQuery.Event) { } - - interface I1 { kind: 'I1'; } + function specificEventType(this: HTMLElement, event: JQuery.MouseDownEvent) { } // $ExpectType JQuery - $('p').unbind('myEvent', defaultContext_defaultData); + $('p').unbind('myEvent', defaultData); // $ExpectType JQuery - $('p').unbind('myEvent', defaultContext_customData); + $('p').unbind('myEvent', customData); // $ExpectType JQuery - $('p').unbind('myEvent', customContext_defaultData); - - // $ExpectType JQuery - $('p').unbind('myEvent', customContext_customData); + $('p').unbind('mousedown', specificEventType); // $ExpectType JQuery $('p').unbind('myEvent', false); @@ -4322,35 +4514,29 @@ function JQuery() { // $ExpectType JQuery $('p').unbind('myEvent'); + const ev: JQuery.TriggeredEvent = undefined!; // $ExpectType JQuery - $('p').unbind($.Event('myEvent')); + $('p').unbind(ev); // $ExpectType JQuery $('p').unbind(); } function undelegate() { - function defaultContext_defaultData(this: HTMLElement, event: JQuery.Event) { } + function defaultData(this: HTMLElement, event: JQuery.TriggeredEvent) { } - function defaultContext_customData(this: HTMLElement, event: JQuery.Event) { } + function customData(this: HTMLElement, event: JQuery.TriggeredEvent) { } - function customContext_defaultData(this: I1, event: JQuery.Event) { } - - function customContext_customData(this: I1, event: JQuery.Event) { } - - interface I1 { kind: 'I1'; } + function specificEventType(this: HTMLElement, event: JQuery.MouseDownEvent) { } // $ExpectType JQuery - $('table').undelegate('td', 'click', defaultContext_defaultData); + $('table').undelegate('td', 'click', defaultData); // $ExpectType JQuery - $('table').undelegate('td', 'click', defaultContext_customData); + $('table').undelegate('td', 'click', customData); // $ExpectType JQuery - $('table').undelegate('td', 'click', customContext_defaultData); - - // $ExpectType JQuery - $('table').undelegate('td', 'click', customContext_customData); + $('table').undelegate('td', 'mousedown', specificEventType); // $ExpectType JQuery $('table').undelegate('td', 'click', false); @@ -4361,10 +4547,8 @@ function JQuery() { // $ExpectType JQuery $('table').undelegate('td', { myEvent1: false, - defaultContext_defaultData, - defaultContext_customData, - customContext_defaultData, - customContext_customData + defaultData, + customData }); // $ExpectType JQuery @@ -4375,21 +4559,11 @@ function JQuery() { } function blur() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').blur('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').blur('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType BlurEvent event; }); @@ -4397,15 +4571,7 @@ function JQuery() { $('p').blur(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').blur(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType BlurEvent event; }); @@ -4417,21 +4583,11 @@ function JQuery() { } function change() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').change('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').change('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ChangeEvent event; }); @@ -4439,15 +4595,7 @@ function JQuery() { $('p').change(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').change(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ChangeEvent event; }); @@ -4459,21 +4607,11 @@ function JQuery() { } function click() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').click('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').click('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ClickEvent event; }); @@ -4481,15 +4619,7 @@ function JQuery() { $('p').click(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').click(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ClickEvent event; }); @@ -4501,21 +4631,11 @@ function JQuery() { } function contextmenu() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').contextmenu('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').contextmenu('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ContextMenuEvent event; }); @@ -4523,15 +4643,7 @@ function JQuery() { $('p').contextmenu(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').contextmenu(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ContextMenuEvent event; }); @@ -4543,21 +4655,11 @@ function JQuery() { } function dblclick() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').dblclick('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').dblclick('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType DoubleClickEvent event; }); @@ -4565,15 +4667,7 @@ function JQuery() { $('p').dblclick(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').dblclick(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType DoubleClickEvent event; }); @@ -4585,21 +4679,11 @@ function JQuery() { } function focus() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').focus('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').focus('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType FocusEvent event; }); @@ -4607,15 +4691,7 @@ function JQuery() { $('p').focus(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').focus(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType FocusEvent event; }); @@ -4627,21 +4703,11 @@ function JQuery() { } function focusin() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').focusin('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').focusin('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType FocusInEvent event; }); @@ -4649,15 +4715,7 @@ function JQuery() { $('p').focusin(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').focusin(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType FocusInEvent event; }); @@ -4669,21 +4727,11 @@ function JQuery() { } function focusout() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').focusout('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').focusout('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType FocusOutEvent event; }); @@ -4691,15 +4739,7 @@ function JQuery() { $('p').focusout(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').focusout(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType FocusOutEvent event; }); @@ -4711,21 +4751,11 @@ function JQuery() { } function keydown() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').keydown('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').keydown('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType KeyDownEvent event; }); @@ -4733,15 +4763,7 @@ function JQuery() { $('p').keydown(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').keydown(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType KeyDownEvent event; }); @@ -4753,21 +4775,11 @@ function JQuery() { } function keypress() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').keypress('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').keypress('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType KeyPressEvent event; }); @@ -4775,15 +4787,7 @@ function JQuery() { $('p').keypress(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').keypress(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType KeyPressEvent event; }); @@ -4795,21 +4799,11 @@ function JQuery() { } function keyup() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').keyup('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').keyup('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType KeyUpEvent event; }); @@ -4817,15 +4811,7 @@ function JQuery() { $('p').keyup(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').keyup(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType KeyUpEvent event; }); @@ -4837,21 +4823,11 @@ function JQuery() { } function mousedown() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').mousedown('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mousedown('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseDownEvent event; }); @@ -4859,15 +4835,7 @@ function JQuery() { $('p').mousedown(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mousedown(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseDownEvent event; }); @@ -4879,21 +4847,11 @@ function JQuery() { } function mouseenter() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').mouseenter('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseenter('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseEnterEvent event; }); @@ -4901,15 +4859,7 @@ function JQuery() { $('p').mouseenter(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseenter(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseEnterEvent event; }); @@ -4921,21 +4871,11 @@ function JQuery() { } function mouseleave() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').mouseleave('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseleave('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseLeaveEvent event; }); @@ -4943,15 +4883,7 @@ function JQuery() { $('p').mouseleave(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseleave(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseLeaveEvent event; }); @@ -4963,21 +4895,11 @@ function JQuery() { } function mousemove() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').mousemove('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mousemove('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseMoveEvent event; }); @@ -4985,15 +4907,7 @@ function JQuery() { $('p').mousemove(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mousemove(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseMoveEvent event; }); @@ -5005,21 +4919,11 @@ function JQuery() { } function mouseout() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').mouseout('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseout('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseOutEvent event; }); @@ -5027,15 +4931,7 @@ function JQuery() { $('p').mouseout(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseout(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseOutEvent event; }); @@ -5047,21 +4943,11 @@ function JQuery() { } function mouseover() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').mouseover('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseover('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseOverEvent event; }); @@ -5069,15 +4955,7 @@ function JQuery() { $('p').mouseover(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseover(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseOverEvent event; }); @@ -5089,21 +4967,11 @@ function JQuery() { } function mouseup() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').mouseup('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseup('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseUpEvent event; }); @@ -5111,15 +4979,7 @@ function JQuery() { $('p').mouseup(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').mouseup(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseUpEvent event; }); @@ -5131,21 +4991,11 @@ function JQuery() { } function resize() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').resize('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').resize('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ResizeEvent event; }); @@ -5153,15 +5003,7 @@ function JQuery() { $('p').resize(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').resize(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ResizeEvent event; }); @@ -5173,21 +5015,11 @@ function JQuery() { } function scroll() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').scroll('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').scroll('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ScrollEvent event; }); @@ -5195,15 +5027,7 @@ function JQuery() { $('p').scroll(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').scroll(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType ScrollEvent event; }); @@ -5215,21 +5039,11 @@ function JQuery() { } function select() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').select('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').select('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType SelectEvent event; }); @@ -5237,15 +5051,7 @@ function JQuery() { $('p').select(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').select(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType SelectEvent event; }); @@ -5257,21 +5063,11 @@ function JQuery() { } function submit() { - interface I1 { kind: 'I1'; } - // $ExpectType JQuery $('p').submit('myData', function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').submit('myData', function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType SubmitEvent event; }); @@ -5279,15 +5075,7 @@ function JQuery() { $('p').submit(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').submit(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType SubmitEvent event; }); @@ -5299,32 +5087,16 @@ function JQuery() { } function hover() { - interface I1 { kind: 'I1'; } - interface I2 { kind: 'I2'; } - // $ExpectType JQuery $('p').hover(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType MouseEnterEvent event; }, function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event - event; - }, function(event) { - // $ExpectType HTMLElement - this; - // $ExpectType Event + // $ExpectType MouseLeaveEvent event; }); @@ -5332,41 +5104,7 @@ function JQuery() { $('p').hover(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }, function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event - event; - }, function(this: I2, event) { - // $ExpectType I2 - this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').hover(function(event) { - // $ExpectType HTMLElement - this; - // $ExpectType Event - event; - }, false); - - // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseEnterEvent event; }, false); @@ -5374,15 +5112,7 @@ function JQuery() { $('p').hover(false, function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event - event; - }); - - // $ExpectType JQuery - $('p').hover(false, function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event + // $ExpectType MouseLeaveEvent event; }); @@ -5393,16 +5123,23 @@ function JQuery() { $('p').hover(function(event) { // $ExpectType HTMLElement this; - // $ExpectType Event + // $ExpectType MouseEnterEvent | MouseLeaveEvent event; - }); - // $ExpectType JQuery - $('p').hover(function(this: I1, event) { - // $ExpectType I1 - this; - // $ExpectType Event - event; + switch (event.type) { + case 'mouseover': + // $ExpectType MouseEnterEvent + event; + break; + case 'mouseout': + // $ExpectType MouseLeaveEvent + event; + break; + default: + // $ExpectType never + event; + break; + } }); // $ExpectType JQuery @@ -5828,11 +5565,21 @@ function JQuery() { $('p').replaceWith([new HTMLElement()]); // $ExpectType JQuery - $('p').replaceWith(function() { + $('p').replaceWith(document.createTextNode('bar')); + + // $ExpectType JQuery + $('p').replaceWith(document.createComment('bar')); + + // $ExpectType JQuery + $('p').replaceWith(function(index, oldhtml) { // $ExpectType HTMLElement this; + // $ExpectType number + index; + // $ExpectType string + oldhtml; - return this; + return undefined! as JQuery.htmlString | JQuery | JQuery.TypeOrArray | JQuery.Node; }); } @@ -5956,6 +5703,12 @@ function JQuery() { // $ExpectType JQuery $('p').html(''); + // $ExpectType JQuery + $('p').html(document.createTextNode('bar')); + + // $ExpectType JQuery + $('p').html(document.createComment('bar')); + // $ExpectType JQuery $('p').html(function(index, oldhtml) { // $ExpectType HTMLElement @@ -5965,7 +5718,12 @@ function JQuery() { // $ExpectType string oldhtml; - return oldhtml; + switch (index) { + case 0: return document.createTextNode('bar'); + case 1: return document.createComment('bar'); + + default: return oldhtml; + } }); // $ExpectType string @@ -6068,6 +5826,12 @@ function JQuery() { // $ExpectType JQuery $('p').add($('span')); + + // $ExpectType JQuery + $('p').add(document.createTextNode('bar')); + + // $ExpectType JQuery + $('p').add(document.createComment('bar')); } function closest() { @@ -6553,6 +6317,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: { @@ -6719,172 +6502,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; @@ -7153,26 +6770,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) => { @@ -7182,7 +6931,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 @@ -7192,7 +6941,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 @@ -7222,7 +6971,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) => { @@ -7232,19 +6981,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) => { @@ -7287,7 +7036,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 @@ -7317,7 +7066,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 @@ -7354,7 +7103,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType I1 | I2 + a; // $ExpectType J1 | J2 }, (a) => { a; // $ExpectType never }, (a, b, c) => { @@ -7373,17 +7122,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 }); } @@ -7396,7 +7145,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType number | I1 + a; // $ExpectType number | J1 }, (a) => { a; // never }, (a, b, c) => { @@ -7415,7 +7164,7 @@ function JQuery_Promise3() { }); q.then((a) => { - a; // $ExpectType number | I1 + a; // $ExpectType number | J1 }, (a) => { a; // never }, (a, b, c) => { @@ -7434,17 +7183,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 }); } @@ -7457,17 +7206,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 }); } @@ -7480,17 +7229,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 }); } @@ -7503,17 +7252,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 }); } } @@ -7532,9 +7281,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(() => { @@ -7839,18 +7588,609 @@ 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()); + } + + function constructor() { + // $ExpectType Event & Coordinates + new $.Event('keydown', $('p').offset()); + } + + // 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_TypeEventHandlers() { + const events: JQuery.TypeEventHandlers = { + change(event) { + // $ExpectType HTMLElement + this; + // $ExpectType ChangeEvent + event; + }, + resize(event) { + // $ExpectType HTMLElement + this; + // $ExpectType ResizeEvent + event; + }, + scroll(event) { + // $ExpectType HTMLElement + this; + // $ExpectType ScrollEvent + event; + }, + select(event) { + // $ExpectType HTMLElement + this; + // $ExpectType SelectEvent + event; + }, + submit(event) { + // $ExpectType HTMLElement + this; + // $ExpectType SubmitEvent + event; + }, + click(event) { + // $ExpectType HTMLElement + this; + // $ExpectType ClickEvent + event; + }, + contextmenu(event) { + // $ExpectType HTMLElement + this; + // $ExpectType ContextMenuEvent + event; + }, + dblclick(event) { + // $ExpectType HTMLElement + this; + // $ExpectType DoubleClickEvent + event; + }, + mousedown(event) { + // $ExpectType HTMLElement + this; + // $ExpectType MouseDownEvent + event; + }, + mouseenter(event) { + // $ExpectType HTMLElement + this; + // $ExpectType MouseEnterEvent + event; + }, + mouseleave(event) { + // $ExpectType HTMLElement + this; + // $ExpectType MouseLeaveEvent + event; + }, + mousemove(event) { + // $ExpectType HTMLElement + this; + // $ExpectType MouseMoveEvent + event; + }, + mouseout(event) { + // $ExpectType HTMLElement + this; + // $ExpectType MouseOutEvent + event; + }, + mouseover(event) { + // $ExpectType HTMLElement + this; + // $ExpectType MouseOverEvent + event; + }, + mouseup(event) { + // $ExpectType HTMLElement + this; + // $ExpectType MouseUpEvent + event; + }, + keydown(event) { + // $ExpectType HTMLElement + this; + // $ExpectType KeyDownEvent + event; + }, + keypress(event) { + // $ExpectType HTMLElement + this; + // $ExpectType KeyPressEvent + event; + }, + keyup(event) { + // $ExpectType HTMLElement + this; + // $ExpectType KeyUpEvent + event; + }, + touchcancel(event) { + // $ExpectType HTMLElement + this; + // $ExpectType TouchCancelEvent + event; + }, + touchend(event) { + // $ExpectType HTMLElement + this; + // $ExpectType TouchEndEvent + event; + }, + touchmove(event) { + // $ExpectType HTMLElement + this; + // $ExpectType TouchMoveEvent + event; + }, + touchstart(event) { + // $ExpectType HTMLElement + this; + // $ExpectType TouchStartEvent + event; + }, + blur(event) { + // $ExpectType HTMLElement + this; + // $ExpectType BlurEvent + event; + }, + focus(event) { + // $ExpectType HTMLElement + this; + // $ExpectType FocusEvent + event; + }, + focusin(event) { + // $ExpectType HTMLElement + this; + // $ExpectType FocusInEvent + event; + }, + focusout(event) { + // $ExpectType HTMLElement + this; + // $ExpectType FocusOutEvent + event; + } + }; +} + +function JQuery_EventExtensions() { + 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 EventHandlerBase> + 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 TriggeredEvent + event; + // $ExpectType any + data; + + return false; + }, + handle(event, data) { + // $ExpectType TriggeredEvent & { 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..08c8a408f3 --- /dev/null +++ b/types/jquery/legacy.d.ts @@ -0,0 +1,204 @@ +// 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 { + /** @deprecated */ + char: string; + /** @deprecated */ + charCode: number; + key: string; + /** @deprecated */ + 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..ebba2f7a31 --- /dev/null +++ b/types/jquery/misc.d.ts @@ -0,0 +1,6562 @@ +// 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. + + /** + * jQuery's event system normalizes the event object according to W3C standards. The event object is guaranteed to be passed to the event handler (no checks for window.event required). It normalizes the target, relatedTarget, which, metaKey and pageX/Y properties and provides both stopPropagation() and preventDefault() methods. + * + * Those properties are all documented, and accompanied by examples, on the \`{@link http://api.jquery.com/category/events/event-object/ Event object}\` page. + * + * The standard events in the Document Object Model are: `blur`, `focus`, `load`, `resize`, `scroll`, `unload`, `beforeunload`, `click`, `dblclick`, `mousedown`, `mouseup`, `mousemove`, `mouseover`, `mouseout`, `mouseenter`, `mouseleave`, `change`, `select`, `submit`, `keydown`, `keypress`, and `keyup`. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any. + * @see \`{@link https://api.jquery.com/category/events/event-object/ }\` + */ + interface EventStatic { + /** + * The jQuery.Event constructor is exposed and can be used when calling trigger. The new operator is optional. + * + * Check \`{@link https://api.jquery.com/trigger/ trigger}\`'s documentation to see how to combine it with your own event object. + * @see \`{@link https://api.jquery.com/category/events/event-object/ }\` + * @since 1.6 + * @example +```javascript +//Create a new jQuery.Event object without the "new" operator. +var e = jQuery.Event( "click" ); +​ +// trigger an artificial click event +jQuery( "body" ).trigger( e ); +``` + * @example +```javascript +// Create a new jQuery.Event object with specified event properties. +var e = jQuery.Event( "keydown", { keyCode: 64 } ); +​ +// trigger an artificial keydown event with keyCode 64 +jQuery( "body" ).trigger( e ); +``` + */ + (event: string, properties?: T): Event & T; + /** + * The jQuery.Event constructor is exposed and can be used when calling trigger. The new operator is optional. + * + * Check \`{@link https://api.jquery.com/trigger/ trigger}\`'s documentation to see how to combine it with your own event object. + * @see \`{@link https://api.jquery.com/category/events/event-object/ }\` + * @since 1.6 + * @example +```javascript +//Create a new jQuery.Event object without the "new" operator. +var e = jQuery.Event( "click" ); +​ +// trigger an artificial click event +jQuery( "body" ).trigger( e ); +``` + * @example +```javascript +// Create a new jQuery.Event object with specified event properties. +var e = jQuery.Event( "keydown", { keyCode: 64 } ); +​ +// trigger an artificial keydown event with keyCode 64 +jQuery( "body" ).trigger( e ); +``` + */ + new (event: string, properties?: T): Event & T; + } + + /** + * jQuery's event system normalizes the event object according to W3C standards. The event object is guaranteed to be passed to the event handler (no checks for window.event required). It normalizes the target, relatedTarget, which, metaKey and pageX/Y properties and provides both stopPropagation() and preventDefault() methods. + * + * Those properties are all documented, and accompanied by examples, on the \`{@link http://api.jquery.com/category/events/event-object/ Event object}\` page. + * + * The standard events in the Document Object Model are: `blur`, `focus`, `load`, `resize`, `scroll`, `unload`, `beforeunload`, `click`, `dblclick`, `mousedown`, `mouseup`, `mousemove`, `mouseover`, `mouseout`, `mouseenter`, `mouseleave`, `change`, `select`, `submit`, `keydown`, `keypress`, and `keyup`. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any. + * @see \`{@link https://api.jquery.com/category/events/event-object/ }\` + * @see \`{@link TriggeredEvent }\` + */ + interface Event { + // region Copied properties + // #region Copied properties + + // Event + + bubbles: boolean | undefined; + cancelable: boolean | undefined; + eventPhase: number | undefined; + + // UIEvent + + detail: number | undefined; + view: Window | undefined; + + // MouseEvent + + button: number | undefined; + buttons: number | undefined; + clientX: number | undefined; + clientY: number | undefined; + offsetX: number | undefined; + offsetY: number | undefined; + /** + * 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 | undefined; + /** + * 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 | undefined; + screenX: number | undefined; + screenY: number | undefined; + /** @deprecated */ + toElement: Element | undefined; + + // PointerEvent + + pointerId: number | undefined; + pointerType: string | undefined; + + // KeyboardEvent + + /** @deprecated */ + char: string | undefined; + /** @deprecated */ + charCode: number | undefined; + key: string | undefined; + /** @deprecated */ + keyCode: number | undefined; + + // TouchEvent + + changedTouches: TouchList | undefined; + targetTouches: TouchList | undefined; + touches: TouchList | undefined; + + // MouseEvent, KeyboardEvent + + /** + * 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 + * @deprecated ​ Deprecated since 3.3. See \`{@link https://github.com/jquery/api.jquery.com/issues/821 }\`. + * @example ​ ````Log which key was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + * @example ​ ````Log which mouse button was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + */ + which: number | undefined; + + // MouseEvent, KeyboardEvent, TouchEvent + + altKey: boolean | undefined; + ctrlKey: boolean | undefined; + /** + * 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 | undefined; + shiftKey: boolean | undefined; + + // #endregion + + /** + * 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; + /** + * 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; + } + + // #endregion + + /** + * Base type for jQuery events that have been triggered (including events triggered on plain objects). + */ + interface TriggeredEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends Event { + /** + * 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: TCurrentTarget; + /** + * 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: TDelegateTarget; + /** + * 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; + + /** + * 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 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; + originalEvent?: _Event; + /** + * 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; + } + + // region Event + // #region Event + + interface EventBase< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends TriggeredEvent { + /** + * 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?: undefined; + + // Event + + bubbles: boolean; + cancelable: boolean; + eventPhase: number; + + // UIEvent + + detail: undefined; + view: undefined; + + // MouseEvent + + button: undefined; + buttons: undefined; + clientX: undefined; + clientY: undefined; + offsetX: undefined; + offsetY: undefined; + /** + * 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: undefined; + /** + * 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: undefined; + screenX: undefined; + screenY: undefined; + /** @deprecated */ + toElement: undefined; + + // PointerEvent + + pointerId: undefined; + pointerType: undefined; + + // KeyboardEvent + + /** @deprecated */ + char: undefined; + /** @deprecated */ + charCode: undefined; + key: undefined; + /** @deprecated */ + keyCode: undefined; + + // TouchEvent + + changedTouches: undefined; + targetTouches: undefined; + touches: undefined; + + // MouseEvent, KeyboardEvent + + /** + * 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 + * @deprecated ​ Deprecated since 3.3. See \`{@link https://github.com/jquery/api.jquery.com/issues/821 }\`. + * @example ​ ````Log which key was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + * @example ​ ````Log which mouse button was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + */ + which: undefined; + + // MouseEvent, KeyboardEvent, TouchEvent + + altKey: undefined; + ctrlKey: undefined; + /** + * 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: undefined; + shiftKey: undefined; + + originalEvent?: _Event; + } + + interface ChangeEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends EventBase { + type: 'change'; + } + + interface ResizeEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends EventBase { + type: 'resize'; + } + + interface ScrollEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends EventBase { + type: 'scroll'; + } + + interface SelectEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends EventBase { + type: 'select'; + } + + interface SubmitEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends EventBase { + type: 'submit'; + } + + // #endregion + + // region UIEvent + // #region UIEvent + + interface UIEventBase< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends TriggeredEvent { + // Event + + bubbles: boolean; + cancelable: boolean; + eventPhase: number; + + // UIEvent + + detail: number; + view: Window; + + originalEvent?: _UIEvent; + } + + // region MouseEvent + // #region MouseEvent + + interface MouseEventBase< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends UIEventBase { + /** + * 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?: EventTarget | null; + + // 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; + + // PointerEvent + + pointerId: undefined; + pointerType: undefined; + + // KeyboardEvent + + /** @deprecated */ + char: undefined; + /** @deprecated */ + charCode: undefined; + key: undefined; + /** @deprecated */ + keyCode: undefined; + + // TouchEvent + + changedTouches: undefined; + targetTouches: undefined; + touches: undefined; + + // MouseEvent, KeyboardEvent + + /** + * 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 + * @deprecated ​ Deprecated since 3.3. See \`{@link https://github.com/jquery/api.jquery.com/issues/821 }\`. + * @example ​ ````Log which key was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + * @example ​ ````Log which mouse button was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + */ + which: number; + + // 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; + + originalEvent?: _MouseEvent; + } + + interface ClickEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + /** + * 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?: null; + + type: 'click'; + } + + interface ContextMenuEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + /** + * 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?: null; + + type: 'contextmenu'; + } + + interface DoubleClickEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + /** + * 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?: null; + + type: 'dblclick'; + } + + interface MouseDownEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + /** + * 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?: null; + + type: 'mousedown'; + } + + interface MouseEnterEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + // Special handling by jQuery. + type: 'mouseover'; + } + + interface MouseLeaveEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + // Special handling by jQuery. + type: 'mouseout'; + } + + interface MouseMoveEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + /** + * 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?: null; + + type: 'mousemove'; + } + + interface MouseOutEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + type: 'mouseout'; + } + + interface MouseOverEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + type: 'mouseover'; + } + + interface MouseUpEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends MouseEventBase { + /** + * 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?: null; + + type: 'mouseup'; + } + + // #endregion + + // region KeyboardEvent + // #region KeyboardEvent + + interface KeyboardEventBase< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends UIEventBase { + /** + * 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?: undefined; + + // MouseEvent + + button: undefined; + buttons: undefined; + clientX: undefined; + clientY: undefined; + offsetX: undefined; + offsetY: undefined; + /** + * 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: undefined; + /** + * 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: undefined; + screenX: undefined; + screenY: undefined; + /** @deprecated */ + toElement: undefined; + + // PointerEvent + + pointerId: undefined; + pointerType: undefined; + + // KeyboardEvent + + /** @deprecated */ + char: string | undefined; + /** @deprecated */ + charCode: number; + key: string; + /** @deprecated */ + keyCode: number; + + // TouchEvent + + changedTouches: undefined; + targetTouches: undefined; + touches: undefined; + + // MouseEvent, KeyboardEvent + + /** + * 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 + * @deprecated ​ Deprecated since 3.3. See \`{@link https://github.com/jquery/api.jquery.com/issues/821 }\`. + * @example ​ ````Log which key was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + * @example ​ ````Log which mouse button was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + */ + which: number; + + // 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; + + originalEvent?: _KeyboardEvent; + } + + interface KeyDownEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends KeyboardEventBase { + type: 'keydown'; + } + + interface KeyPressEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends KeyboardEventBase { + type: 'keypress'; + } + + interface KeyUpEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends KeyboardEventBase { + type: 'keyup'; + } + + // #endregion + + // region TouchEvent + // #region TouchEvent + + interface TouchEventBase< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends UIEventBase { + /** + * 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?: undefined; + + // MouseEvent + + button: undefined; + buttons: undefined; + clientX: undefined; + clientY: undefined; + offsetX: undefined; + offsetY: undefined; + /** + * 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: undefined; + /** + * 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: undefined; + screenX: undefined; + screenY: undefined; + /** @deprecated */ + toElement: undefined; + + // PointerEvent + + pointerId: undefined; + pointerType: undefined; + + // KeyboardEvent + + /** @deprecated */ + char: undefined; + /** @deprecated */ + charCode: undefined; + key: undefined; + /** @deprecated */ + keyCode: undefined; + + // TouchEvent + + changedTouches: TouchList; + targetTouches: TouchList; + touches: TouchList; + + // MouseEvent, KeyboardEvent + + /** + * 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 + * @deprecated ​ Deprecated since 3.3. See \`{@link https://github.com/jquery/api.jquery.com/issues/821 }\`. + * @example ​ ````Log which key was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + * @example ​ ````Log which mouse button was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + */ + which: undefined; + + // 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; + + originalEvent?: _TouchEvent; + } + + interface TouchCancelEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends TouchEventBase { + type: 'touchcancel'; + } + + interface TouchEndEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends TouchEventBase { + type: 'touchend'; + } + + interface TouchMoveEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends TouchEventBase { + type: 'touchmove'; + } + + interface TouchStartEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends TouchEventBase { + type: 'touchstart'; + } + + // #endregion + + // region FocusEvent + // #region FocusEvent + + interface FocusEventBase< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends UIEventBase { + /** + * 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?: EventTarget | null; + + // MouseEvent + + button: undefined; + buttons: undefined; + clientX: undefined; + clientY: undefined; + offsetX: undefined; + offsetY: undefined; + /** + * 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: undefined; + /** + * 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: undefined; + screenX: undefined; + screenY: undefined; + /** @deprecated */ + toElement: undefined; + + // PointerEvent + + pointerId: undefined; + pointerType: undefined; + + // KeyboardEvent + + /** @deprecated */ + char: undefined; + /** @deprecated */ + charCode: undefined; + key: undefined; + /** @deprecated */ + keyCode: undefined; + + // TouchEvent + + changedTouches: undefined; + targetTouches: undefined; + touches: undefined; + + // MouseEvent, KeyboardEvent + + /** + * 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 + * @deprecated ​ Deprecated since 3.3. See \`{@link https://github.com/jquery/api.jquery.com/issues/821 }\`. + * @example ​ ````Log which key was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + * @example ​ ````Log which mouse button was depressed. +```html + + + + + event.which demo + + + +​ + +
          +​ + +​ + + +``` + */ + which: undefined; + + // MouseEvent, KeyboardEvent, TouchEvent + + altKey: undefined; + ctrlKey: undefined; + /** + * 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: undefined; + shiftKey: undefined; + + originalEvent?: _FocusEvent; + } + + interface BlurEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends FocusEventBase { + type: 'blur'; + } + + interface FocusEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends FocusEventBase { + type: 'focus'; + } + + interface FocusInEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends FocusEventBase { + type: 'focusin'; + } + + interface FocusOutEvent< + TDelegateTarget = any, + TData = any, + TCurrentTarget = any, + TTarget = any + > extends FocusEventBase { + type: 'focusout'; + } + + // #endregion + + // #endregion + + interface TypeToTriggeredEventMap< + TDelegateTarget, + TData, + TCurrentTarget, + TTarget + > { + // Event + + change: ChangeEvent; + resize: ResizeEvent; + scroll: ScrollEvent; + select: SelectEvent; + submit: SubmitEvent; + + // UIEvent + + // MouseEvent + + click: ClickEvent; + contextmenu: ContextMenuEvent; + dblclick: DoubleClickEvent; + mousedown: MouseDownEvent; + mouseenter: MouseEnterEvent; + mouseleave: MouseLeaveEvent; + mousemove: MouseMoveEvent; + mouseout: MouseOutEvent; + mouseover: MouseOverEvent; + mouseup: MouseUpEvent; + + // KeyboardEvent + + keydown: KeyDownEvent; + keypress: KeyPressEvent; + keyup: KeyUpEvent; + + // TouchEvent + + touchcancel: TouchCancelEvent; + touchend: TouchEndEvent; + touchmove: TouchMoveEvent; + touchstart: TouchStartEvent; + + // FocusEvent + + blur: BlurEvent; + focus: FocusEvent; + focusin: FocusInEvent; + focusout: FocusOutEvent; + + [type: string]: TriggeredEvent; + } + + // Extra parameters can be passed from trigger() + type EventHandlerBase = (this: TContext, t: T, ...args: any[]) => any; + + type EventHandler< + TCurrentTarget, + TData = undefined + > = EventHandlerBase>; + + type TypeEventHandler< + TDelegateTarget, + TData, + TCurrentTarget, + TTarget, + TType extends keyof TypeToTriggeredEventMap + > = EventHandlerBase[TType]>; + + interface TypeEventHandlers< + TDelegateTarget, + TData, + TCurrentTarget, + TTarget + > extends _TypeEventHandlers { + // No idea why it's necessary to include `object` in the union but otherwise TypeScript complains that + // derived types of Event are not assignable to Event. + [type: string]: TypeEventHandler | + false | + undefined | + object; + } + + type _TypeEventHandlers< + TDelegateTarget, + TData, + TCurrentTarget, + TTarget + > = { + [TType in keyof TypeToTriggeredEventMap]?: + TypeEventHandler | + false | + object; + }; + + // region Event extensions + // #region Event extensions + + interface EventExtensions { + /** + * 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 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: TriggeredEvent, 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: TriggeredEvent & { 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; + +type _Event = Event; +type _UIEvent = UIEvent; +type _MouseEvent = MouseEvent; +type _KeyboardEvent = KeyboardEvent; +type _TouchEvent = TouchEvent; +type _FocusEvent = FocusEvent; + +// 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..77d412f8e1 100644 --- a/types/jquery/test/example-tests.ts +++ b/types/jquery/test/example-tests.ts @@ -384,7 +384,7 @@ function examples() { } function bind_2() { - function handler(event: JQuery.Event) { + function handler(event: JQuery.TriggeredEvent) { alert(event.data.foo); } @@ -830,7 +830,7 @@ function examples() { var len = kids.addClass('hilite').length; $('#results span:first').text(len); - $('#results span:last').text(event.target.tagName); + $('#results span:last').text((event.target as Element).tagName); event.preventDefault(); }); @@ -1578,7 +1578,7 @@ function examples() { function event_related_target_0() { $('a').mouseout(function(event) { - alert(( event.relatedTarget).nodeName); // "DIV" + alert((event.relatedTarget as HTMLElement).nodeName); // "DIV" }); } @@ -1614,12 +1614,12 @@ function examples() { function event_target_0() { $('body').click(function(event) { - $('#log').html('clicked: ' + event.target.nodeName); + $('#log').html('clicked: ' + (event.target as Node).nodeName); }); } function event_target_1() { - function handler(event: JQuery.Event) { + function handler(event: JQuery.TriggeredEvent) { var target = $(event.target); if (target.is('li')) { target.children().toggle(); @@ -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 } @@ -3016,10 +3018,10 @@ function examples() { function jQuery_proxy_0() { var me = { type: 'zombie', - test: function(event: JQuery.Event) { + test: function(event: JQuery.TriggeredEvent) { // Without proxy, `this` would refer to the event target // use event.target to reference that element. - var element = event.target; + var element = event.target as Element; $(element).css('background-color', 'red'); // With proxy, `this` refers to the me object encapsulating @@ -3031,7 +3033,7 @@ function examples() { var you = { type: 'person', - test: function(event: JQuery.Event) { + test: function(event: JQuery.TriggeredEvent) { $('#log').append(this.type + ' '); }, }; @@ -3073,7 +3075,7 @@ function examples() { type: 'dog', // Note that event comes *after* one and two - test: function(one: typeof you, two: typeof they, event: JQuery.Event) { + test: function(one: typeof you, two: typeof they, event: JQuery.TriggeredEvent) { $('#log') // `one` maps to `you`, the 1st additional @@ -3794,7 +3796,7 @@ function examples() { } function on_1() { - function myHandler(event: JQuery.Event) { + function myHandler(event: JQuery.TriggeredEvent) { alert(event.data.foo); } diff --git a/types/jquery/test/learn-tests.ts b/types/jquery/test/learn-tests.ts index ef52084da5..b1a0353b4e 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,45 @@ jQuery.fn.greenify = function() { }; jQuery("a").greenify(); // Makes all the links green. + +// https://learn.jquery.com/events/event-extensions/ + +// Events + +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 as Element); + 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 4390ae014a..e1ee36a575 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 @@ -537,7 +538,7 @@ function longdesc() { $('#foo').slideUp(300).delay(800).fadeIn(400); } - function delegate_0(elements: HTMLElement[], selector: string, events: any, data: any, handler: JQuery.EventHandler) { + function delegate_0(elements: HTMLElement[], selector: string, events: string, data: any, handler: JQuery.TypeEventHandler) { // jQuery 1.4.3+ $(elements).delegate(selector, events, data, handler); // jQuery 1.7+ @@ -885,7 +886,7 @@ function longdesc() { var currentRequests: JQuery.PlainObject = {}; $.ajaxPrefilter(function(options, originalOptions, jqXHR) { - if (( options).abortOnRetry) { + if ((options as any).abortOnRetry) { if (currentRequests[options.url!]) { currentRequests[options.url!].abort(); } @@ -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; }); } @@ -1294,7 +1297,7 @@ function longdesc() { return $.css(elem, borderRadius!); }, set: function(elem, value) { - ( elem.style)[borderRadius!] = value; + (elem.style as any)[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); }; } @@ -2013,7 +2016,7 @@ function longdesc() { } function on_3() { - function greet(event: JQuery.Event) { + function greet(event: JQuery.TriggeredEvent) { alert('Hello ' + event.data.name); } 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/index.d.ts b/types/jquery/v1/index.d.ts index 8cbc9c5789..89fe87bde8 100644 --- a/types/jquery/v1/index.d.ts +++ b/types/jquery/v1/index.d.ts @@ -592,6 +592,7 @@ interface BaseJQueryEventObject extends Event { pageY: number; /** * For key or mouse events, this property indicates the specific key or button that was pressed. + * @deprecated Use `key` for KeyEvents or `button` for MouseEvents instead. * @see {@link https://api.jquery.com/event.which/} */ which: number; @@ -622,9 +623,12 @@ interface JQueryMouseEventObject extends JQueryInputEventObject { } interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; + /** @deprecated */ + char: string; + /** @deprecated */ charCode: number; - key: any; + key: string; + /** @deprecated */ keyCode: number; } @@ -824,7 +828,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; /** diff --git a/types/jquery/v1/jquery-tests.ts b/types/jquery/v1/jquery-tests.ts index d00c075125..2e12aba2d5 100644 --- a/types/jquery/v1/jquery-tests.ts +++ b/types/jquery/v1/jquery-tests.ts @@ -972,8 +972,8 @@ function test_trigger() { .trigger("click", ["foo", "bar"]); var event = jQuery.Event("logged"); - (event).user = "foo"; - (event).pass = "bar"; + (event as any).user = "foo"; + (event as any).pass = "bar"; $("body").trigger(event); // Adapted from jQuery documentation which may be wrong on this occasion @@ -1594,7 +1594,7 @@ function test_eventParams() { $('#log').html(e.type + ': ' + e.which); }); $(window).on('mousewheel', (e) => { - var delta = (e.originalEvent).deltaY; + var delta = (e.originalEvent as WheelEvent).deltaY; }); $( "p" ).click(function( event ) { alert( event.currentTarget === this ); // true @@ -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 1b1d9cf75f..068bbfc991 100644 --- a/types/jquery/v2/index.d.ts +++ b/types/jquery/v2/index.d.ts @@ -592,6 +592,7 @@ interface BaseJQueryEventObject extends Event { pageY: number; /** * For key or mouse events, this property indicates the specific key or button that was pressed. + * @deprecated Use `key` for KeyEvents or `button` for MouseEvents instead. * @see {@link https://api.jquery.com/event.which/} */ which: number; @@ -602,6 +603,14 @@ interface BaseJQueryEventObject extends Event { metaKey: boolean; } +interface JQueryCustomEventObject extends BaseJQueryEventObject { + /** + * @see {@link https://api.jquery.com/category/events/event-object/} + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent} + */ + detail?: any; +} + interface JQueryInputEventObject extends BaseJQueryEventObject { altKey: boolean; ctrlKey: boolean; @@ -622,13 +631,16 @@ interface JQueryMouseEventObject extends JQueryInputEventObject { } interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; + /** @deprecated */ + char: string; + /** @deprecated */ charCode: number; - key: any; + key: string; + /** @deprecated */ keyCode: number; } -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ +interface JQueryEventObject extends BaseJQueryEventObject, JQueryCustomEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } /** diff --git a/types/jquery/v2/jquery-tests.ts b/types/jquery/v2/jquery-tests.ts index fa651a196f..0429ec4c68 100644 --- a/types/jquery/v2/jquery-tests.ts +++ b/types/jquery/v2/jquery-tests.ts @@ -972,8 +972,8 @@ function test_trigger() { .trigger("click", ["foo", "bar"]); var event = jQuery.Event("logged"); - (event).user = "foo"; - (event).pass = "bar"; + (event as any).user = "foo"; + (event as any).pass = "bar"; $("body").trigger(event); // Adapted from jQuery documentation which may be wrong on this occasion @@ -1594,7 +1594,7 @@ function test_eventParams() { $('#log').html(e.type + ': ' + e.which); }); $(window).on('mousewheel', (e) => { - var delta = (e.originalEvent).deltaY; + var delta = (e.originalEvent as WheelEvent).deltaY; }); $( "p" ).click(function( event ) { alert( event.currentTarget === this ); // true @@ -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/jqueryui/index.d.ts b/types/jqueryui/index.d.ts index 7092de2d06..c9764b8f6b 100644 --- a/types/jqueryui/index.d.ts +++ b/types/jqueryui/index.d.ts @@ -1056,6 +1056,7 @@ declare namespace JQueryUI { keyCode: KeyCode; menu: Menu; progressbar: Progressbar; + selectmenu: SelectMenu; slider: Slider; spinner: Spinner; tabs: Tabs; @@ -1857,7 +1858,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/jqueryui-tests.ts b/types/jqueryui/jqueryui-tests.ts index 32712b8085..fa0f7b63a9 100644 --- a/types/jqueryui/jqueryui-tests.ts +++ b/types/jqueryui/jqueryui-tests.ts @@ -1862,6 +1862,7 @@ function test_ui() { $("aDialog").keypress(function (e) { return (e.keyCode == $.ui.keyCode.ENTER); }); + $(".selector").jQuery.ui.selectmenu({ disabled: true }); } function test_widget() { 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-combinatorics/index.d.ts b/types/js-combinatorics/index.d.ts index 6a5fa8e249..8023aeff73 100644 --- a/types/js-combinatorics/index.d.ts +++ b/types/js-combinatorics/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for js-combinatorics v0.5.0 +// Type definitions for js-combinatorics v0.5.4 // Project: https://github.com/dankogai/js-combinatorics // Definitions by: Vasya Aksyonov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,7 @@ declare namespace __Combinatorics { interface IGenerator { /** - * Returns the element or undefined if no more element is available. + * Returns the element or undefined if no more elements are available. */ next():T; @@ -18,24 +18,24 @@ declare namespace __Combinatorics { forEach(f:(item:T) => void):void; /** - * All elements at once with function applied to each element. + * Returns an array that is the output of calling the callback function separately on each element. */ map(f:(item:T) => TResult):TResult[]; /** - * Returns an array with elements that passes the filter function. + * Returns an array of elements that return `true` for the filter function. */ filter(predicate:(item:T) => boolean):T[]; /** - * All elements at once. + * Returns an array of all elements. */ toArray():T[]; /** - * Returns the number of elements to be generated which equals to generator.toArray().length - * but it is precalculated without actually generating elements. - * Handy when you prepare for large iteration. + * Returns the total number of elements to be generated. This equals the result of calling + * `generator.toArray().length` but it is precalculated without actually generating any elements. + * Handy when doing setup for a potentially long-running loop. */ length:number; @@ -44,7 +44,7 @@ declare namespace __Combinatorics { interface IPredictableGenerator extends IGenerator { /** - * Returns the nth element (starting 0). + * Returns the nth element (indexed from 0). */ nth(n:number):T; @@ -53,11 +53,10 @@ declare namespace __Combinatorics { interface ICartesianProductGenerator extends IPredictableGenerator { /** - * Arguments are coordinates in integer. - * Arguments can be out of bounds but it returns undefined in such cases. + * Arguments are integer coordinates. + * Arguments can be out of bounds but it returns `undefined` in such cases. */ get(...coordinates:number[]):T; - } /** @@ -76,38 +75,47 @@ declare namespace __Combinatorics { function factorial(n:number):number; /** - * Returns the factoradic representation of n in array, in least significant order. + * Returns the factoradic representation of `n` in an array, in + * least significant order. * See http://en.wikipedia.org/wiki/Factorial_number_system */ function factoradic(n:number):number[]; /** - * Generates the power set of array. + * Generates the power set of `a`. */ function power(a:T[]):IPredictableGenerator; /** - * Generates the combination of array with n elements. - * When n is ommited, the length of the array is used. + * Generates the combination of `a` with `n` elements. + * `n` defaults to the length of `a`. */ function combination(a:T[], n?:number):IGenerator; /** - * Generates the permutation of array with n elements. - * When n is ommited, the length of the array is used. + * Generates the combination of `a` with `n` elements, which + * also supports larger sets of elements. + * When `n` is ommited, the length of the array is used. + * Somewhat slower than `combination()` + */ + function bigCombination(a:T[], n?:number):IGenerator; + + /** + * Generates the permutation of `a` with `n` elements. + * `n` defaults to the length of `a`. */ function permutation(a:T[], n?:number):IGenerator; /** - * Generates the permutation of the combination of n. - * Equivalent to permutation(combination(a)), but more efficient. + * Generates the permutation of the combination of `a`. + * Equivalent to `permutation(combination(a))`, but more efficient. */ function permutationCombination(a:T[]):IGenerator; /** - * Generates n-digit "numbers" where each digit is an element in array. + * Generates `n`-digit "numbers" where each digit is an element in array. * Note this "number" is in the least significant order. - * When n is ommited, the length of the array is used. + * `n` defaults to the length of `a`. */ function baseN(a:T[], n?:number):IPredictableGenerator; diff --git a/types/js-combinatorics/js-combinatorics-tests.ts b/types/js-combinatorics/js-combinatorics-tests.ts index 68714ca17a..4162515bc2 100644 --- a/types/js-combinatorics/js-combinatorics-tests.ts +++ b/types/js-combinatorics/js-combinatorics-tests.ts @@ -25,6 +25,15 @@ const filteredCombinations:string[][] = combination.filter((i:string[]) => i.len const allCombinations:string[][] = combination.toArray(); const combinationsCount = combination.length; +const limitedBigCombination = Combinatorics.bigCombination(["a", "b", "c"], 2); +const bigCombination = Combinatorics.bigCombination(["a", "b", "c"]); +const nextBigCombination:string[] = bigCombination.next(); +bigCombination.forEach((i:string[]) => console.log(i)); +const bigCombinationsLengths:number[] = bigCombination.map((i:string[]) => i.length); +const filteredBigCombinations:string[][] = bigCombination.filter((i:string[]) => i.length > 0); +const allBigCombinations:string[][] = bigCombination.toArray(); +const bigCombinationsCount = bigCombination.length; + const limitedPermutation = Combinatorics.permutation(["a", "b", "c"], 2); const permutation = Combinatorics.permutation(["a", "b", "c"]); const nextPermutation:string[] = permutation.next(); diff --git a/types/js-levenshtein/index.d.ts b/types/js-levenshtein/index.d.ts new file mode 100644 index 0000000000..5b29d11026 --- /dev/null +++ b/types/js-levenshtein/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for js-levenshtein 1.1 +// Project: https://github.com/gustf/js-levenshtein +// Definitions by: Kallu609 +// Pyry Rouvila +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Calculates Levenshtein distance between two strings + */ +declare function levenshtein(compareFrom: string, compareTo: string): number; + +export = levenshtein; diff --git a/types/js-levenshtein/js-levenshtein-tests.ts b/types/js-levenshtein/js-levenshtein-tests.ts new file mode 100644 index 0000000000..539473ccf4 --- /dev/null +++ b/types/js-levenshtein/js-levenshtein-tests.ts @@ -0,0 +1,3 @@ +import levenshtein = require('js-levenshtein'); + +levenshtein('kittens', 'mittens'); // $ExpectType number diff --git a/types/mali/tsconfig.json b/types/js-levenshtein/tsconfig.json similarity index 85% rename from types/mali/tsconfig.json rename to types/js-levenshtein/tsconfig.json index 1a4f86d02c..6df128481b 100644 --- a/types/mali/tsconfig.json +++ b/types/js-levenshtein/tsconfig.json @@ -12,8 +12,5 @@ "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "mali-tests.ts" - ] + "files": ["index.d.ts", "js-levenshtein-tests.ts"] } diff --git a/types/js-levenshtein/tslint.json b/types/js-levenshtein/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/js-levenshtein/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/js-types/index.d.ts b/types/js-types/index.d.ts new file mode 100644 index 0000000000..756680fd04 --- /dev/null +++ b/types/js-types/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for js-types 2.0 +// Project: https://github.com/sindresorhus/js-types#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = jsTypes; + +declare const jsTypes: string[]; diff --git a/types/js-types/js-types-tests.ts b/types/js-types/js-types-tests.ts new file mode 100644 index 0000000000..b7e5a4fe8b --- /dev/null +++ b/types/js-types/js-types-tests.ts @@ -0,0 +1,5 @@ +import jsTypes = require('js-types'); +import jsTypesJson = require('js-types/js-types.json'); + +jsTypes; // $ExpectType string[] +jsTypesJson; // $ExpectType string[] diff --git a/types/js-types/js-types.json.d.ts b/types/js-types/js-types.json.d.ts new file mode 100644 index 0000000000..83565f43d1 --- /dev/null +++ b/types/js-types/js-types.json.d.ts @@ -0,0 +1,3 @@ +export = jsTypes; + +declare const jsTypes: string[]; diff --git a/types/js-types/tsconfig.json b/types/js-types/tsconfig.json new file mode 100644 index 0000000000..1b81a82e27 --- /dev/null +++ b/types/js-types/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", + "js-types.json.d.ts", + "js-types-tests.ts" + ] +} diff --git a/types/js-types/tslint.json b/types/js-types/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/js-types/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/js-url/index.d.ts b/types/js-url/index.d.ts index d5bf93257d..69583e1553 100644 --- a/types/js-url/index.d.ts +++ b/types/js-url/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for url v1.8.6 // Project: https://github.com/websanova/js-url -// Definitions by: MIZUNE Pine +// Definitions by: Pine Mizune // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface UrlStatic { diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 1dfa56c5a5..b59741e74e 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for js-yaml 3.11 +// Type definitions for js-yaml 3.12 // Project: https://github.com/nodeca/js-yaml // Definitions by: Bart van der Schoor , Sebastian Clausen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -39,37 +39,41 @@ export function safeDump(obj: any, opts?: DumpOptions): string; export function dump(obj: any, opts?: DumpOptions): string; export interface LoadOptions { - // string to be used as a file path in error/warning messages. + /** string to be used as a file path in error/warning messages. */ filename?: string; - // makes the loader to throw errors instead of warnings. - strict?: boolean; - // specifies a schema to use. - schema?: any; - // compatibility with JSON.parse behaviour. + /** function to call on warning messages. */ + onWarning?(this: null, e: YAMLException): void; + /** specifies a schema to use. */ + schema?: SchemaDefinition; + /** compatibility with JSON.parse behaviour. */ json?: boolean; } export interface DumpOptions { - // indentation width to use (in spaces). + /** indentation width to use (in spaces). */ indent?: number; - // do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. + /** when true, will not add an indentation level to array elements */ + noArrayIndent?: boolean; + /** do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. */ skipInvalid?: boolean; - // specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere + /** specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere */ flowLevel?: number; - // Each tag may have own set of styles. - "tag" => "style" map. + /** Each tag may have own set of styles. - "tag" => "style" map. */ styles?: { [x: string]: any; }; - // specifies a schema to use. - schema?: any; - // if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) + /** specifies a schema to use. */ + schema?: SchemaDefinition; + /** if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) */ sortKeys?: boolean | ((a: any, b: any) => number); - // set max line width. (default: 80) + /** set max line width. (default: 80) */ lineWidth?: number; - // if true, don't convert duplicate objects into references (default: false) + /** if true, don't convert duplicate objects into references (default: false) */ noRefs?: boolean; - // if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) + /** if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) */ noCompatMode?: boolean; - // if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`. - // Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false) + /** + * if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`. + * Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false). + */ condenseFlow?: boolean; } @@ -90,15 +94,15 @@ export interface SchemaDefinition { include?: Schema[]; } -// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 +/** only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 */ export let FAILSAFE_SCHEMA: Schema; -// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 +/** only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 */ export let JSON_SCHEMA: Schema; -// same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923 +/** same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923 */ export let CORE_SCHEMA: Schema; -// all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/ +/** all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/ */ export let DEFAULT_SAFE_SCHEMA: Schema; -// all supported YAML types. +/** all supported YAML types. */ export let DEFAULT_FULL_SCHEMA: Schema; export let MINIMAL_SCHEMA: Schema; export let SAFE_SCHEMA: Schema; diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 2d67b99192..304da7731d 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -58,20 +58,23 @@ loadOpts = { filename: str }; loadOpts = { - strict: bool -}; -loadOpts = { - schema: bool + onWarning(e) { e.stack; } }; loadOpts = { json: bool }; +loadOpts = { + schema: yaml.DEFAULT_SAFE_SCHEMA +}; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- dumpOpts = { indent: num }; +dumpOpts = { + noArrayIndent: bool +}; dumpOpts = { skipInvalid: bool }; @@ -84,6 +87,9 @@ dumpOpts = { dumpOpts = { schema: value }; +dumpOpts = { + schema: yaml.DEFAULT_FULL_SCHEMA +}; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 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..0b8be95052 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, ConstructorOptions } from 'jsdom'; import { CookieJar as ToughCookieJar, MemoryCookieStore } from 'tough-cookie'; import { Script } from 'vm'; @@ -56,8 +56,9 @@ function test_cookieJar() { const store = {} as MemoryCookieStore; const options = {} as ToughCookieJar.Options; - const cookieJar = new CookieJar(store, options); - const dom = new JSDOM(``, { cookieJar }); + const cookieJar: CookieJar = new CookieJar(store, options); + const constructorOptions: ConstructorOptions = { cookieJar }; + const dom = new JSDOM(``, constructorOptions); } function test_beforeParse() { @@ -82,6 +83,7 @@ function test_serialize() { dom.serialize() === 'hello'; // Contrast with: + // tslint:disable-next-line no-unnecessary-type-assertion dom.window.document.documentElement!.outerHTML === 'hello'; } @@ -119,7 +121,7 @@ function test_runVMScript() { dom.runVMScript(s); dom.runVMScript(s); - ( dom.window).ran === 3; + (dom.window as any).ran === 3; } function test_reconfigure() { @@ -168,3 +170,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/jsdom/package.json b/types/jsdom/package.json index ef0b8c56fc..51569954af 100644 --- a/types/jsdom/package.json +++ b/types/jsdom/package.json @@ -2,5 +2,13 @@ "private": true, "dependencies": { "parse5": "^4.0.0" + }, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { + "*": [ + "ts3.1/*" + ] + } } } diff --git a/types/jsdom/ts3.1/index.d.ts b/types/jsdom/ts3.1/index.d.ts new file mode 100644 index 0000000000..e00b4a0d5f --- /dev/null +++ b/types/jsdom/ts3.1/index.d.ts @@ -0,0 +1,320 @@ +/// +/// + +import { EventEmitter } from "events"; +import { MarkupData } from "parse5"; +import * as tough from "tough-cookie"; +import { Script } from "vm"; + +export class JSDOM { + static fromURL(url: string, options?: FromUrlOptions): Promise; + + static fromFile(url: string, options?: FromFileOptions): Promise; + + static fragment(html: string): DocumentFragment; + + constructor( + html?: string | Buffer | BinaryData, + options?: ConstructorOptions + ); + + readonly window: DOMWindow; + readonly virtualConsole: VirtualConsole; + readonly cookieJar: CookieJar; + + /** + * The serialize() method will return the HTML serialization of the document, including the doctype. + */ + serialize(): string; + + /** + * The nodeLocation() method will find where a DOM node is within the source document, returning the parse5 location info for the node. + */ + nodeLocation(node: Node): MarkupData.ElementLocation | null; + + /** + * The built-in vm module of Node.js allows you to create Script instances, + * which can be compiled ahead of time and then run multiple times on a given "VM context". + * Behind the scenes, a jsdom Window is indeed a VM context. + * To get access to this ability, use the runVMScript() method. + */ + runVMScript(script: Script): void; + + reconfigure(settings: ReconfigureSettings): void; +} + +export interface Options { + /** + * referrer just affects the value read from document.referrer. + * It defaults to no referrer (which reflects as the empty string). + */ + referrer?: string; + /** + * userAgent affects the value read from navigator.userAgent, as well as the User-Agent header sent while fetching subresources. + * It defaults to `Mozilla/5.0 (${process.platform}) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/${jsdomVersion}`. + */ + userAgent?: string; + /** + * includeNodeLocations preserves the location info produced by the HTML parser, + * allowing you to retrieve it with the nodeLocation() method (described below). + * It defaults to false to give the best performance, + * and cannot be used with an XML content type since our XML parser does not support location info. + */ + includeNodeLocations?: boolean; + runScripts?: "dangerously" | "outside-only"; + resources?: "usable" | ResourceLoader; + virtualConsole?: VirtualConsole; + cookieJar?: CookieJar; + beforeParse?(window: DOMWindow): void; +} + +export type FromUrlOptions = Options; + +export type FromFileOptions = Options & { + /** + * url sets the value returned by window.location, document.URL, and document.documentURI, + * and affects things like resolution of relative URLs within the document + * and the same-origin restrictions and referrer used while fetching subresources. + * It will default to a file URL corresponding to the given filename, instead of to "about:blank". + */ + url?: string; + /** + * contentType affects the value read from document.contentType, and how the document is parsed: as HTML or as XML. + * Values that are not "text/html" or an XML mime type will throw. It will default to "application/xhtml+xml" if + * the given filename ends in .xhtml or .xml; otherwise it will continue to default to "text/html". + */ + contentType?: string; +}; + +export type ConstructorOptions = Options & { + /** + * url sets the value returned by window.location, document.URL, and document.documentURI, + * and affects things like resolution of relative URLs within the document + * and the same-origin restrictions and referrer used while fetching subresources. + * It defaults to "about:blank". + */ + url?: string; + /** + * contentType affects the value read from document.contentType, and how the document is parsed: as HTML or as XML. + * Values that are not "text/html" or an XML mime type will throw. It defaults to "text/html". + */ + contentType?: string; + /** + * jsdom does not have the capability to render visual content, and will act like a headless browser by default. + * It provides hints to web pages through APIs such as document.hidden that their content is not visible. + * + * When the pretendToBeVisual option is set to true, jsdom will pretend that it is rendering and displaying + * content. + */ + pretendToBeVisual?: boolean; + /** + * The maximum size in code units for the separate storage areas used by localStorage and sessionStorage. + * Attempts to store data larger than this limit will cause a DOMException to be thrown. By default, it is set + * to 5,000,000 code units per origin, as inspired by the HTML specification. + */ + storageQuota?: number; +}; + +export interface DOMWindow extends Window { + eval(script: string): void; + + /* node_modules/jsdom/living/index.js */ + DOMException: typeof DOMException; + Attr: typeof Attr; + Node: typeof Node; + Element: typeof Element; + DocumentFragment: typeof DocumentFragment; + Document: typeof Document; + HTMLDocument: typeof HTMLDocument; + XMLDocument: typeof XMLDocument; + CharacterData: typeof CharacterData; + Text: typeof Text; + CDATASection: typeof CDATASection; + ProcessingInstruction: typeof ProcessingInstruction; + Comment: typeof Comment; + DocumentType: typeof DocumentType; + DOMImplementation: typeof DOMImplementation; + NodeList: typeof NodeList; + HTMLCollection: typeof HTMLCollection; + HTMLOptionsCollection: typeof HTMLOptionsCollection; + DOMStringMap: typeof DOMStringMap; + DOMTokenList: typeof DOMTokenList; + Event: typeof Event; + CustomEvent: typeof CustomEvent; + MessageEvent: typeof MessageEvent; + ErrorEvent: typeof ErrorEvent; + HashChangeEvent: typeof HashChangeEvent; + FocusEvent: typeof FocusEvent; + PopStateEvent: typeof PopStateEvent; + UIEvent: typeof UIEvent; + MouseEvent: typeof MouseEvent; + KeyboardEvent: typeof KeyboardEvent; + TouchEvent: typeof TouchEvent; + ProgressEvent: typeof ProgressEvent; + CompositionEvent: typeof CompositionEvent; + WheelEvent: typeof WheelEvent; + EventTarget: typeof EventTarget; + Location: typeof Location; + History: typeof History; + Blob: typeof Blob; + File: typeof File; + FileList: typeof FileList; + DOMParser: typeof DOMParser; + FormData: typeof FormData; + XMLHttpRequestEventTarget: XMLHttpRequestEventTarget; + XMLHttpRequestUpload: typeof XMLHttpRequestUpload; + NodeIterator: typeof NodeIterator; + TreeWalker: typeof TreeWalker; + NamedNodeMap: typeof NamedNodeMap; + URL: typeof URL; + URLSearchParams: typeof URLSearchParams; + + /* node_modules/jsdom/living/register-elements.js */ + HTMLElement: typeof HTMLElement; + HTMLAnchorElement: typeof HTMLAnchorElement; + HTMLAppletElement: typeof HTMLAppletElement; + HTMLAreaElement: typeof HTMLAreaElement; + HTMLAudioElement: typeof HTMLAudioElement; + HTMLBaseElement: typeof HTMLBaseElement; + HTMLBodyElement: typeof HTMLBodyElement; + HTMLBRElement: typeof HTMLBRElement; + HTMLButtonElement: typeof HTMLButtonElement; + HTMLCanvasElement: typeof HTMLCanvasElement; + HTMLDataElement: typeof HTMLDataElement; + HTMLDataListElement: typeof HTMLDataListElement; + // HTMLDetailsElement: typeof HTMLDetailsElement; + // HTMLDialogElement: typeof HTMLDialogElement; + HTMLDirectoryElement: typeof HTMLDirectoryElement; + HTMLDivElement: typeof HTMLDivElement; + HTMLDListElement: typeof HTMLDListElement; + HTMLEmbedElement: typeof HTMLEmbedElement; + HTMLFieldSetElement: typeof HTMLFieldSetElement; + HTMLFontElement: typeof HTMLFontElement; + HTMLFormElement: typeof HTMLFormElement; + HTMLFrameElement: typeof HTMLFrameElement; + HTMLFrameSetElement: typeof HTMLFrameSetElement; + HTMLHeadingElement: typeof HTMLHeadingElement; + HTMLHeadElement: typeof HTMLHeadElement; + HTMLHRElement: typeof HTMLHRElement; + HTMLHtmlElement: typeof HTMLHtmlElement; + HTMLIFrameElement: typeof HTMLIFrameElement; + HTMLImageElement: typeof HTMLImageElement; + HTMLInputElement: typeof HTMLInputElement; + HTMLLabelElement: typeof HTMLLabelElement; + HTMLLegendElement: typeof HTMLLegendElement; + HTMLLIElement: typeof HTMLLIElement; + HTMLLinkElement: typeof HTMLLinkElement; + HTMLMapElement: typeof HTMLMapElement; + HTMLMarqueeElement: typeof HTMLMarqueeElement; + HTMLMediaElement: typeof HTMLMediaElement; + HTMLMenuElement: typeof HTMLMenuElement; + HTMLMetaElement: typeof HTMLMetaElement; + HTMLMeterElement: typeof HTMLMeterElement; + HTMLModElement: typeof HTMLModElement; + HTMLObjectElement: typeof HTMLObjectElement; + HTMLOListElement: typeof HTMLOListElement; + HTMLOptGroupElement: typeof HTMLOptGroupElement; + HTMLOptionElement: typeof HTMLOptionElement; + HTMLOutputElement: typeof HTMLOutputElement; + HTMLParagraphElement: typeof HTMLParagraphElement; + HTMLParamElement: typeof HTMLParamElement; + HTMLPictureElement: typeof HTMLPictureElement; + HTMLPreElement: typeof HTMLPreElement; + HTMLProgressElement: typeof HTMLProgressElement; + HTMLQuoteElement: typeof HTMLQuoteElement; + HTMLScriptElement: typeof HTMLScriptElement; + HTMLSelectElement: typeof HTMLSelectElement; + HTMLSourceElement: typeof HTMLSourceElement; + HTMLSpanElement: typeof HTMLSpanElement; + HTMLStyleElement: typeof HTMLStyleElement; + HTMLTableCaptionElement: typeof HTMLTableCaptionElement; + HTMLTableCellElement: typeof HTMLTableCellElement; + HTMLTableColElement: typeof HTMLTableColElement; + HTMLTableElement: typeof HTMLTableElement; + HTMLTimeElement: typeof HTMLTimeElement; + HTMLTitleElement: typeof HTMLTitleElement; + HTMLTableRowElement: typeof HTMLTableRowElement; + HTMLTableSectionElement: typeof HTMLTableSectionElement; + HTMLTemplateElement: typeof HTMLTemplateElement; + HTMLTextAreaElement: typeof HTMLTextAreaElement; + HTMLTrackElement: typeof HTMLTrackElement; + HTMLUListElement: typeof HTMLUListElement; + HTMLUnknownElement: typeof HTMLUnknownElement; + HTMLVideoElement: typeof HTMLVideoElement; + + /* node_modules/jsdom/level2/style.js */ + StyleSheet: typeof StyleSheet; + MediaList: typeof MediaList; + CSSStyleSheet: typeof CSSStyleSheet; + CSSRule: typeof CSSRule; + CSSStyleRule: typeof CSSStyleRule; + CSSMediaRule: typeof CSSMediaRule; + CSSImportRule: typeof CSSImportRule; + CSSStyleDeclaration: typeof CSSStyleDeclaration; + StyleSheetList: typeof StyleSheetList; + + /* node_modules/jsdom/level3/xpath.js */ + // XPathException: typeof XPathException; + XPathExpression: typeof XPathExpression; + XPathResult: typeof XPathResult; + XPathEvaluator: typeof XPathEvaluator; + + /* node_modules/jsdom/living/node-filter.js */ + NodeFilter: typeof NodeFilter; +} + +export type BinaryData = + | ArrayBuffer + | DataView + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array; + +export class VirtualConsole extends EventEmitter { + on(method: K, callback: Console[K]): this; + on(event: "jsdomError", callback: (e: Error) => void): this; + + sendTo(console: Console, options?: VirtualConsoleSendToOptions): this; +} + +export interface VirtualConsoleSendToOptions { + omitJSDOMErrors: boolean; +} + +export class CookieJar extends tough.CookieJar {} + +export const toughCookie: typeof tough; + +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/ts3.1/jsdom-tests.ts b/types/jsdom/ts3.1/jsdom-tests.ts new file mode 100644 index 0000000000..d20232e36f --- /dev/null +++ b/types/jsdom/ts3.1/jsdom-tests.ts @@ -0,0 +1,184 @@ +import { JSDOM, VirtualConsole, CookieJar, FromUrlOptions, FromFileOptions, DOMWindow, ResourceLoader, FetchOptions } from 'jsdom'; +import { CookieJar as ToughCookieJar, MemoryCookieStore } from 'tough-cookie'; +import { Script } from 'vm'; + +function test_basic_usage() { + const dom = new JSDOM(`

          Hello world

          `); + console.log(dom.window.document.querySelector('p')!.textContent); // "Hello world" + + const { window } = new JSDOM(`...`); + // or even + const { document } = (new JSDOM(`...`)).window; +} + +function test_executing_scripts1() { + const dom = new JSDOM(` + +`); + + // The script will not be executed, by default: + dom.window.document.body.children.length === 1; +} + +function test_executing_scripts2() { + const dom = new JSDOM(` + +`, { runScripts: 'dangerously' }); + + // The script will be executed and modify the DOM: + dom.window.document.body.children.length === 2; +} + +function test_executing_scripts3() { + const window = (new JSDOM(``, { runScripts: 'outside-only' })).window; + + window.eval(`document.body.innerHTML = "

          Hello, world!

          ";`); + window.document.body.children.length === 1; +} + +function test_virtualConsole() { + const virtualConsole = new VirtualConsole(); + const dom = new JSDOM(``, { virtualConsole }); + + virtualConsole.on('error', () => { }); + virtualConsole.on('warn', () => { }); + virtualConsole.on('info', () => { }); + virtualConsole.on('dir', () => { }); + // ... etc. See https://console.spec.whatwg.org/#logging + + virtualConsole.sendTo(console); + + const c = console; + virtualConsole.sendTo(c, { omitJSDOMErrors: true }); +} + +function test_cookieJar() { + const store = {} as MemoryCookieStore; + const options = {} as ToughCookieJar.Options; + + const cookieJar = new CookieJar(store, options); + const dom = new JSDOM(``, { cookieJar }); +} + +function test_beforeParse() { + const dom = new JSDOM(`

          Hello

          `, { + beforeParse(window) { + window.document.childNodes.length === 0; + } + }); +} + +function test_storageQuota() { + new JSDOM('', { storageQuota: 1337 }); +} + +function test_pretendToBeVisual() { + new JSDOM('', { pretendToBeVisual: true }); +} + +function test_serialize() { + const dom = new JSDOM(`hello`); + + dom.serialize() === 'hello'; + + // Contrast with: + // tslint:disable-next-line no-unnecessary-type-assertion + dom.window.document.documentElement!.outerHTML === 'hello'; +} + +function test_nodeLocation() { + const dom = new JSDOM( + `

          Hello + +

          `, + { includeNodeLocations: true } + ); + + const document = dom.window.document; + const bodyEl = document.body; // implicitly created + const pEl = document.querySelector('p')!; + const textNode = pEl.firstChild!; + const imgEl = document.querySelector('img')!; + + console.log(dom.nodeLocation(bodyEl)); // null; it's not in the source + console.log(dom.nodeLocation(pEl)); // { startOffset: 0, endOffset: 39, startTag: ..., endTag: ... } + console.log(dom.nodeLocation(textNode)); // { startOffset: 3, endOffset: 13 } + console.log(dom.nodeLocation(imgEl)); // { startOffset: 13, endOffset: 32 } +} + +function test_runVMScript() { + const dom = new JSDOM(``, { runScripts: 'outside-only' }); + const s = new Script(` + if (!this.ran) { + this.ran = 0; + } + + ++this.ran; +`); + + dom.runVMScript(s); + dom.runVMScript(s); + dom.runVMScript(s); + + ( dom.window).ran === 3; +} + +function test_reconfigure() { + const myFakeTopForTesting = {} as DOMWindow; + + const dom = new JSDOM(); + + dom.window.top === dom.window; + dom.window.location.href === 'about:blank'; + + dom.reconfigure({ windowTop: myFakeTopForTesting, url: 'https://example.com/' }); + + dom.window.top === myFakeTopForTesting; + dom.window.location.href === 'https://example.com/'; +} + +function test_fromURL() { + const options = {} as FromUrlOptions; + + JSDOM.fromURL('https://example.com/', options).then(dom => { + console.log(dom.serialize()); + }); +} + +function test_fromFile() { + const options = {} as FromFileOptions; + + JSDOM.fromFile('stuff.html', options).then(dom => { + console.log(dom.serialize()); + }); +} + +function test_fragment() { + const frag = JSDOM.fragment(`

          Hello

          Hi!`); + + frag.childNodes.length === 2; + frag.querySelector('strong')!.textContent = 'Why hello there!'; + // etc. +} + +function test_fragment_serialization() { + const frag = JSDOM.fragment(`

          Hello

          `); + if (frag instanceof Element) { + if (frag.firstChild instanceof Element) { + console.log(frag.firstChild.outerHTML); // logs "

          Hello

          " + } + } +} + +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/jsdom/ts3.1/tsconfig.json b/types/jsdom/ts3.1/tsconfig.json new file mode 100644 index 0000000000..d3e0cbd06f --- /dev/null +++ b/types/jsdom/ts3.1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": ["../../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "parse5": ["parse5/v4"] + } + }, + "files": ["index.d.ts", "jsdom-tests.ts"] +} diff --git a/types/jsdom/ts3.1/tslint.json b/types/jsdom/ts3.1/tslint.json new file mode 100644 index 0000000000..523ff9bf74 --- /dev/null +++ b/types/jsdom/ts3.1/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODOs + "no-empty-interface": false, + "no-object-literal-type-assertion": false + } +} 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/api/chatter.d.ts b/types/jsforce/api/chatter.d.ts index 4e0982ca24..4b65740f36 100644 --- a/types/jsforce/api/chatter.d.ts +++ b/types/jsforce/api/chatter.d.ts @@ -27,7 +27,7 @@ interface RequestParams { export class RequestResult { } -export class Request implements Promise { +export class Request implements PromiseLike { constructor(chatter: Chatter, params: RequestParams); batchParams(): BatchRequestParams; @@ -36,14 +36,12 @@ export class Request implements Promise { stream(): Stream; - catch(onrejected?: ((reason: any) => (PromiseLike | TResult)) | null | undefined): Promise; - then(onfulfilled?: ((value: T) => (PromiseLike | TResult1)) | null | undefined, onrejected?: ((reason: any) => (PromiseLike | TResult2)) | null | undefined): Promise; - thenCall(callback?: (err: Error, records: T) => void): Query; + finally(onfinally?: () => void): Promise; - readonly [Symbol.toStringTag]: 'Promise'; + thenCall(callback?: (err: Error, records: T) => void): Query; } export class Resource extends Request { diff --git a/types/jsforce/api/metadata.d.ts b/types/jsforce/api/metadata.d.ts index 15f0fe249e..88dbdaa52d 100644 --- a/types/jsforce/api/metadata.d.ts +++ b/types/jsforce/api/metadata.d.ts @@ -112,19 +112,17 @@ interface DeployOptions { singlePackage?: boolean; } -export class AsyncResultLocator extends EventEmitter implements Promise { +export class AsyncResultLocator extends EventEmitter implements PromiseLike { check(callback?: Callback): Promise complete(callback?: Callback): Promise poll(interval: number, timeout: number): void; - catch(onrejected?: ((reason: any) => (PromiseLike | TResult)) | null | undefined): Promise; - then(onfulfilled?: ((value: T) => (PromiseLike | TResult1)) | null | undefined, onrejected?: ((reason: any) => (PromiseLike | TResult2)) | null | undefined): Promise; - readonly [Symbol.toStringTag]: "Promise"; + finally(onfinally?: () => void): Promise; } export class DeployResultLocator extends AsyncResultLocator {} 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/describe-result.d.ts b/types/jsforce/describe-result.d.ts index f59df9ff59..80a1de7339 100644 --- a/types/jsforce/describe-result.d.ts +++ b/types/jsforce/describe-result.d.ts @@ -10,7 +10,7 @@ export interface DescribeSObjectResult { createable: boolean; custom: boolean; customSetting: boolean; - deleteable: boolean; + deletable: boolean; deprecatedAndHidden: boolean; feedEnabled: boolean; fields: Field[]; @@ -33,7 +33,7 @@ export interface DescribeSObjectResult { searchLayoutable: boolean; supportedScopes: ScopeInfo[]; triggerable: boolean; - undeleteable: boolean; + undeletable: boolean; updateable: boolean; urlDetail?: string; urlEdit?: string; diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index c36f39095a..9aaba4e54b 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -6,6 +6,7 @@ // Tim Noonan // Abraham White // Borys Kupar +// Andrés Catalán // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -30,3 +31,4 @@ export * from './salesforce-id'; export * from './salesforce-object'; export * from './streaming'; export * from './topic'; +export * from './limits-info'; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 08ea888062..45442b91dc 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -615,7 +615,7 @@ async function testChatter(conn: sf.Connection): Promise { const feedResource: sf.Resource = chatter.resource('/feed-elements'); - const feedCreateRequest: any = await (feedResource.create({ + const feedCreateRequest: any = await feedResource.create({ body: { messageSegments: [{ type: 'Text', @@ -624,13 +624,13 @@ async function testChatter(conn: sf.Connection): Promise { }, feedElementType: 'FeedItem', subjectId: 'me' - }) as Promise); + }); console.log(`feedCreateRequest.id: ${feedCreateRequest.id}`); const itemLikesUrl = `/feed-elements/${feedCreateRequest.id}/capabilities/chatter-likes/items`; const itemsLikeResource: sf.Resource = chatter.resource(itemLikesUrl); - const itemsLikeCreateResult: sf.RequestResult = await (itemsLikeResource.create('') as Promise); + const itemsLikeCreateResult: sf.RequestResult = await itemsLikeResource.create(''); console.log(`itemsLikeCreateResult['likedItem']: ${itemsLikeCreateResult as any['likedItem']}`); } 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..12201695b9 100644 --- a/types/jsforce/tslint.json +++ b/types/jsforce/tslint.json @@ -2,9 +2,20 @@ "extends": "dtslint/dt.json", "rules": { // TODOs + "array-type": false, + "await-promise": [true, "Request"], "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/json-schema/index.d.ts b/types/json-schema/index.d.ts index 156a86c9a5..b380b19020 100644 --- a/types/json-schema/index.d.ts +++ b/types/json-schema/index.d.ts @@ -20,6 +20,21 @@ export type JSONSchema4TypeName = 'string' | 'number' | 'integer' | 'boolean' */ export type JSONSchema4Type = any[] | boolean | number | null | object | string +/** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-04/schema#' + * - 'http://json-schema.org/draft-04/hyper-schema#' + * - 'http://json-schema.org/draft-03/schema#' + * - 'http://json-schema.org/draft-03/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema4Version = string; + /** * JSON Schema V4 * @see https://tools.ietf.org/html/draft-zyp-json-schema-04 @@ -27,10 +42,7 @@ export type JSONSchema4Type = any[] | boolean | number | null | object | string export interface JSONSchema4 { id?: string $ref?: string - $schema?: 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' - | 'http://json-schema.org/draft-04/schema#' | 'http://json-schema.org/draft-04/hyper-schema#' - | 'http://json-schema.org/draft-03/schema#' | 'http://json-schema.org/draft-03/hyper-schema#' - | string + $schema?: JSONSchema4Version /** * This attribute is a string that provides a short description of the @@ -210,6 +222,19 @@ export type JSONSchema6TypeName = 'string' | 'number' | 'integer' | 'boolean' | export type JSONSchema6Type = any[] | boolean | number | null | object | string +/** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-06/schema#' + * - 'http://json-schema.org/draft-06/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema6Version = string; + /** * JSON Schema V6 * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01 @@ -218,8 +243,7 @@ export type JSONSchema6Definition = JSONSchema6 | boolean; export interface JSONSchema6 { $id?: string $ref?: string - $schema?: 'http://json-schema.org/schema#' | 'http://json-schema.org/hyper-schema#' | - 'http://json-schema.org/draft-06/schema#' | 'http://json-schema.org/draft-06/hyper-schema#' + $schema?: JSONSchema6Version /** * Must be strictly greater than 0. @@ -502,12 +526,16 @@ export interface JSONSchema7Array extends Array {} /** * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-07/schema#' + * - 'http://json-schema.org/draft-07/hyper-schema#' + * * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 */ -export type JSONSchema7Version = 'http://json-schema.org/schema#' - | 'http://json-schema.org/hyper-schema#' - | 'http://json-schema.org/draft-07/schema#' - | 'http://json-schema.org/draft-07/hyper-schema#'; +export type JSONSchema7Version = string; /** * JSON Schema v7 diff --git a/types/json-server/index.d.ts b/types/json-server/index.d.ts new file mode 100644 index 0000000000..c52a4b220e --- /dev/null +++ b/types/json-server/index.d.ts @@ -0,0 +1,72 @@ +// Type definitions for json-server 0.14 +// Project: https://github.com/typicode/json-server +// Definitions by: Jeremy Bensimon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { NextHandleFunction } from 'connect'; +import { Application, RequestHandler, Router } from 'express'; + +/** + * Returns an Express server. + */ +export function create(): Application; + +/** + * Returns middlewares used by JSON Server. + */ +export function defaults(options?: MiddlewaresOptions): RequestHandler[]; + +/** + * Returns JSON Server router. + * @param source Either a path to a json file (e.g. `'db.json'`) or an object in memory + * @param options Set foreign key suffix (default: `'Id'`) + */ +export function router(source: string | object, options?: { foreignKeySuffix: string }): Router; + +/** + * Add custom rewrite rules. + */ +export function rewriter(rules: { [rule: string]: string }): Router; + +/** + * Returns body-parser middleware used by JSON Server router. + * + * @returns + * ``` + * [bodyParser.json({ limit: '10mb', extended: false }), bodyParser.urlencoded({ extended: false })] + * ``` + */ +export const bodyParser: [NextHandleFunction, NextHandleFunction]; + +export interface MiddlewaresOptions { + /** + * Path to static files + * @default "public" (if folder exists) + */ + static?: string; + + /** + * Enable logger middleware + * @default true + */ + logger?: boolean; + + /** + * Enable body-parser middleware + * @default true + */ + bodyParser?: boolean; + + /** + * Disable CORS + * @default false + */ + noCors?: boolean; + + /** + * Accept only GET requests + * @default false + */ + readOnly?: boolean; +} diff --git a/types/json-server/json-server-tests.ts b/types/json-server/json-server-tests.ts new file mode 100644 index 0000000000..d68484b1ff --- /dev/null +++ b/types/json-server/json-server-tests.ts @@ -0,0 +1,41 @@ +import * as jsonServer from 'json-server'; + +const server = jsonServer.create(); + +const inMemoryDbRouter = jsonServer.router({ todos: [] as any[], users: [] as any[] }); + +const router = jsonServer.router('db.json', { foreignKeySuffix: '_id' }); + +const middlewaresOptions: jsonServer.MiddlewaresOptions = { + bodyParser: true, + logger: false, + noCors: true, + readOnly: true, + static: 'assets', +}; + +const middlewares = jsonServer.defaults(middlewaresOptions); + +const rewriter = jsonServer.rewriter({ + '/api/*': '/$1', + '/blog/:resource/:id/show': '/:resource/:id', +}); + +server.use(jsonServer.bodyParser); + +server.use((req, res, next) => { + if (req.method === 'POST') { + req.body.createdAt = Date.now(); + } + next(); +}); + +server.use(rewriter); + +server.use(middlewares); + +server.use(router); + +server.listen(3000, () => { + console.log('JSON Server is running'); +}); diff --git a/types/json-server/tsconfig.json b/types/json-server/tsconfig.json new file mode 100644 index 0000000000..e923ac1d7a --- /dev/null +++ b/types/json-server/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", "json-server-tests.ts"] +} diff --git a/types/json-server/tslint.json b/types/json-server/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/json-server/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/json_ml/index.d.ts b/types/json_ml/index.d.ts new file mode 100644 index 0000000000..7cab812880 --- /dev/null +++ b/types/json_ml/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for json_ml 0.0 +// Project: https://github.com/59naga/json-ml +// Definitions by: Alan Plum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +export type Node = string | [string, ...any[]]; +export function parse(xml: string, trim?: boolean): Node[]; +export function stringify( + object: Node[], + replacer?: ((node: Cheerio) => any) | null, + indent?: number +): string; diff --git a/types/json_ml/json_ml-tests.ts b/types/json_ml/json_ml-tests.ts new file mode 100644 index 0000000000..05ca64da4a --- /dev/null +++ b/types/json_ml/json_ml-tests.ts @@ -0,0 +1,20 @@ +/// +import { Node, parse, stringify } from "json_ml"; + +const nodes: Node[] = parse( + '
          • First Item
          • Second Item
          • ThirdItem
          ' +); +stringify(nodes, el => (el.is("li") ? null : el), 2); + +stringify( + [ + [ + "ul", + ["li", { style: "color: red" }], + ["li", { title: "Some hover text", style: "color: green" }], + ["li", ["span", { class: "code-example-third" }]] + ] + ], + null, + 2 +); diff --git a/types/json_ml/tsconfig.json b/types/json_ml/tsconfig.json new file mode 100644 index 0000000000..951405762a --- /dev/null +++ b/types/json_ml/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", "json_ml-tests.ts"] +} diff --git a/types/json_ml/tslint.json b/types/json_ml/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/json_ml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsonabc/index.d.ts b/types/jsonabc/index.d.ts new file mode 100644 index 0000000000..41a785d015 --- /dev/null +++ b/types/jsonabc/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for jsonabc 2.3 +// Project: http://novicelab.org/jsonabc +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/** + * Sort the JSON (clean, parse, sort, stringify). + * @param noArray Sort or don't sort arrays + */ +export function sort(inputStr: string, noArray?: boolean): string; + +/** + * Sort the JSON (clean, parse, sort, stringify). + * @param noArray Sort or don't sort arrays + */ +export function sortObj(input: object, noArray?: boolean): object; + +/** Remove trailing commas */ +export function cleanJSON(input: string): string; diff --git a/types/jsonabc/jsonabc-tests.ts b/types/jsonabc/jsonabc-tests.ts new file mode 100644 index 0000000000..8d51d94bac --- /dev/null +++ b/types/jsonabc/jsonabc-tests.ts @@ -0,0 +1,9 @@ +import * as myJsonAbc from 'jsonabc'; + +myJsonAbc.sortObj({ c: 0, b: 1, a: 0 }); +myJsonAbc.sortObj({ c: 0, b: 1, a: 0 }, false); + +myJsonAbc.sort('{ c: 0, b: 1, a: 0 }'); +myJsonAbc.sort('{ c: 0, b: 1, a: 0 }', true); + +myJsonAbc.cleanJSON('{ c: 0, b: 1, a: 0 }'); diff --git a/types/jsonabc/tsconfig.json b/types/jsonabc/tsconfig.json new file mode 100644 index 0000000000..072c667a18 --- /dev/null +++ b/types/jsonabc/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", + "jsonabc-tests.ts" + ] +} diff --git a/types/jsonabc/tslint.json b/types/jsonabc/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsonabc/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsonapi-serializer/index.d.ts b/types/jsonapi-serializer/index.d.ts new file mode 100644 index 0000000000..4d9344bc28 --- /dev/null +++ b/types/jsonapi-serializer/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for jsonapi-serializer 3.6 +// Project: https://github.com/SeyZ/jsonapi-serializer#readme +// Definitions by: Frank Chiang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 + +export type RefFunction = (current: any, item: any) => string; + +export interface Relation { + ref: string | RefFunction; + attributes?: string[]; + included?: boolean; +} + +export interface SerializerOptions { + ref?: (() => void) | boolean | string; + included?: boolean; + id?: string; + attributes?: string[]; + topLevelLinks?: string[] | Array<() => void>; + dataLinks?: string[] | Array<() => void>; + dataMeta?: (() => void) | object; + relationshipLinks?: object; + relationshipMeta?: object; + ignoreRelationshipData?: boolean; + keyForAttribute?: string | KeyForAttribute; + nullIfMissing?: boolean; + pluralizeType?: boolean; + typeForAttribute?: TypeForAttribute; + meta?: object; + transform?: (() => void); +} + +export interface KeyForAttribute { + (attribute: string): string; +} + +export interface TypeForAttribute { + (attribute: string, object?: any): any; +} + +export interface Transform { + (record: any): any; +} + +export interface DeserializerOptions { + id?: string; + keyForAttribute?: + | "dash-case" + | "lisp-case" + | "spinal-case" + | "kebab-case" + | "underscore_case" + | "snake_case" + | "camelCase" + | "CamelCase"; + pluralizeType?: boolean; + typeAsAttribute?: boolean; + transform?: Transform; +} + +export interface DeserializerConstructor { + new (opts: DeserializerOptions): Deserializer; +} + +export interface SerializerConstructor { + new (collectionName: string, opts: SerializerOptions): Serializer; +} + +export interface ErrorConstructor { + new (opts: JSONAPIErrorOptions | JSONAPIErrorOptions[]): JSONAPIError; +} + +export interface JSONAPIError { + errors: any[]; +} + +export interface JSONAPIErrorOptions { + id?: string; + status?: string; + code?: string; + title?: string; + detail?: string; + source?: { + pointer?: string; + parameter?: string; + }; + links?: { + about?: string; + }; + meta?: any; +} + +export interface Serializer { + serialize(data: any): any; +} + +export interface Deserializer { + deserialize(data: any, callback: Callback): void; + + deserialize(data: any): Promise; +} + +export interface Callback { + (error: Error, response: any): any; +} + +export let Serializer: SerializerConstructor; +export let Deserializer: DeserializerConstructor; +export let Error: ErrorConstructor; diff --git a/types/jsonapi-serializer/jsonapi-serializer-tests.ts b/types/jsonapi-serializer/jsonapi-serializer-tests.ts new file mode 100644 index 0000000000..cd560cca77 --- /dev/null +++ b/types/jsonapi-serializer/jsonapi-serializer-tests.ts @@ -0,0 +1,37 @@ +import { Serializer, Deserializer, Error } from "jsonapi-serializer"; + +declare let firstName: string; +declare let lastName: string; + +const UserSerializer = new Serializer("users", { + id: "id", + attributes: ["firstName", "lastName"], + keyForAttribute: "camelCase", + pluralizeType: false +}); + +const users = UserSerializer.serialize({ firstName, lastName }); + +const UserDeserializer = new Deserializer({ + id: "id", + keyForAttribute: "camelCase", + pluralizeType: false, + typeAsAttribute: true +}); + +UserDeserializer.deserialize(users); + +new Error({ + code: "_code", + detail: "_detail", + id: "_id", + links: { + about: "_about" + }, + source: { + parameter: "_parameter", + pointer: "_pointer" + }, + status: "_status", + title: "_title" +}); diff --git a/types/jsonapi-serializer/tsconfig.json b/types/jsonapi-serializer/tsconfig.json new file mode 100644 index 0000000000..eeea88010a --- /dev/null +++ b/types/jsonapi-serializer/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "jsonapi-serializer-tests.ts"] +} diff --git a/types/jsonapi-serializer/tslint.json b/types/jsonapi-serializer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsonapi-serializer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsonfile/index.d.ts b/types/jsonfile/index.d.ts index 62227c9e84..cc0009ece3 100644 --- a/types/jsonfile/index.d.ts +++ b/types/jsonfile/index.d.ts @@ -1,60 +1,71 @@ -// Type definitions for jsonfile 4.0 +// Type definitions for jsonfile 5.0 // Project: https://github.com/jprichardson/node-jsonfile#readme // Definitions by: Daniel Bowring +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// import { Url } from 'url'; +import { + PathLike, + readFile as fsReadFile, + readFileSync as fsReadFileSync, + writeFile as fsWriteFile, + writeFileSync as fsWriteFileSync, +} from 'fs'; -export type FSReadOptions = { - encoding?: null; - flag?: string; - } | null | undefined; -export type FSWriteOptions = string | { - encoding?: string | null; - mode?: string | number; - flag?: string; - } | null | undefined; - -export type ReadCallback = (err: NodeJS.ErrnoException | null, data: Buffer) => void; -export type WriteCallback = (err: NodeJS.ErrnoException) => void; -export type Path = string | number | Buffer | Url; +export type Path = PathLike | Url; export interface FS { - readFile(path: Path, options: FSReadOptions, callback: ReadCallback): void; - readFileSync(path: Path, options?: FSReadOptions): Buffer; - writeFile(path: Path, data: any, options: FSWriteOptions, callback: WriteCallback): void; - writeFileSync(path: Path, data: any, options?: FSWriteOptions): void; + readFile: typeof fsReadFile; + readFileSync: typeof fsReadFileSync; + writeFile: typeof fsWriteFile; + writeFileSync: typeof fsWriteFileSync; } -export type JFReadOptions = { - encoding?: null; - flag?: string; - throws?: boolean; - fs?: FS; - reviver?: (key: any, value: any) => any; - } | null | undefined; +export type JFReadOptions = + | { + encoding?: string | null; + flag?: string; + throws?: boolean; + fs?: FS; + reviver?: (key: any, value: any) => any; + } + | string + | null + | undefined; -export type JFWriteOptions = string | { - encoding?: string | null; - mode?: string | number; - flag?: string; - throws?: boolean; - fs?: FS; - EOL?: string; - spaces?: string | number; - replacer?: (key: string, value: any) => any; - } | null; +export type JFWriteOptions = + | { + encoding?: string | null; + mode?: string | number; + flag?: string; + fs?: FS; + EOL?: string; + spaces?: string | number; + replacer?: (key: string, value: any) => any; + } + | string + | null; -export type JFReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void; +export type ReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void; +export type WriteCallback = (err: NodeJS.ErrnoException) => void; -export function readFile(file: Path, options?: JFReadOptions, callback?: JFReadCallback): void; -export function readFile(file: Path, callback: JFReadCallback): void; +export function readFile(file: Path, options: JFReadOptions, callback: ReadCallback): void; +export function readFile(file: Path, callback: ReadCallback): void; +export function readFile(file: Path, options?: JFReadOptions): Promise; export function readFileSync(file: Path, options?: JFReadOptions): any; -export function writeFile(file: Path, obj: any, options?: JFWriteOptions, callback?: WriteCallback): void; +export function writeFile( + file: Path, + obj: any, + options: JFWriteOptions, + callback: WriteCallback +): void; export function writeFile(file: Path, obj: any, callback: WriteCallback): void; +export function writeFile(file: Path, obj: any, options?: JFWriteOptions): Promise; export function writeFileSync(file: Path, obj: any, options?: JFWriteOptions): void; diff --git a/types/jsonfile/jsonfile-tests.ts b/types/jsonfile/jsonfile-tests.ts index 675a32d8b9..4725e3c8a3 100644 --- a/types/jsonfile/jsonfile-tests.ts +++ b/types/jsonfile/jsonfile-tests.ts @@ -1,34 +1,67 @@ -// Following are lifted from the samples on the NPM page, modified to pass -// the linter - import * as jsonfile from 'jsonfile'; const file = '/tmp/data.json'; -const obj = {name: 'JP'}; +const obj = { name: 'JP' }; -jsonfile.readFile(file, (err: NodeJS.ErrnoException | null, obj: any) => { - console.dir(obj); +// $ExpectType void +jsonfile.readFile(file, { encoding: 'utf8', throws: true }, (err, obj) => { + // $ExpectType ErrnoException | null + err; + // $ExpectType any + obj; }); -console.dir(jsonfile.readFileSync(file)); - -jsonfile.writeFile(file, obj, (err: NodeJS.ErrnoException) => { - console.error(err); +// $ExpectType void +jsonfile.readFile(file, (err, obj) => { + // $ExpectType ErrnoException | null + err; + // $ExpectType any + obj; }); -jsonfile.writeFile(file, obj, {spaces: 2}, (err: NodeJS.ErrnoException) => { - console.error(err); +jsonfile.readFile(file).then(obj => { + // $ExpectType any + obj; +}); +jsonfile.readFile(file, { encoding: 'utf8', throws: true }).then(obj => { + // $ExpectType any + obj; }); -jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, (err: NodeJS.ErrnoException) => { - console.error(err); +// $ExpectType any +jsonfile.readFileSync(file); +jsonfile.readFileSync(file, { encoding: 'utf8', throws: true }); + +// $ExpectType void +jsonfile.writeFile(file, obj, err => { + // $ExpectType ErrnoException + err; }); -jsonfile.writeFile(file, obj, {flag: 'a'}, (err: NodeJS.ErrnoException) => { - console.error(err); +// $ExpectType void +jsonfile.writeFile(file, obj, { spaces: 2 }, err => { + // $ExpectType ErrnoException + err; }); +// $ExpectType void +jsonfile.writeFile(file, obj, { spaces: 2, EOL: '\r\n' }, err => { + // $ExpectType ErrnoException + err; +}); + +// $ExpectType void +jsonfile.writeFile(file, obj, { flag: 'a' }, err => { + // $ExpectType ErrnoException + err; +}); + +// $ExpectType Promise +jsonfile.writeFile(file, obj); +// $ExpectType Promise +jsonfile.writeFile(file, obj, { flag: 'a' }); + jsonfile.writeFileSync(file, obj); -jsonfile.writeFileSync(file, obj, {spaces: 2}); -jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'}); -jsonfile.writeFileSync(file, obj, {flag: 'a'}); +jsonfile.writeFileSync(file, obj, { spaces: 2 }); +jsonfile.writeFileSync(file, obj, { spaces: 2, EOL: '\r\n' }); +jsonfile.writeFileSync(file, obj, { flag: 'a' }); diff --git a/types/jsonfile/v4/index.d.ts b/types/jsonfile/v4/index.d.ts new file mode 100644 index 0000000000..62227c9e84 --- /dev/null +++ b/types/jsonfile/v4/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for jsonfile 4.0 +// Project: https://github.com/jprichardson/node-jsonfile#readme +// Definitions by: Daniel Bowring +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Url } from 'url'; + +export type FSReadOptions = { + encoding?: null; + flag?: string; + } | null | undefined; +export type FSWriteOptions = string | { + encoding?: string | null; + mode?: string | number; + flag?: string; + } | null | undefined; + +export type ReadCallback = (err: NodeJS.ErrnoException | null, data: Buffer) => void; +export type WriteCallback = (err: NodeJS.ErrnoException) => void; +export type Path = string | number | Buffer | Url; + +export interface FS { + readFile(path: Path, options: FSReadOptions, callback: ReadCallback): void; + readFileSync(path: Path, options?: FSReadOptions): Buffer; + writeFile(path: Path, data: any, options: FSWriteOptions, callback: WriteCallback): void; + writeFileSync(path: Path, data: any, options?: FSWriteOptions): void; +} + +export type JFReadOptions = { + encoding?: null; + flag?: string; + throws?: boolean; + fs?: FS; + reviver?: (key: any, value: any) => any; + } | null | undefined; + +export type JFWriteOptions = string | { + encoding?: string | null; + mode?: string | number; + flag?: string; + throws?: boolean; + fs?: FS; + EOL?: string; + spaces?: string | number; + replacer?: (key: string, value: any) => any; + } | null; + +export type JFReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void; + +export function readFile(file: Path, options?: JFReadOptions, callback?: JFReadCallback): void; +export function readFile(file: Path, callback: JFReadCallback): void; + +export function readFileSync(file: Path, options?: JFReadOptions): any; + +export function writeFile(file: Path, obj: any, options?: JFWriteOptions, callback?: WriteCallback): void; +export function writeFile(file: Path, obj: any, callback: WriteCallback): void; + +export function writeFileSync(file: Path, obj: any, options?: JFWriteOptions): void; diff --git a/types/jsonfile/v4/jsonfile-tests.ts b/types/jsonfile/v4/jsonfile-tests.ts new file mode 100644 index 0000000000..675a32d8b9 --- /dev/null +++ b/types/jsonfile/v4/jsonfile-tests.ts @@ -0,0 +1,34 @@ +// Following are lifted from the samples on the NPM page, modified to pass +// the linter + +import * as jsonfile from 'jsonfile'; + +const file = '/tmp/data.json'; +const obj = {name: 'JP'}; + +jsonfile.readFile(file, (err: NodeJS.ErrnoException | null, obj: any) => { + console.dir(obj); +}); + +console.dir(jsonfile.readFileSync(file)); + +jsonfile.writeFile(file, obj, (err: NodeJS.ErrnoException) => { + console.error(err); +}); + +jsonfile.writeFile(file, obj, {spaces: 2}, (err: NodeJS.ErrnoException) => { + console.error(err); +}); + +jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, (err: NodeJS.ErrnoException) => { + console.error(err); +}); + +jsonfile.writeFile(file, obj, {flag: 'a'}, (err: NodeJS.ErrnoException) => { + console.error(err); +}); + +jsonfile.writeFileSync(file, obj); +jsonfile.writeFileSync(file, obj, {spaces: 2}); +jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'}); +jsonfile.writeFileSync(file, obj, {flag: 'a'}); diff --git a/types/jsonfile/v4/tsconfig.json b/types/jsonfile/v4/tsconfig.json new file mode 100644 index 0000000000..e6505d789e --- /dev/null +++ b/types/jsonfile/v4/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "jsonfile": [ + "jsonfile/v4" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "jsonfile-tests.ts" + ] +} diff --git a/types/jsonfile/v4/tslint.json b/types/jsonfile/v4/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsonfile/v4/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/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/jssha/index.d.ts b/types/jssha/index.d.ts index 45d6686aed..e717e23f17 100644 --- a/types/jssha/index.d.ts +++ b/types/jssha/index.d.ts @@ -1,81 +1,81 @@ -// Type definitions for jsSHA +// Type definitions for jsSHA 2.0 // Project: https://github.com/Caligatio/jsSHA -// Definitions by: David Li , Tobias Kahlert +// Definitions by: David Li +// Tobias Kahlert +// Kannan Goundan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - declare namespace jsSHA { + type StringDataFormat = 'HEX' | 'TEXT' | 'B64' | 'BYTES'; + type ArrayBufferDataFormat = 'ARRAYBUFFER'; - export interface EncodingOptions { - encoding? : string; + interface EncodingOptions { + encoding?: string; } - export interface Options extends EncodingOptions { - numRounds? : number; + interface Options extends EncodingOptions { + numRounds?: number; } - export interface OutputFormatOptions { - outputUpper? : boolean; - b64Pad? : string; + interface OutputFormatOptions { + outputUpper?: boolean; + b64Pad?: string; + shakeLen?: number; } - export interface jsSHA { + interface jsSHA { /** - * jsSHA is the workhorse of the library. Instantiate it with the string to - * be hashed as the parameter + * Create a Hasher object. * - * @param {string} variant The desired SHA variant (SHA-1, SHA-224, SHA-256, - * SHA-384, or SHA-512) - * @param {string} inputFormat The format of srcString: HEX, TEXT, B64, or BYTES - * @param {{encoding: (string|undefined), numRounds: (string|undefined)}=} - * options Optional values + * @param variant - The desired SHA variant (SHA-1, SHA-224, SHA-256, + * SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128, or SHAKE256). + * @param inputFormat The format of srcString. */ - new (variant:string, inputFormat:string, options?:Options):jsSHA; + new(variant: string, inputFormat: StringDataFormat, options?: Options): Hasher; + new(variant: string, inputFormat: ArrayBufferDataFormat, options?: Options): Hasher; + } + + interface Hasher { + /** + * Sets the HMAC key for an eventual getHMAC call. Must be called + * immediately after jsSHA object instantiation + * + * @param key - The key used to calculate the HMAC. + * @param inputFormat - The format of key. + */ + setHMACKey(key: string, inputFormat: StringDataFormat, encodingOpts?: EncodingOptions): void; + setHMACKey(key: ArrayBuffer, inputFormat: ArrayBufferDataFormat, encodingOpts?: EncodingOptions): void; /** - * Sets the HMAC key for an eventual getHMAC call. Must be called - * immediately after jsSHA object instantiation - * - * @param {string} key The key used to calculate the HMAC - * @param {string} inputFormat The format of key, HEX, TEXT, B64, or BYTES - * @param {{encoding : (string|undefined)}=} encodingOpts Associative array - * of input format options - */ - setHMACKey(key:string, inputFormat:string, encodingOpts?:EncodingOptions):void; + * Takes strString and hashes as many blocks as possible. Stores the + * rest for either a future update or getHash call. + * + * @param srcString - The string to be hashed + */ + update(srcString: InputT): void; /** - * Takes strString and hashes as many blocks as possible. Stores the - * rest for either a future update or getHash call. - * - * @param {string} srcString The string to be hashed - */ - update(srcString:string):void; - + * Returns the desired SHA hash of the string specified at instantiation + * using the specified parameters + * + * @expose + * @param format - The desired output formatting. + * @returns The string representation of the hash + * in the format specified. + */ + getHash(format: StringDataFormat, outputFormatOpts?: OutputFormatOptions): string; + getHash(format: ArrayBufferDataFormat, outputFormatOpts?: OutputFormatOptions): ArrayBuffer; /** - * Returns the desired SHA hash of the string specified at instantiation - * using the specified parameters - * - * @param {string} format The desired output formatting (B64, HEX, or BYTES) - * @param {{outputUpper : (boolean|undefined), b64Pad : (string|undefined)}=} - * outputFormatOpts Hash list of output formatting options - * @return {string} The string representation of the hash in the format - * specified - */ - getHash(format:string, outputFormatOpts?:OutputFormatOptions):string; - - /** - * Returns the the HMAC in the specified format using the key given by - * a previous setHMACKey call. - * - * @param {string} format The desired output formatting - * (B64, HEX, or BYTES) - * @param {{outputUpper : (boolean|undefined), b64Pad : (string|undefined)}=} - * outputFormatOpts associative array of output formatting options - * @return {string} The string representation of the hash in the format - * specified - */ - getHMAC(format:string, outputFormatOpts?:OutputFormatOptions):string; + * Returns the the HMAC in the specified format using the key given by + * a previous setHMACKey call. + * + * @param format - The desired output formatting. + * @returns The string representation of the hash in the format + * specified + */ + getHMAC(format: StringDataFormat, outputFormatOpts?: OutputFormatOptions): string; + getHMAC(format: ArrayBufferDataFormat, outputFormatOpts?: OutputFormatOptions): ArrayBuffer; } } diff --git a/types/jssha/jssha-tests.ts b/types/jssha/jssha-tests.ts index bbff8dedca..c4df337ea8 100644 --- a/types/jssha/jssha-tests.ts +++ b/types/jssha/jssha-tests.ts @@ -1,53 +1,56 @@ import imported = require("jssha"); // constructor -let shaObj1 = new imported("SHA-512", "TEXT"); -let shaObj2 = new imported("SHA-512", "TEXT", { }); -let shaObj3 = new imported("SHA-512", "TEXT", { encoding: "UTF8" }); -let shaObj4 = new imported("SHA-512", "TEXT", { numRounds: 1 }); -let shaObj5 = new imported("SHA-512", "TEXT", { encoding: "UTF8", numRounds: 1 }); +const shaObj1 = new imported("SHA-512", "TEXT"); +const shaObj2 = new imported("SHA-512", "TEXT", { }); +const shaObj3 = new imported("SHA-512", "TEXT", { encoding: "UTF8" }); +const shaObj4 = new imported("SHA-512", "TEXT", { numRounds: 1 }); +const shaObj5 = new imported("SHA-512", "TEXT", { encoding: "UTF8", numRounds: 1 }); +const shakeObj = new imported("SHAKE256", "ARRAYBUFFER"); // setHMACKey shaObj1.setHMACKey("key", "TEXT"); shaObj2.setHMACKey("key", "TEXT", { }); shaObj3.setHMACKey("key", "TEXT", { encoding: "UTF8" }); +shaObj3.setHMACKey(new ArrayBuffer(10), "ARRAYBUFFER"); // update shaObj1.update("This is a test"); +shakeObj.update(new ArrayBuffer(10)); // getHash -let hash1:string = shaObj4.getHash("HEX"); -let hash2:string = shaObj4.getHash("HEX", {}); -let hash3:string = shaObj4.getHash("HEX", { b64Pad: "=" }); -let hash4:string = shaObj4.getHash("HEX", { outputUpper: true }); -let hash5:string = shaObj4.getHash("HEX", { outputUpper: true, b64Pad: '=' }); +const hash1: string = shaObj4.getHash("HEX"); +const hash2: string = shaObj4.getHash("HEX", {}); +const hash3: string = shaObj4.getHash("HEX", { b64Pad: "=" }); +const hash4: string = shaObj4.getHash("HEX", { outputUpper: true }); +const hash5: string = shaObj4.getHash("HEX", { outputUpper: true, b64Pad: '=' }); +const hash6: ArrayBuffer = shakeObj.getHash("ARRAYBUFFER", { shakeLen: 128 }); // getHMAC -let hmac1:string = shaObj1.getHMAC("HEX"); -let hmac2:string = shaObj1.getHMAC("HEX", {}); -let hmac3:string = shaObj1.getHMAC("HEX", { b64Pad: "=" }); -let hmac4:string = shaObj1.getHMAC("HEX", { outputUpper: true }); -let hmac5:string = shaObj1.getHMAC("HEX", { outputUpper: true, b64Pad: '=' }); - +const hmac1: string = shaObj1.getHMAC("HEX"); +const hmac2: string = shaObj1.getHMAC("HEX", {}); +const hmac3: string = shaObj1.getHMAC("HEX", { b64Pad: "=" }); +const hmac4: string = shaObj1.getHMAC("HEX", { outputUpper: true }); +const hmac5: string = shaObj1.getHMAC("HEX", { outputUpper: true, b64Pad: '=' }); +const hmac6: ArrayBuffer = shaObj1.getHMAC("ARRAYBUFFER", { shakeLen: 128 }); // examples from the readme.md (https://github.com/Caligatio/jsSHA/blob/v2.0.2/README.md) { - var shaObj = new imported("SHA-512", "TEXT"); + const shaObj = new imported("SHA-512", "TEXT"); shaObj.update("This is a test"); - var hash = shaObj.getHash("HEX"); + const hash = shaObj.getHash("HEX"); } - { - let shaObj = new imported("SHA-256", "TEXT"); + const shaObj = new imported("SHA-256", "TEXT"); shaObj.setHMACKey("abc", "TEXT"); shaObj.update("This is a test"); - let hmac = shaObj.getHMAC("HEX"); + const hmac = shaObj.getHMAC("HEX"); } // Browser global test { - var shaObj = new imported("SHA-512", "TEXT"); + const shaObj = new imported("SHA-512", "TEXT"); shaObj.update("This is a test"); - var hash = shaObj.getHash("HEX"); -} \ No newline at end of file + const hash = shaObj.getHash("HEX"); +} diff --git a/types/jssha/tsconfig.json b/types/jssha/tsconfig.json index 9e54d3c27a..c97f7cc2b8 100644 --- a/types/jssha/tsconfig.json +++ b/types/jssha/tsconfig.json @@ -10,7 +10,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/jssha/tslint.json b/types/jssha/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/jssha/tslint.json +++ b/types/jssha/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/junk/index.d.ts b/types/junk/index.d.ts new file mode 100644 index 0000000000..390847e1c0 --- /dev/null +++ b/types/junk/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for junk 2.1 +// Project: https://github.com/sindresorhus/junk#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Returns `true` if `filename` matches a junk file. + */ +export function is(filename: string): boolean; +/** + * Returns `true` if `filename` doesn't match a junk file. + */ +export function not(filename: string): boolean; +/** + * Regex used for matching. + */ +export const regex: RegExp; diff --git a/types/junk/junk-tests.ts b/types/junk/junk-tests.ts new file mode 100644 index 0000000000..848eded660 --- /dev/null +++ b/types/junk/junk-tests.ts @@ -0,0 +1,12 @@ +/// + +import fs = require('fs'); +import * as junk from 'junk'; + +junk.is('foo'); // $ExpectType boolean +junk.not('foo'); // $ExpectType boolean +junk.regex; // $ExpectType RegExp + +fs.readdir('some/path', (err, files) => { + files.filter(junk.not); +}); diff --git a/types/junk/tsconfig.json b/types/junk/tsconfig.json new file mode 100644 index 0000000000..06710a9591 --- /dev/null +++ b/types/junk/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", + "junk-tests.ts" + ] +} diff --git a/types/junk/tslint.json b/types/junk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/junk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 6481b59faf..91f0d455cc 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -1,481 +1,382 @@ -// Type definitions for JW Player V8.2 -// Project: https://github.com/jwplayer/jwplayer/ +// Type definitions for JW Player 8.2 +// Project: https://github.com/jwplayer/jwplayer // Definitions by: Martin Duparc // Tomer Kruvi // Philipp Gürtler // Daniel McGraw // Benjamin Dobson +// Be Birchall +// Daniel Cassidy +// Drew Wyatt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 // JW Player is the leading HTML5 & Flash video player, optimized for mobile and the desktop. Easy enough for beginners, advanced enough for pros. -interface Version { - version: string; - major: number; - minor: number +declare namespace jwplayer { + interface Version { + version: string; + major: number; + minor: number; + } + + interface Browser { + chrome: boolean; + edge: boolean; + facebook: boolean; + firefox: boolean; + ie: boolean; + msie: boolean; + safari: boolean; + version: Version; + } + + interface OS { + android: boolean; + androidNative: boolean; // Android native browser + iOS: boolean; + mobile: boolean; + mac: boolean; + iPad: boolean; + iPhone: boolean; + windows: boolean; + version: Version; + } + + interface Features { + flash: boolean; + flashVersion: number; + iframe: boolean; + } + + interface Environment { + Browser: Browser; + OS: OS; + Features: Features; + } + + interface AdProgressParam { + client: 'vast' | 'googima'; + creativetype: string; + tag: string; + } + + interface AdCompanionsParam { + companions: any[]; + tag: string; + } + + interface AdErrorParam { + message: string; + tag: string; + } + + interface AdRequestParam { + adposition: 'pre' | 'mid' | 'post'; + client: 'vast' | 'googima'; + offset: 'pre' | 'mid' | 'post'; + tag: string; + } + + interface AdImpressionParam { + adposition: 'pre' | 'mid' | 'post'; + adsystem: string; + adtitle: string; + clickThroughUrl: string; + client: 'vast' | 'googima'; + creativetype: string; + linear: string; + mediafile: any; + tag: string; + vastversion: number; + wrapper: any[]; + } + + interface AdScheduleParam { + tag: string; + client: string; + adbreaks: object[]; + } + + interface AdStartedParam { + creativetype: string; + tag: string; + } + + interface AdPlayParam { + creativetype: string; + newstate: string; + oldstate: string; + tag: string; + } + + interface BufferParam { + newstate: string; + oldstate: string; + reason: 'loading' | 'complete' | 'stalled' | 'error'; + } + + interface BufferChangeParam { + duration: number; + bufferPercent: number; + position: number; + metadata: any; + } + + interface AdTimeParam { + client: 'vast' | 'googima'; + creativetype: string; + duration: number; + position: number; + sequence: number; + tag: string; + } + + interface AudioTracksParam { + levels: any[]; + } + + interface CaptionsChangedParam { + currentTrack: number; + } + + interface CaptionsListParam { + tracks: any[]; + } + + interface AudioTrackChangedParam { + currentTrack: number; + } + + interface MetadataParam { + metadata: any; + } + + interface ControlsParam { + controls: boolean; + } + + interface ErrorParam { + message: string; + } + + interface FullscreenParam { + fullscreen: boolean; + } + + interface IdleParam { + oldstate: 'buffering' | 'playing' | 'paused'; + } + + interface LevelsChangedParam { + currentQuality: number; + } + + interface MuteParam { + mute: boolean; + } + + interface VolumeParam { + volume: boolean; + } + + interface PlayParam { + oldstate: 'buffering' | 'playing'; + viewable: 0 | 1; + } + + interface PlaylistParam { + playlist: any[]; + } + + interface PlaylistItemParam { + index: number; + item: any; + } + + interface ReadyParam { + setupTime: number; + viewable: 0 | 1; + } + + interface ResizeParam { + width: number; + height: number; + } + + interface VisualQualityParam { + mode: string; + label: string; + reason: string; + } + + interface LevelsParam { + width: number; + levels: any[]; + } + + interface SeekParam { + position: number; + offset: number; + } + + interface TimeParam { + duration: number; + position: number; + viewable: 0 | 1; + } + + interface FirstFrameParam { + loadTime: number; + viewable: 0 | 1; + } + + type EventCallback = (param: T) => void; + + interface Region { + x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion + y: 0; + width: number; + height: number; + } + + interface CaptionOptions { + color: string; + fontSize: number; + fontFamily: string; + fontOpacity: number; + backgroundColor: string; + backgroundOpacity: number; + edgeStyle: string; + windowColor: string; + windowOpacity: number; + } + + interface Level { + bitrate: number; + height: number; + width: number; + label: string; + } + + interface QualityLevel { + mode: 'auto' | 'manual'; + level: Level; + reason: 'auto' | 'api' | 'initial choice'; + } + + interface CastParam { + available: boolean; + active: boolean; + deviceName: string; + type: 'cast'; + } + + interface EventParams { + adClick: AdProgressParam; + adCompanions: AdCompanionsParam; + adComplete: AdProgressParam; + adSkipped: AdProgressParam; + adError: AdErrorParam; + adRequest: AdRequestParam; + adSchedule: AdScheduleParam; + adStarted: AdStartedParam; + adImpression: AdImpressionParam; + adPlay: AdPlayParam; + adPause: AdPlayParam; + adTime: AdTimeParam; + cast: CastParam; + meta: MetadataParam; + audioTracks: AudioTracksParam; + audioTrackChanged: AudioTrackChangedParam; + firstFrame: FirstFrameParam; + buffer: BufferParam; + bufferChange: BufferChangeParam; + captionsChanged: CaptionsChangedParam; + captionsList: CaptionsListParam; + controls: ControlsParam; + error: ErrorParam; + fullscreen: FullscreenParam; + idle: IdleParam; + levelsChanged: LevelsChangedParam; + mute: MuteParam; + volume: VolumeParam; + pause: PlayParam; + play: PlayParam; + playlist: PlaylistParam; + playlistItem: PlaylistItemParam; + ready: ReadyParam; + resize: ResizeParam; + visualQuality: VisualQualityParam; + levels: LevelsParam; + seek: SeekParam; + setupError: ErrorParam; + time: TimeParam; + } + + type NoParamEvent = 'adBlock' | 'beforeComplete' | 'complete' | 'beforePlay' | 'displayClick' | 'playlistComplete' + | 'seeked' | 'remove'; + + interface JWPlayer { + addButton(icon: string, label: string, handler: () => void, id: string): void; + getAudioTracks(): any[]; + getBuffer(): number; + getCaptionsList(): any[]; + getControls(): boolean; + getCurrentAudioTrack(): number; + getCurrentCaptions(): number; + getCurrentQuality(): number; + getDuration(): number; + getHeight(): number; + getFullscreen(): boolean; + getMute(): boolean; + getPlaylist(): any[]; + getPlaylistIndex(): number; + getPlaylistItem(index?: number): any; + getPosition(): number; + getQualityLevels(): any[]; + getRenderingMode(): string; + getSafeRegion(): Region; + getState(): string; + getVolume(): number; + getContainer(): HTMLElement; + getEnvironment(): Environment; + getWidth(): number; + getVisualQuality(): QualityLevel | undefined; + load(playlist: any[] | string): void; + on(event: TEvent, callback: EventCallback): void; + on(event: NoParamEvent, callback: () => void): void; + once(event: TEvent, callback: EventCallback): void; + once(event: NoParamEvent, callback: () => void): void; + off(event: keyof EventParams | NoParamEvent): void; + trigger(event: TEvent, args: EventParams[TEvent]): void; + trigger(event: NoParamEvent): void; + pause(state?: boolean): void; + play(state?: boolean): void; + playAd(tag: string): void; + playlistItem(index: number): void; + registerPlugin(id: string, target: string, jsPlugin: () => void, swfURL?: string): void; + remove(): void; + removeButton(id: string): void; + resize(width: number, height: number): void; + seek(position: number): void; + setControls(controls: boolean): void; + setCurrentAudioTrack(index: number): void; + setCurrentCaptions(index: number): void; + setCurrentQuality(index: number): void; + setFullscreen(state: boolean): void; + setMute(state?: boolean): void; + setup(options: any): JWPlayer; + setVolume(volume: number): void; + setCaptions(options: CaptionOptions): void; + stop(): void; + } + + interface JWPlayerStatic { + (query?: string | number | Element): JWPlayer; + key: string; + version: string; + } } -interface Browser { - chrome: boolean; - edge: boolean; - facebook: boolean; - firefox: boolean; - ie: boolean; - msie: boolean; - safari: boolean; - version: Version; -} - -interface OS { - android: boolean; - androidNative: boolean; // Android native browser - iOS: boolean; - mobile: boolean; - mac: boolean; - iPad: boolean; - iPhone: boolean; - windows: boolean; - version: Version; -} - -interface Features { - flash: boolean; - flashVersion: number; - iframe: boolean; -} - -interface Environment{ - Browser: Browser; - OS: OS; - Features: Features; -} - -interface CallbackParam { -} - -interface AdProgressParam extends CallbackParam { - client: 'vast' | 'googima'; - creativetype: string; - tag: string; -} - -interface AdCompanionsParam extends CallbackParam { - companions: any[]; - tag: string; -} - -interface AdErrorParam extends CallbackParam { - message: string; - tag: string; -} - -interface AdRequestParam extends CallbackParam { - adposition: 'pre' | 'mid' | 'post'; - client: 'vast' | 'googima'; - offset: 'pre' | 'mid' | 'post'; - tag: string; -} - -interface AdImpressionParam extends CallbackParam { - adposition: 'pre' | 'mid' | 'post'; - adsystem: string; - adtitle: string; - clickThroughUrl: string; - client: 'vast' | 'googima'; - creativetype: string; - linear: string; - mediafile: any; - tag: string; - vastversion: number; - wrapper: any[]; -} - -interface AdScheduleParam extends CallbackParam { - tag: string; - client: string; - adbreaks: object[]; -} - -interface AdStartedParam extends CallbackParam { - creativetype: string; - tag: string; -} - -interface AdPlayParam extends CallbackParam { - creativetype: string; - newstate: string; - oldstate: string; - tag: string; -} - -interface BufferParam extends CallbackParam { - newstate: string; - oldstate: string; - reason: 'loading' | 'complete' | 'stalled' | 'error'; -} - -interface BufferChangeParam extends CallbackParam { - duration: number; - bufferPercent: number; - position: number; - metadata: any; -} - -interface AdTimeParam extends CallbackParam { - client: 'vast' | 'googima'; - creativetype: string; - duration: number; - position: number; - sequence: number; - tag: string; -} - -interface AudioTracksParam extends CallbackParam { - levels: any[]; -} - -interface CaptionsChangedParam extends CallbackParam { - currentTrack: number; -} - -interface CaptionsListParam extends CallbackParam { - tracks: any[]; -} - -interface AudioTrackChangedParam extends CallbackParam { - currentTrack: number; -} - -interface MetadataParam extends CallbackParam { - metadata: any; -} - -interface ControlsParam extends CallbackParam { - controls: boolean; -} - -interface ErrorParam extends CallbackParam { - message: string; -} - -interface FullscreenParam extends CallbackParam { - fullscreen: boolean; -} - -interface IdleParam extends CallbackParam { - oldstate: 'buffering' | 'playing' | 'paused'; -} - -interface LevelsChangedParam extends CallbackParam { - currentQuality: number; -} - -interface MuteParam extends CallbackParam { - mute: boolean; -} - -interface VolumeParam extends CallbackParam { - volume: boolean; -} - -interface PlayParam extends CallbackParam { - oldstate: 'buffering' | 'playing'; - viewable: 0 | 1; -} - -interface PlaylistParam extends CallbackParam { - playlist: any[]; -} - -interface PlaylistItemParam extends CallbackParam { - index: number; - item: any; -} - -interface ReadyParam extends CallbackParam { - setupTime: number; - viewable: 0 | 1; -} - -interface ResizeParam extends CallbackParam { - width: number; - height: number; -} - -interface VisualQualityParam extends CallbackParam { - mode: string; - label: string; - reason: string; -} - -interface LevelsParam extends CallbackParam { - width: number; - levels: any[]; -} - -interface SeekParam extends CallbackParam { - position: number; - offset: number; -} - -interface TimeParam extends CallbackParam { - duration: number; - position: number; - viewable: 0 | 1; -} - -interface FirstFrameParam extends CallbackParam { - loadTime: number; - viewable: 0 | 1; -} - -interface EventCallback { - (param: T): void; -} - -interface Region { - x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion - y: 0; - width: number; - height: number; -} - -interface JWPlayer { - addButton(icon: string, label: string, handler: () => void, id: string): void; - getAudioTracks(): any[]; - getBuffer(): number; - getCaptionsList(): any[]; - getControls(): boolean; - getCurrentAudioTrack(): number; - getCurrentCaptions(): number; - getCurrentQuality(): number; - getDuration(): number; - getHeight(): number; - getFullscreen(): boolean; - getMute(): boolean; - getPlaylist(): any[]; - getPlaylistIndex(): number; - getPlaylistItem(index?: number): any; - getPosition(): number; - getQualityLevels(): any[]; - getRenderingMode(): string; - getSafeRegion(): Region; - getState(): string; - getVolume(): number; - getContainer(): HTMLElement; - getEnvironment(): Environment; - getWidth(): number; - load(playlist: any[]): void; - load(playlist: string): void; - on(event: 'adClick', callback: EventCallback): void; - once(event: 'adClick', callback: EventCallback): void; - off(event: 'adClick'): void; - trigger(event: 'adClick', args: AdProgressParam): void; - on(event: 'adCompanions', callback: EventCallback): void; - once(event: 'adCompanions', callback: EventCallback): void; - off(event: 'adCompanions'): void; - trigger(event: 'adCompanions', args: AdCompanionsParam): void; - on(event: 'adComplete', callback: EventCallback): void; - once(event: 'adComplete', callback: EventCallback): void; - off(event: 'adComplete'): void; - trigger(event: 'adComplete', args: AdProgressParam): void; - on(event: 'adSkipped', callback: EventCallback): void; - once(event: 'adSkipped', callback: EventCallback): void; - off(event: 'adSkipped'): void; - trigger(event: 'adSkipped', args: AdProgressParam): void; - on(event: 'adError', callback: EventCallback): void; - once(event: 'adError', callback: EventCallback): void; - off(event: 'adError'): void; - trigger(event: 'adError', args: AdErrorParam): void; - on(event: 'adBlock', callback: () => void): void; - once(event: 'adBlock', callback: () => void): void; - off(event: 'adBlock'): void; - trigger(event: 'adBlock'): void; - on(event: 'adRequest', callback: EventCallback): void; - once(event: 'adRequest', callback: EventCallback): void; - off(event: 'adRequest'): void; - trigger(event: 'adRequest', args: AdRequestParam): void; - on(event: 'adSchedule', callback: EventCallback): void; - once(event: 'adSchedule', callback: EventCallback): void; - off(event: 'adSchedule'): void; - trigger(event: 'adSchedule', args: AdScheduleParam): void; - on(event: 'adStarted', callback: EventCallback): void; - once(event: 'adStarted', callback: EventCallback): void; - off(event: 'adStarted'): void; - trigger(event: 'adStarted', args: AdStartedParam): void; - on(event: 'adImpression', callback: EventCallback): void; - once(event: 'adImpression', callback: EventCallback): void; - off(event: 'adImpression'): void; - trigger(event: 'adImpression', args: AdImpressionParam): void; - on(event: 'adPlay', callback: EventCallback): void; - once(event: 'adPlay', callback: EventCallback): void; - off(event: 'adPlay'): void; - trigger(event: 'adPlay', args: AdPlayParam): void; - on(event: 'adPause', callback: EventCallback): void; - once(event: 'adPause', callback: EventCallback): void; - off(event: 'adPause'): void; - trigger(event: 'adPause', args: AdPlayParam): void; - on(event: 'adTime', callback: EventCallback): void; - once(event: 'adTime', callback: EventCallback): void; - off(event: 'adTime'): void; - trigger(event: 'adTime', args: AdTimeParam): void; - on(event: 'meta', callback: EventCallback): void; - once(event: 'meta', callback: EventCallback): void; - off(event: 'meta'): void; - trigger(event: 'meta', args: MetadataParam): void; - on(event: 'audioTracks', callback: EventCallback): void; - once(event: 'audioTracks', callback: EventCallback): void; - off(event: 'audioTracks'): void; - trigger(event: 'audioTracks', args: AudioTracksParam): void; - on(event: 'audioTrackChanged', callback: EventCallback): void; - once(event: 'audioTrackChanged', callback: EventCallback): void; - off(event: 'audioTrackChanged'): void; - trigger(event: 'audioTrackChanged', args: AudioTrackChangedParam): void; - on(event: 'beforeComplete', callback: () => void): void; - once(event: 'beforeComplete', callback: () => void): void; - off(event: 'beforeComplete'): void; - trigger(event: 'beforeComplete'): void; - on(event: 'complete', callback: () => void): void; - once(event: 'complete', callback: () => void): void; - off(event: 'complete'): void; - trigger(event: 'complete'): void; - on(event: 'firstFrame', callback: EventCallback): void; - once(event: 'firstFrame', callback: EventCallback): void; - off(event: 'firstFrame'): void; - trigger(event: 'firstFrame', args: FirstFrameParam): void; - on(event: 'beforePlay', callback: () => void): void; - once(event: 'beforePlay', callback: () => void): void; - off(event: 'beforePlay'): void; - trigger(event: 'beforePlay'): void; - on(event: 'buffer', callback: EventCallback): void; - once(event: 'buffer', callback: EventCallback): void; - off(event: 'buffer'): void; - trigger(event: 'buffer', args: BufferParam): void; - on(event: 'bufferChange', callback: EventCallback): void; - once(event: 'bufferChange', callback: EventCallback): void; - off(event: 'bufferChange'): void; - trigger(event: 'bufferChange', args: BufferChangeParam): void; - on(event: 'captionsChanged', callback: EventCallback): void; - once(event: 'captionsChanged', callback: EventCallback): void; - off(event: 'captionsChanged'): void; - trigger(event: 'captionsChanged', args: CaptionsChangedParam): void; - on(event: 'captionsList', callback: EventCallback): void; - once(event: 'captionsList', callback: EventCallback): void; - off(event: 'captionsList'): void; - trigger(event: 'captionsList', args: CaptionsListParam): void; - on(event: 'controls', callback: EventCallback): void; - once(event: 'controls', callback: EventCallback): void; - off(event: 'controls'): void; - trigger(event: 'controls', args: ControlsParam): void; - on(event: 'displayClick', callback: () => void): void; - once(event: 'displayClick', callback: () => void): void; - off(event: 'displayClick'): void; - trigger(event: 'displayClick'): void; - on(event: 'error', callback: EventCallback): void; - once(event: 'error', callback: EventCallback): void; - off(event: 'error'): void; - trigger(event: 'error', args: ErrorParam): void; - on(event: 'fullscreen', callback: EventCallback): void; - once(event: 'fullscreen', callback: EventCallback): void; - off(event: 'fullscreen'): void; - trigger(event: 'fullscreen', args: FullscreenParam): void; - on(event: 'idle', callback: EventCallback): void; - once(event: 'idle', callback: EventCallback): void; - off(event: 'idle'): void; - trigger(event: 'idle', args: IdleParam): void; - on(event: 'levelsChanged', callback: EventCallback): void; - once(event: 'levelsChanged', callback: EventCallback): void; - off(event: 'levelsChanged'): void; - trigger(event: 'levelsChanged', args: LevelsChangedParam): void; - on(event: 'mute', callback: EventCallback): void; - once(event: 'mute', callback: EventCallback): void; - off(event: 'mute'): void; - trigger(event: 'mute', args: MuteParam): void; - on(event: 'volume', callback: EventCallback): void; - once(event: 'volume', callback: EventCallback): void; - off(event: 'volume'): void; - trigger(event: 'volume', args: VolumeParam): void; - on(event: 'pause', callback: EventCallback): void; - once(event: 'pause', callback: EventCallback): void; - off(event: 'pause'): void; - trigger(event: 'pause', args: PlayParam): void; - on(event: 'play', callback: EventCallback): void; - once(event: 'play', callback: EventCallback): void; - off(event: 'play'): void; - trigger(event: 'play', args: PlayParam): void; - on(event: 'playlist', callback: EventCallback): void; - once(event: 'playlist', callback: EventCallback): void; - off(event: 'playlist'): void; - trigger(event: 'playlist', args: PlaylistParam): void; - on(event: 'playlistItem', callback: EventCallback): void; - once(event: 'playlistItem', callback: EventCallback): void; - off(event: 'playlistItem'): void; - trigger(event: 'playlistItem', args: PlaylistItemParam): void; - on(event: 'playlistComplete', callback: () => void): void; - once(event: 'playlistComplete', callback: () => void): void; - off(event: 'playlistComplete'): void; - trigger(event: 'playlistComplete'): void; - on(event: 'ready', callback: EventCallback): void; - once(event: 'ready', callback: EventCallback): void; - off(event: 'ready'): void; - trigger(event: 'ready'): void; - on(event: 'resize', callback: EventCallback): void; - once(event: 'resize', callback: EventCallback): void; - off(event: 'resize'): void; - trigger(event: 'resize', args: ResizeParam): void; - on(event: 'visualQuality', callback: EventCallback): void; - once(event: 'visualQuality', callback: EventCallback): void; - off(event: 'visualQuality'): void; - trigger(event: 'visualQuality', args: VisualQualityParam): void; - on(event: 'levels', callback: EventCallback): void; - once(event: 'levels', callback: EventCallback): void; - off(event: 'levels'): void; - trigger(event: 'levels', args: LevelsParam): void; - on(event: 'seek', callback: EventCallback): void; - once(event: 'seek', callback: EventCallback): void; - off(event: 'seek'): void; - trigger(event: 'seek', args: SeekParam): void; - on(event: 'seeked', callback: () => void): void; - once(event: 'seeked', callback: () => void): void; - off(event: 'seeked'): void; - trigger(event: 'seeked'): void - on(event: 'setupError', callback: EventCallback): void; - once(event: 'setupError', callback: EventCallback): void; - off(event: 'setupError'): void; - trigger(event: 'setupError', args: ErrorParam): void; - on(event: 'remove', callback: () => void): void; - once(event: 'remove', callback: () => void): void; - off(event: 'remove'): void; - trigger(event: 'remove'): void; - on(event: 'time', callback: EventCallback): void; - once(event: 'time', callback: EventCallback): void; - off(event: 'time'): void; - trigger(event: 'time', args: TimeParam): void; - pause(state?: boolean): void; - play(state?: boolean): void; - playAd(tag: string): void; - playlistItem(index: number): void; - registerPlugin(id: string, target: string, jsPlugin: () => void, swfURL?: string): void; - remove(): void; - removeButton(id: string): void; - resize(width: number, height: number): void; - seek(position: number): void; - setControls(controls: boolean): void; - setCurrentAudioTrack(index: number): void; - setCurrentCaptions(index: number): void; - setCurrentQuality(index: number): void; - setFullscreen(state: boolean): void; - setMute(state?: boolean): void; - setup(options: any): JWPlayer; - setVolume(volume: number): void; - stop(): void; -} - -interface JWPlayerStatic { - (id: string): JWPlayer; - key: string; - version: string; -} - -declare const jwplayer:JWPlayerStatic; +declare const jwplayer: jwplayer.JWPlayerStatic; diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/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/jws/index.d.ts b/types/jws/index.d.ts index fdbf1851c4..6c9d7194f5 100644 --- a/types/jws/index.d.ts +++ b/types/jws/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jws 3.1 +// Type definitions for jws 3.2 // Project: https://github.com/brianloveswords/node-jws // Definitions by: Justin Beckwith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -145,7 +145,8 @@ export interface VerifyOptions { export type Algorithm = 'HS256' | 'HS384' | 'HS512' | 'RS256' | 'RS384' | 'RS512' | 'ES256' | 'ES384' | - 'ES512' | 'none'; + 'ES512' | 'PS256' | 'PS384' | 'PS512' | + 'none'; export interface Header { alg: Algorithm; 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..9a14f659e2 100644 --- a/types/karma-chai-sinon/index.d.ts +++ b/types/karma-chai-sinon/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.8 /// -import Sinon = require("sinon"); +import Sinon = require('sinon'); declare global { var should: Chai.Should; diff --git a/types/karma-coverage/index.d.ts b/types/karma-coverage/index.d.ts index 50be80d5cf..8382ec7b12 100644 --- a/types/karma-coverage/index.d.ts +++ b/types/karma-coverage/index.d.ts @@ -1,27 +1,22 @@ -// Type definitions for karma-coverage v0.5.3 +// Type definitions for karma-coverage 1.1 // Project: https://github.com/karma-runner/karma-coverage // Definitions by: Tanguy Krotoff +// Yaroslav Admin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import * as karma from 'karma'; +import 'karma'; import * as istanbul from 'istanbul'; -declare namespace karmaCoverage { - interface Karma extends karma.Karma { } - - interface Config extends karma.Config { - set: (config: ConfigOptions) => void; - } - - interface ConfigOptions extends karma.ConfigOptions { +declare module 'karma' { + interface ConfigOptions { /** * See https://github.com/karma-runner/karma-coverage/blob/master/docs/configuration.md */ - coverageReporter?: (Reporter | Reporter[]); + coverageReporter?: KarmaCoverageReporter & { reporters?: KarmaCoverageReporter[] }; } - interface Reporter { + interface KarmaCoverageReporter { type?: string; dir?: string; subdir?: string | ((browser: string) => string); @@ -33,7 +28,3 @@ declare namespace karmaCoverage { [moreSettings: string]: any; } } - -declare var karmaCoverage: karmaCoverage.Karma; - -export = karmaCoverage; diff --git a/types/karma-coverage/karma-coverage-tests.ts b/types/karma-coverage/karma-coverage-tests.ts index 4f0b187a7a..36d7d85415 100644 --- a/types/karma-coverage/karma-coverage-tests.ts +++ b/types/karma-coverage/karma-coverage-tests.ts @@ -1,6 +1,6 @@ -import * as karma from 'karma-coverage'; +import * as karma from 'karma'; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/README.md#basic +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/README.md#basic module.exports = function(config: karma.Config) { config.set({ files: [ @@ -20,13 +20,13 @@ module.exports = function(config: karma.Config) { // optionally, configure the reporter coverageReporter: { - type : 'html', - dir : 'coverage/' + type: 'html', + dir: 'coverage/' } }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/README.md#advanced-multiple-reporters +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/README.md#advanced-multiple-reporters module.exports = function(config: karma.Config) { config.set({ files: [ @@ -56,7 +56,7 @@ module.exports = function(config: karma.Config) { }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/README.md#dont-minify-instrumenter-output +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/README.md#dont-minify-instrumenter-output module.exports = function(config: karma.Config) { config.set({ coverageReporter: { @@ -67,7 +67,7 @@ module.exports = function(config: karma.Config) { }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#subdir +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/docs/configuration.md#subdir module.exports = function(config: karma.Config) { config.set({ coverageReporter: { @@ -93,7 +93,7 @@ module.exports = function(config: karma.Config) { coverageReporter: { dir: 'coverage', subdir: function(browser) { - // normalization process to keep a consistent browser name accross different + // normalization process to keep a consistent browser name across different // OS return browser.toLowerCase().split(/[ /-]/)[0]; } @@ -102,18 +102,18 @@ module.exports = function(config: karma.Config) { }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#file +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/docs/configuration.md#file module.exports = function(config: karma.Config) { config.set({ coverageReporter: { - type : 'text', - dir : 'coverage/', - file : 'coverage.txt' + type: 'text', + dir: 'coverage/', + file: 'coverage.txt' } }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#check +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/docs/configuration.md#check module.exports = function(config: karma.Config) { config.set({ coverageReporter: { @@ -146,7 +146,7 @@ module.exports = function(config: karma.Config) { }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#watermarks +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/docs/configuration.md#watermarks module.exports = function(config: karma.Config) { config.set({ coverageReporter: { @@ -160,24 +160,36 @@ module.exports = function(config: karma.Config) { }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#sourcestore -module.exports = function(config: karma.Config) { +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/docs/configuration.md#includeallsources +module.exports = function (config: karma.Config) { config.set({ coverageReporter: { - type : 'text', - dir : 'coverage/', - file : 'coverage.txt', - sourceStore : require('istanbul').Store.create('fslookup') + type: 'text', + dir: 'coverage/', + file: 'coverage.txt', + includeAllSources: true } }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#reporters +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/docs/configuration.md#sourcestore module.exports = function(config: karma.Config) { config.set({ coverageReporter: { - reporters:[ - {type: 'html', dir:'coverage/'}, + type: 'text', + dir: 'coverage/', + file: 'coverage.txt', + sourceStore: require('istanbul').Store.create('fslookup') + } + }); +}; + +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/docs/configuration.md#reporters +module.exports = function(config: karma.Config) { + config.set({ + coverageReporter: { + reporters: [ + {type: 'html', dir: 'coverage/'}, {type: 'teamcity'}, {type: 'text-summary'} ], @@ -185,7 +197,7 @@ module.exports = function(config: karma.Config) { }); }; -// See https://github.com/karma-runner/karma-coverage/blob/v0.5.3/docs/configuration.md#instrumenter +// See https://github.com/karma-runner/karma-coverage/blob/v1.1.2/docs/configuration.md#instrumenter module.exports = function(config: karma.Config) { config.set({ coverageReporter: { diff --git a/types/karma-fixture/index.d.ts b/types/karma-fixture/index.d.ts index 42af1d5d60..d443359d72 100644 --- a/types/karma-fixture/index.d.ts +++ b/types/karma-fixture/index.d.ts @@ -1,31 +1,28 @@ -// Type definitions for karma-fixture 0.2.7 +// Type definitions for karma-fixture 0.2 // Project: https://github.com/billtrik/karma-fixture // Definitions by: Ezekiel Victor // Afshawn Lotfi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace fixture { - export var el: HTMLElement; - export var json: any[]; + let el: HTMLElement; + let json: any[]; - export function load(...files: string[]): any; - export function load(file1: string, append?: boolean): any; - export function load(file1: string, file2: string, append?: boolean): any; - export function load(file1: string, file2: string, file3: string, append?: boolean): any; - export function load(file1: string, file2: string, file3: string, file4: string, append?: boolean): any; - export function load(file1: string, file2: string, file3: string, file4: string, file5: string, append?: boolean): any; + function load(...files: string[]): any; + function load(file1: string, append?: boolean): any; + function load(file1: string, file2: string, append?: boolean): any; + function load(file1: string, file2: string, file3: string, append?: boolean): any; + function load(file1: string, file2: string, file3: string, file4: string, append?: boolean): any; + function load(file1: string, file2: string, file3: string, file4: string, file5: string, append?: boolean): any; - export function set(...htmlStrs: string[]): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, append?: boolean): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, htmlStr2: string, append?: boolean): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, append?: boolean): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, append?: boolean): HTMLElement|HTMLElement[]; - export function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, htmlStr5: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(...htmlStrs: string[]): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, htmlStr2: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, append?: boolean): HTMLElement|HTMLElement[]; + function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, htmlStr5: string, append?: boolean): HTMLElement|HTMLElement[]; - export function cleanup(): void; + function cleanup(): void; - export function setBase(fixtureBasePath: string): void; + function setBase(fixtureBasePath: string): void; } - -export = fixture; -export as namespace fixture; diff --git a/types/karma-fixture/karma-fixture-tests.ts b/types/karma-fixture/karma-fixture-tests.ts index d8ea8c8794..2096298eb9 100644 --- a/types/karma-fixture/karma-fixture-tests.ts +++ b/types/karma-fixture/karma-fixture-tests.ts @@ -1,4 +1,3 @@ - fixture.setBase('fixtures/base/path'); fixture.load('test1.html', 'test1.json', false); fixture.load('test1.html', 'test2.html', 'test1.json'); diff --git a/types/karma-fixture/tslint.json b/types/karma-fixture/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/karma-fixture/tslint.json +++ b/types/karma-fixture/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-jasmine/index.d.ts b/types/karma-jasmine/index.d.ts index ae929c6af3..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.3 +// TypeScript Version: 2.8 /// diff --git a/types/karma/index.d.ts b/types/karma/index.d.ts index ba258f0997..0da2803283 100644 --- a/types/karma/index.d.ts +++ b/types/karma/index.d.ts @@ -13,58 +13,55 @@ import Promise = require('bluebird'); import https = require('https'); import { Appender } from 'log4js'; -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; - } +/** + * `start` method is deprecated since 0.13. It will be removed in 0.14. + * Please use + * + * server = new Server(config, [done]) + * server.start() + * + * instead. + * + * @deprecated + */ +export const server: DeprecatedServer; - 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: { +export const runner: Runner; +export const stopper: Stopper; + +export const VERSION: string; +export const constants: Constants; + +export 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; - layout: { - type: string; - pattern: string; - }; + pattern: string; }; - EXIT_CODE: string; - } + }; + EXIT_CODE: string; +} - interface LauncherStatic { - generateId(): string; - // TODO: injector should be of type `di.Injector` - new (emitter: NodeJS.EventEmitter, injector: any): Launcher; - } +export namespace launcher { + class Launcher { + static generateId(): string; + + constructor(emitter: NodeJS.EventEmitter, injector: any); - 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: () => void): boolean; @@ -73,403 +70,403 @@ declare namespace karma { 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 { - // 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 - */ - 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: (...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; - } - - type 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; - } - - 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?: Array; - /** - * @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?: { [name: string]: Appender } | Appender[]; - /** - * @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 \n' + + "but do b.ca", + { + ignoreTags: ["script", "style"] + } + ); + + /* nl2br */ + + /* tagName */ + + linkifyHtml("github.com", { + tagName: "span" + }); + + linkifyHtml("#swag", { + tagName: { + hashtag: "span" + } + }); + + /* target */ + + linkifyHtml("github.com", { + target: "_parent" + }); + + linkifyHtml("test-email@example.com", { + target: { + url: "_parent", + email: null + } + }); + + /* validate */ + + // Don't linkify links that don't begin in a protocol + // e.g., "http://google.com" will be linkified, but "google.com" will not. + linkifyHtml("www.google.com", { + validate: { + url(value) { + return /^(http|ftp)s?:\/\//.test(value); + } + } + }); +}); + +describe("linkifyjs/react", () => { + /** + * The following tests were taken directly from the documentation: + * https://soapbox.github.io/linkifyjs/docs/linkify-react.html + */ + + /* Usage */ + + { + // render() + const options = { + /* … */ + }; + const content = + "For help with GitHub.com, please email support@github.com"; + + {content} + ; + } + + /* Events */ + + { + const content = + "For help with GitHub.com, please email support@github.com"; + const linkProps = { + onClick: (event: any) => { + if (!confirm("Are you sure you want to leave this page?")) { + event.preventDefault(); + } + } + }; + {content}; + } + + /** + * The following tests were made specifically for DefinitelyTyped. + */ + + /* Default values for all props */ + { + const content = + "For help with GitHub.com, please email support@github.com"; + + {content} + ; + } + + /* Custom class name */ + + { + const content = + "For help with GitHub.com, please email support@github.com"; + + {content} + ; + } + + /* Custom tag name */ + + { + const content = + "For help with GitHub.com, please email support@github.com"; + + {content} + ; + } +}); diff --git a/types/linkifyjs/react.d.ts b/types/linkifyjs/react.d.ts new file mode 100644 index 0000000000..0631b6c460 --- /dev/null +++ b/types/linkifyjs/react.d.ts @@ -0,0 +1,11 @@ +import * as React from "react"; +import { LinkifyOptions } from "./index"; + +export interface LinkifyProps { + options?: LinkifyOptions; + tagName?: string; +} + +declare class Linkify extends React.Component {} + +export default Linkify; diff --git a/types/linkifyjs/tsconfig.json b/types/linkifyjs/tsconfig.json new file mode 100644 index 0000000000..16becbcf0a --- /dev/null +++ b/types/linkifyjs/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "preserve" + }, + "files": ["index.d.ts", "html.d.ts", "react.d.ts", "linkifyjs-tests.tsx"] +} diff --git a/types/linkifyjs/tslint.json b/types/linkifyjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/linkifyjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/list-git-remotes/index.d.ts b/types/list-git-remotes/index.d.ts new file mode 100644 index 0000000000..f544110753 --- /dev/null +++ b/types/list-git-remotes/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for list-git-remotes 1.0 +// Project: https://github.com/jonschlinkert/list-git-remotes +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { ExecException, ExecSyncOptions } from 'child_process'; + +export = listGitRemotes; + +declare function listGitRemotes(callback: listGitRemotes.Callback): void; +declare function listGitRemotes(cwd: string, callback: listGitRemotes.Callback): void; + +declare namespace listGitRemotes { + function sync(cwd?: string, options?: ExecSyncOptions): Remotes; + function sync(options: ExecSyncOptions): Remotes; + + type Callback = (err: ExecException | null, remotes: Remotes, stderr?: string) => void; + + interface Remotes { + [key: string]: string; + } +} diff --git a/types/list-git-remotes/list-git-remotes-tests.ts b/types/list-git-remotes/list-git-remotes-tests.ts new file mode 100644 index 0000000000..8114790ce6 --- /dev/null +++ b/types/list-git-remotes/list-git-remotes-tests.ts @@ -0,0 +1,17 @@ +import remotes = require('list-git-remotes'); + +remotes((err, res, stderr) => { + err; // $ExpectType ExecException | null + res; // $ExpectType Remotes + stderr; // $ExpectType string | undefined +}); +remotes('some/project', (err, res, stderr) => { + err; // $ExpectType ExecException | null + res; // $ExpectType Remotes + stderr; // $ExpectType string | undefined +}); + +remotes.sync(); // $ExpectType Remotes +remotes.sync('some/project'); // $ExpectType Remotes +remotes.sync('some/project', { shell: 'foo' }); // $ExpectType Remotes +remotes.sync({ cwd: 'some/project', shell: 'foo' }); // $ExpectType Remotes diff --git a/types/list-git-remotes/tsconfig.json b/types/list-git-remotes/tsconfig.json new file mode 100644 index 0000000000..28e46b572b --- /dev/null +++ b/types/list-git-remotes/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", + "list-git-remotes-tests.ts" + ] +} diff --git a/types/list-git-remotes/tslint.json b/types/list-git-remotes/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/list-git-remotes/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/list-stream/index.d.ts b/types/list-stream/index.d.ts new file mode 100644 index 0000000000..2b3fd1da28 --- /dev/null +++ b/types/list-stream/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for list-stream 1.0 +// Project: https://github.com/rvagg/list-stream +// Definitions by: Christian Sporer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +/// + +import { Duplex, DuplexOptions } from "stream"; + +interface ListStreamMethod { + (callback?: (err: Error, data: any[]) => void): ListStream; + (options?: DuplexOptions, callback?: (err: Error, data: any[]) => void): ListStream; +} + +interface ListStreamConstructor extends ListStreamMethod { + new(callback?: (err: Error, data: any[]) => void): ListStream; + new(options?: DuplexOptions, callback?: (err: Error, data: any[]) => void): ListStream; + + obj: ListStreamMethod; +} + +declare let ListStream: ListStreamConstructor; + +interface ListStream extends Duplex { + append(chunk: any): void; + duplicate(): ListStream; + end(): void; + get(index: number): any; + length: number; +} + +export = ListStream; diff --git a/types/list-stream/list-stream-tests.ts b/types/list-stream/list-stream-tests.ts new file mode 100644 index 0000000000..8b6ae25435 --- /dev/null +++ b/types/list-stream/list-stream-tests.ts @@ -0,0 +1,2 @@ +import "./test/import-tests"; +import "./test/require-tests"; diff --git a/types/list-stream/test/import-tests.ts b/types/list-stream/test/import-tests.ts new file mode 100644 index 0000000000..3648097ad6 --- /dev/null +++ b/types/list-stream/test/import-tests.ts @@ -0,0 +1,54 @@ +import ListStream from "list-stream"; + +let chunk: any = "chunk"; +let listStream: ListStream; +let num = 1; + +listStream = ListStream((err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); +listStream = ListStream({ objectMode: true }, (err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); +listStream = new ListStream((err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); +listStream = new ListStream({ objectMode: true }, (err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); +listStream = ListStream.obj((err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); + +listStream = ListStream.obj(); +listStream.write({ key: "value" }); + +listStream.append(chunk); + +listStream = listStream.duplicate(); + +listStream.end(); + +chunk = listStream.get(num); + +num = listStream.length; diff --git a/types/list-stream/test/require-tests.ts b/types/list-stream/test/require-tests.ts new file mode 100644 index 0000000000..8966e1e5a3 --- /dev/null +++ b/types/list-stream/test/require-tests.ts @@ -0,0 +1,54 @@ +import ListStream = require("list-stream"); + +let chunk: any = "chunk"; +let listStream: ListStream; +let num = 1; + +listStream = ListStream((err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); +listStream = ListStream({ objectMode: true }, (err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); +listStream = new ListStream((err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); +listStream = new ListStream({ objectMode: true }, (err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); +listStream = ListStream.obj((err: Error, data: any[]) => { + if (err) { throw err; } + console.log(data.length); + for (const date of data) { + console.log(date); + } +}); + +listStream = ListStream.obj(); +listStream.write({ key: "value" }); + +listStream.append(chunk); + +listStream = listStream.duplicate(); + +listStream.end(); + +chunk = listStream.get(num); + +num = listStream.length; diff --git a/types/list-stream/tsconfig.json b/types/list-stream/tsconfig.json new file mode 100644 index 0000000000..00fe9a2e23 --- /dev/null +++ b/types/list-stream/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "test/import-tests.ts", + "test/require-tests.ts", + "index.d.ts", + "list-stream-tests.ts" + ] +} diff --git a/types/list-stream/tslint.json b/types/list-stream/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/list-stream/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/list.js/index.d.ts b/types/list.js/index.d.ts new file mode 100644 index 0000000000..0c31e24e20 --- /dev/null +++ b/types/list.js/index.d.ts @@ -0,0 +1,63 @@ +// Type definitions for list.js 1.5 +// Project: http://listjs.com +// Definitions by: Jeffrey Meng +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +interface ListOptions { + valueNames?: string[]; + item?: string; + listClass?: string; + searchClass?: string; + sortClass?: string; + indexAsync?: boolean; + page?: number; + i?: number; + pagination?: boolean; +} + +interface SortOptions { + order?: string; + alphabet?: string; + insensitive?: boolean; + sortFunction?: ((a: object, b: object) => number|undefined); +} + +declare class List { + listContainer: HTMLElement; + list: HTMLElement; + items: object[]; + visibleItems: object[]; + matchingItems: object[]; + searched: boolean; + filtered: boolean; + + constructor(element: string|HTMLElement, options?: ListOptions, values?: object[]); + + add(values: object[], callback?: (item: ListItem) => void): void; + remove(valueName: string, value: any): number; + get(valueName: string, value: any): ListItem[]; + sort(valueName: string, options: SortOptions): void; + search(searchString: string, columns?: string[]): void; + clear(): void; + filter(filterFunction: (item: ListItem) => boolean): void; + size(): number; + show(i: number, page: number): void; + update(): void; + reIndex(): void; + fuzzySearch(searchString: string, columns?: string[]): void; + on(event: string, callback: () => void): void; +} + +declare class ListItem { + elm: HTMLElement; + + values(newValues: object): void; + values(): object; + show(): void; + hide(): void; + matching(): boolean; + visible(): boolean; +} + +export = List; diff --git a/types/list.js/list.js-tests.ts b/types/list.js/list.js-tests.ts new file mode 100644 index 0000000000..b2852c1a55 --- /dev/null +++ b/types/list.js/list.js-tests.ts @@ -0,0 +1,49 @@ +import List from "list.js"; + +const list = new List(new HTMLElement(), { + page: 3, + searchClass: "class" +}); + +list.list; // $ExpectType HTMLElement +list.listContainer; // $ExpectType HTMLElement +list.items; // $ExpectType object[] +list.visibleItems; // $ExpectType object[] +list.matchingItems; // $ExpectType object[] +list.searched; // $ExpectType boolean +list.filtered; // $ExpectType boolean + +list.add([{ // $ExpectType void + name: "value", + value: true +}], (item) => {}); // $ExpectType (item: ListItem) => void + +list.remove("name", "value"); // $ExpectType number +list.get("name", "value"); // $ExpectType ListItem[] +list.sort("name", { // $ExpectType void + order: "asec", + alphabet: "ABCD1234EFGH" +}); +list.search("name", ["col1", "col2"]); // $ExpectType void +list.clear(); // $ExpectType void +list.filter((item) => { + return true; +}); +list.size(); // $ExpectType number +list.show(0, 0); // $ExpectType void +list.update(); // $ExpectType void +list.reIndex(); // $ExpectType void +list.fuzzySearch("search", ["col1", "col2"]); // $ExpectType void +list.on("event", () => { // void + // Do Something +}); + +const item = list.get("name", "value")[0]; + +item.elm; // $ExpectType HTMLElement +item.values(["new1", "new2"]); // $ExpectType void +item.values(); // $ExpectType object +item.show(); // $ExpectType void +item.hide(); // $ExpectType void +item.matching(); // $ExpectType boolean +item.visible(); // $ExpectType boolean diff --git a/types/list.js/tsconfig.json b/types/list.js/tsconfig.json new file mode 100644 index 0000000000..85166b0860 --- /dev/null +++ b/types/list.js/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "list.js-tests.ts" + ] +} diff --git a/types/list.js/tslint.json b/types/list.js/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/list.js/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/load-google-maps-api/index.d.ts b/types/load-google-maps-api/index.d.ts new file mode 100644 index 0000000000..818957ff5f --- /dev/null +++ b/types/load-google-maps-api/index.d.ts @@ -0,0 +1,59 @@ +// Type definitions for load-google-maps-api 1.3 +// Project: https://github.com/yuanqing/load-google-maps-api#readme +// Definitions by: Oscar Busk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface Options { + /** + * Client usage reporting channel + * + * https://developers.google.com/maps/premium/reports/usage-reports#channels + */ + channel?: string; + /** + * Client ID + * + * https://developers.google.com/maps/documentation/javascript/get-api-key#specifying-a-client-id-when-loading-the-api + */ + client?: string; + /** + * Your API key + * + * https://developers.google.com/maps/documentation/javascript/get-api-key#step-2-add-the-api-key-to-your-application + */ + key?: string; + /** + * https://developers.google.com/maps/documentation/javascript/localization#Language + */ + language?: string; + /** + * Supplemental libraries to load + * + * Default Value `[]` + * + * https://developers.google.com/maps/documentation/javascript/libraries + */ + libraries?: string[]; + /** + * https://developers.google.com/maps/documentation/javascript/localization#Region + */ + region?: string; + /** + * Time in milliseconds before rejecting the Promise + * + * Default Value `10000` + */ + timeout?: number; + /** + * API Version + * + * https://developers.google.com/maps/documentation/javascript/versions + */ + v?: string; +} + +declare function loadGoogleMapsApi(options?: Options): Promise; + +export = loadGoogleMapsApi; diff --git a/types/load-google-maps-api/load-google-maps-api-tests.ts b/types/load-google-maps-api/load-google-maps-api-tests.ts new file mode 100644 index 0000000000..0d2495de64 --- /dev/null +++ b/types/load-google-maps-api/load-google-maps-api-tests.ts @@ -0,0 +1,38 @@ +import loadGoogleMapsApi = require('load-google-maps-api'); + +// Example from README.md https://github.com/yuanqing/load-google-maps-api#usage +loadGoogleMapsApi().then((googleMaps) => { + new googleMaps.Map(document.querySelector('.map'), { + center: { + lat: 40.7484405, + lng: -73.9944191 + }, + zoom: 12 + }); +}).catch((error) => { + console.error(error); +}); + +loadGoogleMapsApi({ libraries: 'drawing' }); // $ExpectError +loadGoogleMapsApi({ v: 3 }); // $ExpectError +loadGoogleMapsApi({ timeout: '1000' }); // $ExpectError + +loadGoogleMapsApi({ + channel: 'customer', + client: '12345', + key: 'abcde', + language: 'se', + libraries: [ + 'drawing', + 'geometry', + 'places', + 'visualization', + ], + region: 'SE', + timeout: 500, + v: '3.33', +}).then(gm => { + gm; // $ExpectType typeof maps + const map = new gm.Map(document.querySelector('.map')); // $ExpectType Map + const polygon = new gm.Polygon(); // $ExpectType Polygon +}); diff --git a/types/load-google-maps-api/tsconfig.json b/types/load-google-maps-api/tsconfig.json new file mode 100644 index 0000000000..7d3af9db08 --- /dev/null +++ b/types/load-google-maps-api/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", + "load-google-maps-api-tests.ts" + ] +} diff --git a/types/load-google-maps-api/tslint.json b/types/load-google-maps-api/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/load-google-maps-api/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/loadable__component/index.d.ts b/types/loadable__component/index.d.ts new file mode 100644 index 0000000000..c4877bd8a9 --- /dev/null +++ b/types/loadable__component/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for @loadable/component 5.2 +// Project: https://github.com/smooth-code/loadable-components +// Definitions by: Martynas Kadiša +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +export interface DefaultImportedComponent

          { + default: React.ComponentType

          ; +} + +export type DefaultComponent

          = React.ComponentType

          | DefaultImportedComponent

          ; + +export interface Options { + fallback?: JSX.Element; +} + +export type LoadableComponent = React.ComponentType; +export type LoadableLibrary = React.ComponentType<{ + fallback?: JSX.Element; + children?: (module: TModule) => React.ReactNode; + ref?: React.Ref; +}> & + TModule; + +declare function lib( + loadFn: (props: object) => Promise, + options?: Options +): LoadableLibrary; + +declare function loadableFunc( + loadFn: (props: T) => Promise>, + options?: Options +): LoadableComponent; + +declare const loadable: typeof loadableFunc & { lib: typeof lib }; + +export default loadable; + +export namespace lazy { + function lib(loadFn: (props: object) => Promise): LoadableLibrary; +} + +export function lazy(loadFn: (props: T) => Promise>): LoadableComponent; + +export function loadableReady(done?: () => any): Promise; diff --git a/types/loadable__component/loadable__component-tests.tsx b/types/loadable__component/loadable__component-tests.tsx new file mode 100644 index 0000000000..d286711be1 --- /dev/null +++ b/types/loadable__component/loadable__component-tests.tsx @@ -0,0 +1,117 @@ +import * as React from 'react'; +import loadable, { lazy, loadableReady } from '@loadable/component'; + +const TestComponent: React.SFC<{ foo: string }> = () => <>test; + +function defaultImportComponentLoader() { + return new Promise<{ default: typeof TestComponent }>(resolve => resolve({ default: TestComponent })); +} + +function importComponentLoader() { + return new Promise(resolve => resolve(TestComponent)); +} + +const lib = { + getTestObj: () => ({ bar: 'bar', foo: 'foo' }) +}; + +function defaultImportLibLoader() { + return new Promise<{ default: typeof lib }>(resolve => resolve(({ default: lib }))); +} + +function importLibLoader() { + return new Promise(resolve => resolve(lib)); +} + +// loadable +{ + // Should infer props from imported component with default export + const LoadableDefaultComponent = loadable(defaultImportComponentLoader); + ; + + // Should infer props from imported component without default export + const LoadableComponent = loadable(importComponentLoader); + ; + + // Should allow passing JSX element to fallback in options + loadable(defaultImportComponentLoader, { fallback:

          loading...
          }); + + // Should allow passing `fallback` prop to loadable component + loading...
          } />; +} + +// lazy +{ + // Should infer props from imported component with default export + const LazyDefaultComponent = lazy(defaultImportComponentLoader); + ; + + // Should infer props from imported component without default export + const LazyComponent = lazy(importComponentLoader); + ; + + // Should allow passing fallback prop + loading...
          } />; +} + +// loadable.lib +{ + // Should infer types from module with default export and reflect them in children render prop + const LoadableDefaultLibrary = loadable.lib(defaultImportLibLoader); + + {({ default: { getTestObj } }) => getTestObj().foo} + ; + + // Should infer types from module without default export and reflect them in children render prop + const LoadableLibrary = loadable.lib(importLibLoader); + + {({ getTestObj }) => getTestObj().foo} + ; + + // Should allow passing fallback JSX element + loadable.lib(importLibLoader, { fallback:
          loading lib...
          }); + + // Should allow passing fallback prop + Loading library...
          }> + {({ getTestObj }) => getTestObj().foo} + ; + + // Should reflect inferred types from module in ref + const ref = React.createRef(); + ; + ref.current!.getTestObj().foo; +} + +// lazy.lib +{ + // Should infer types from module with default export and reflect them in children render prop + const LazyDefaultLibrary = lazy.lib(defaultImportLibLoader); + + {({ default: { getTestObj } }) => getTestObj().foo} + ; + + // Should infer types from module without default export and reflect them in children render prop + const LazyLibrary = lazy.lib(importLibLoader); + + {({ getTestObj }) => getTestObj().foo} + ; + + // Should allow passing fallback prop + Loading library...
          }> + {({ getTestObj }) => getTestObj().foo} + ; + + // Should reflect inferred types from module in ref + const ref = React.createRef(); + ; + ref.current!.getTestObj().foo; +} + +// loadableReady +{ + // Should allow passing callback argument + loadableReady(() => {}); + + // Should return a promise + loadableReady().then(() => {}); +} diff --git a/types/loadable__component/tsconfig.json b/types/loadable__component/tsconfig.json new file mode 100644 index 0000000000..440535e42b --- /dev/null +++ b/types/loadable__component/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@loadable/component": [ + "loadable__component" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "loadable__component-tests.tsx" + ] +} diff --git a/types/loadable__component/tslint.json b/types/loadable__component/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/loadable__component/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/loadable__server/index.d.ts b/types/loadable__server/index.d.ts new file mode 100644 index 0000000000..eafbd7eec7 --- /dev/null +++ b/types/loadable__server/index.d.ts @@ -0,0 +1,86 @@ +// Type definitions for @loadable/server 5.2 +// Project: https://github.com/smooth-code/loadable-components +// Definitions by: Martynas Kadiša +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ComponentType, ReactElement, Component } from 'react'; + +export type ChunkExtractorOptions = { + /** + * Webpack entrypoints to load (default to `["main"]`) + */ + entrypoints?: string | string[]; + /** + * Optional output path (only for `requireEntrypoint`) + */ + outputPath?: string; +} & ({ + /** + * Stats file path generated using `@loadable/webpack-plugin` + */ + statsFile: string; + } | { + /** + * Stats generated using `@loadable/webpack-plugin`. + */ + stats: object; + }); + +/** + * Used to collect chunks server-side and get them as script tags or script elements + */ +export class ChunkExtractor { + constructor(options: ChunkExtractorOptions); + + /** + * Wrap your application in a `ChunkExtractorManager` + */ + collectChunks( + /** + * JSX element that will be wrapped in `ChunkExtractorManager` + */ + element: JSX.Element + ): JSX.Element; + + /** + * Require the entrypoint of your application as a commonjs module. + */ + requireEntrypoint(name?: string): { default: ComponentType }; + + /** + * Get scripts as a string of ` 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; - } +/** + * Wraps an AWS Lambda function with NewRelic instrumentation and returns the value of the handler + * + * @param handler a callback function whose value is returned from setLambdaHandler + * @returns the value returned by handler + */ +export function setLambdaHandler(handler: (...args: any[]) => T): T; - 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..9bc909d57c 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 @@ -102,3 +104,5 @@ newrelic.shutdown({ collectPendingData: true, timeout: 3000 }, (err) => { newrelic.shutdown((err) => { const error: Error | undefined = err; }); + +newrelic.setLambdaHandler(() => void 0); // $ExpectType undefined diff --git a/types/next-redux-saga/index.d.ts b/types/next-redux-saga/index.d.ts new file mode 100644 index 0000000000..0366868d97 --- /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: 3.0 + +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-redux-wrapper/index.d.ts b/types/next-redux-wrapper/index.d.ts index 16af858743..10fa2d44d1 100644 --- a/types/next-redux-wrapper/index.d.ts +++ b/types/next-redux-wrapper/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Steve // Jungwoo-An // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.0 /// @@ -19,6 +19,8 @@ declare namespace nextReduxWrapper { interface Options { storeKey?: string; debug?: boolean; + serializeState?: any; + deserializeState?: any; } interface StoreCreatorOptions extends Options { diff --git a/types/next-seo/index.d.ts b/types/next-seo/index.d.ts new file mode 100644 index 0000000000..8d7c487393 --- /dev/null +++ b/types/next-seo/index.d.ts @@ -0,0 +1,84 @@ +// Type definitions for next-seo 1.10 +// Project: https://github.com/garmeeh/next-seo#readme +// Definitions by: Thomas Kosiewski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component } from "react"; + +export interface NextSeoProps { + config: Config; +} + +export interface Config { + title?: string; + titleTemplate?: string; + description?: string; + canonical?: string; + + dangerouslySetAllPagesToNoIndex?: boolean; + noindex?: boolean; + + twitter?: Twitter; + facebook?: Facebook; + openGraph?: OpenGraph; +} + +export interface Twitter { + cardType?: string; + site?: string; + handle?: string; +} + +export interface Facebook { + appId?: number; +} + +export interface OpenGraph { + url?: string; + type?: string; + title?: string; + description?: string; + images?: ReadonlyArray; + defaultImageHeight?: number; + defaultImageWidth?: number; + locale?: string; + site_name?: string; + + profile?: OpenGraphProfile; + book?: OpenGraphBook; + article?: OpenGraphArticle; +} + +export interface OpenGraphImages { + url?: string; + width?: number; + height?: number; + alt?: string; +} + +export interface OpenGraphProfile { + firstName?: string; + lastName?: string; + username?: string; + gender?: string; +} + +export interface OpenGraphBook { + authors?: ReadonlyArray; + isbn?: string; + releaseDate?: string; + tags?: ReadonlyArray; +} + +export interface OpenGraphArticle { + publishedTime?: string; + modifiedTime?: string; + expirationTime?: string; + + authors?: ReadonlyArray; + section?: string; + tags?: ReadonlyArray; +} + +export default class NextSeo extends Component { } diff --git a/types/next-seo/next-seo-tests.ts b/types/next-seo/next-seo-tests.ts new file mode 100644 index 0000000000..3c2da4b032 --- /dev/null +++ b/types/next-seo/next-seo-tests.ts @@ -0,0 +1,48 @@ +import NextSeo from 'next-seo'; + +new NextSeo({ + config: { + canonical: "", + dangerouslySetAllPagesToNoIndex: false, + description: "", + facebook: { + appId: 0, + }, + noindex: false, + openGraph: { + book: { + authors: [""], + isbn: "", + releaseDate: "", + tags: [""], + }, + defaultImageHeight: 0, + defaultImageWidth: 0, + description: "", + images: [{ + alt: "", + height: 0, + url: "", + width: 0, + }], + locale: "", + profile: { + firstName: "", + gender: "", + lastName: "", + username: "", + }, + site_name: "", + title: "", + type: "", + url: "", + }, + title: "", + titleTemplate: "", + twitter: { + cardType: "", + handle: "", + site: "", + }, + }, +}); diff --git a/types/next-seo/tsconfig.json b/types/next-seo/tsconfig.json new file mode 100644 index 0000000000..faea26b9bc --- /dev/null +++ b/types/next-seo/tsconfig.json @@ -0,0 +1,25 @@ +{ + "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", + "next-seo-tests.ts" + ] +} diff --git a/types/next-seo/tslint.json b/types/next-seo/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/next-seo/tslint.json @@ -0,0 +1 @@ +{ "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..2d06273bd5 --- /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: AsyncComponentLoader

          | 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..07844cad08 --- /dev/null +++ b/types/next-server/test/next-server-dynamic-tests.tsx @@ -0,0 +1,69 @@ +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 = ; + +// 1.1 Basic Usage (Loader function) +const DynamicComponent2 = dynamic(() => asyncComponent); +const dynamicComponent2JSX = ; + +// 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-tick/index.d.ts b/types/next-tick/index.d.ts new file mode 100644 index 0000000000..09f87243a1 --- /dev/null +++ b/types/next-tick/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for next-tick 1.0 +// Project: https://github.com/medikoo/next-tick#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = nextTick; + +declare function nextTick(callback: () => void): void; diff --git a/types/next-tick/next-tick-tests.ts b/types/next-tick/next-tick-tests.ts new file mode 100644 index 0000000000..4e91651911 --- /dev/null +++ b/types/next-tick/next-tick-tests.ts @@ -0,0 +1,3 @@ +import nextTick = require('next-tick'); + +nextTick(() => {}); diff --git a/types/next-tick/tsconfig.json b/types/next-tick/tsconfig.json new file mode 100644 index 0000000000..af4623e50d --- /dev/null +++ b/types/next-tick/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", + "next-tick-tests.ts" + ] +} diff --git a/types/next-tick/tslint.json b/types/next-tick/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/next-tick/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/next/app.d.ts b/types/next/app.d.ts index 392b997f89..3e933c09c6 100644 --- a/types/next/app.d.ts +++ b/types/next/app.d.ts @@ -53,6 +53,6 @@ export type AppComponentType

          = NextComponent >; export class Container extends React.Component {} -export default class App

          extends React.Component

          { +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 8466b60a4f..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 3d238f6c6f..e0879e1c68 100644 --- a/types/next/document.d.ts +++ b/types/next/document.d.ts @@ -37,7 +37,7 @@ export interface NextDocumentContext exte * https://github.com/zeit/next.js/blob/7.0.0/server/document.js#L16 */ export interface DefaultDocumentIProps extends RenderPageResponse { - styles?: Array>; + styles?: React.ReactNode[]; } /** @@ -55,6 +55,7 @@ export interface DocumentProps { runtimeConfig?: any; nextExport?: boolean; err?: any; + [key: string]: any; }; dev: boolean; dir?: string; @@ -104,5 +105,7 @@ export class NextScript extends React.Component {} export default class Document

          extends React.Component< P & DefaultDocumentIProps & DocumentProps > { - static getInitialProps(context: NextDocumentContext): DefaultDocumentIProps | Promise; + static getInitialProps( + context: NextDocumentContext + ): DefaultDocumentIProps | Promise; } diff --git a/types/next/dynamic.d.ts b/types/next/dynamic.d.ts index 38a85bf77e..0b10e6238e 100644 --- a/types/next/dynamic.d.ts +++ b/types/next/dynamic.d.ts @@ -1,42 +1,2 @@ -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; +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 09d7e31860..8ad2226f07 100644 --- a/types/next/error.d.ts +++ b/types/next/error.d.ts @@ -10,5 +10,5 @@ export interface DefaultErrorIProps { } export default class Error

          extends React.Component

          { - static getInitialProps(context: NextContext): DefaultErrorIProps; + static getInitialProps(context: NextContext): Promise | DefaultErrorIProps; } diff --git a/types/next/head.d.ts b/types/next/head.d.ts index d46b371d11..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 Head 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 d788ddd941..8d911ab2c1 100644 --- a/types/next/index.d.ts +++ b/types/next/index.d.ts @@ -1,11 +1,12 @@ // Type definitions for next 7.0 -// Project: https://github.com/zeit/next.js +// 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,10 +14,18 @@ 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, 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; @@ -47,126 +56,21 @@ declare namespace next { } /** - * Next.js config schema. - * https://github.com/zeit/next.js/blob/7.0.0/server/config.js#L9 + * 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/7.0.0/server/index.js#L25 - */ - 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/7.0.0/server/index.js#L25 - 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; - 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; + addExportPathMapRoutes(): Promise; getCompilationError(): Promise; } @@ -183,14 +87,31 @@ declare namespace next { | NextStatelessComponent; /** - * Next.js counterpart of React.SFC/React.StatelessComponent. + * @deprecated as of recent React versions, function components can no + * longer be considered 'stateless'. Please use `NextFunctionComponent` instead. + * + * @see [React Hooks](https://reactjs.org/docs/hooks-intro.html) + */ + type NextSFC

          = NextFunctionComponent; + + /** + * @deprecated as of recent React versions, function components can no + * longer be considered 'stateless'. Please use `NextFunctionComponent` instead. + * + * @see [React Hooks](https://reactjs.org/docs/hooks-intro.html) + */ + type NextStatelessComponent

          = NextFunctionComponent; + + type NextFC

          = NextFunctionComponent; + + /** + * Next.js counterpart of React.FC/React.FunctionComponent. * * @template P Component props. * @template IP Initial props returned from getInitialProps. * @template C Context passed to getInitialProps. */ - type NextSFC

          = NextStatelessComponent; - type NextStatelessComponent

          = React.StatelessComponent

          & + type NextFunctionComponent

          = React.FunctionComponent

          & NextStaticLifecycle; /** @@ -214,5 +135,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 12e3ee5419..04c383e914 100644 --- a/types/next/link.d.ts +++ b/types/next/link.d.ts @@ -1,21 +1,8 @@ -import * as url from "url"; -import * as React from "react"; -import { UrlLike } from "./router"; +import { LinkProps } from 'next-server/link'; // Deprecated export type LinkState = LinkProps; // End Deprecated -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 {} +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 4232f356c9..8fd3df698b 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -1,95 +1,2 @@ -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) - 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 eaa2c0ad07..514cc24436 100644 --- a/types/next/test/next-app-tests.tsx +++ b/types/next/test/next-app-tests.tsx @@ -6,6 +6,10 @@ interface TestAppProps { pageProps: any; } +interface TestAppState { + color: string; +} + interface TypedQuery extends DefaultQuery { id?: string; } @@ -33,6 +37,20 @@ class TestAppWithProps extends App { } } +class ErrorTestAppWithState extends App { + static async getInitialProps({ Component, router, ctx }: NextAppContext) { + const pageProps = Component.getInitialProps && (await Component.getInitialProps(ctx)); + return { pageProps }; + } + + render() { + const { Component, router, pageProps, example } = this.props; + return ; + } + + state: {}; // $ExpectError +} + class TestAppWithTypedQuery extends App { static async getInitialProps({ ctx }: NextAppContext) { const { id } = ctx.query; diff --git a/types/next/test/next-component-tests.tsx b/types/next/test/next-component-tests.tsx index 57e397c5b0..293f72ead1 100644 --- a/types/next/test/next-component-tests.tsx +++ b/types/next/test/next-component-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { NextStatelessComponent, NextContext, NextComponentType } from "next"; +import { NextStatelessComponent, NextContext, NextComponentType, NextFunctionComponent } from "next"; import { DefaultQuery } from "next/router"; interface NextComponentProps { @@ -29,11 +29,20 @@ class ClassNextWithTypedQuery extends React.Component { } } -const StatelessNext: NextStatelessComponent = ({ example }) => ( +const LegacyStatelessNext: NextStatelessComponent = ({ example }) => (

          I'm a stateless component! {example}
          ); -StatelessNext.getInitialProps = async ({ query }: NextContext) => { +LegacyStatelessNext.getInitialProps = async ({ query }: NextContext) => { + const { example } = query; + return { example: example as string }; +}; + +const FunctionNext: NextFunctionComponent = ({ example }) => ( +
          I'm a functional component! {example}
          +); + +FunctionNext.getInitialProps = async ({ query }: NextContext) => { const { example } = query; return { example: example as string }; }; 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 d25b340e64..83d0a0e8a3 100644 --- a/types/next/test/next-document-tests.tsx +++ b/types/next/test/next-document-tests.tsx @@ -1,4 +1,5 @@ import Document, { + DocumentProps, Enhancer, Head, Main, @@ -12,8 +13,31 @@ interface WithUrlProps { url: string; } +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) { + static async getInitialProps(ctx: NextDocumentContext) { + const { req, renderPage } = ctx; + // without callback const _page = renderPage(); @@ -21,7 +45,9 @@ class MyDoc extends Document { const enhancer: Enhancer = App => props => ; const { html, head, buildManifest } = renderPage(enhancer); - const styles = [ - +; + +// $ExpectError +; +// $ExpectError +; diff --git a/types/react-helmet/v4/index.d.ts b/types/react-helmet/v4/index.d.ts index 4d1b0c699e..eddd354124 100644 --- a/types/react-helmet/v4/index.d.ts +++ b/types/react-helmet/v4/index.d.ts @@ -8,7 +8,7 @@ import * as React from "react"; -declare function ReactHelmet(): ReactHelmet.HelmetComponent; +declare class ReactHelmet extends React.Component {} declare namespace ReactHelmet { function peek(): ReactHelmet.HelmetData; @@ -41,8 +41,6 @@ declare namespace ReactHelmet { toString(): string; toComponent(): React.Component; } - - class HelmetComponent extends React.Component {} } export = ReactHelmet; diff --git a/types/react-highcharts/index.d.ts b/types/react-highcharts/index.d.ts new file mode 100644 index 0000000000..26a74e28a9 --- /dev/null +++ b/types/react-highcharts/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for react-highcharts 16.0 +// Project: https://github.com/kirjs/react-highcharts +// Definitions by: Jiri Marsicek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as Highcharts from "highcharts"; +import * as React from "react"; + +/** + * Props for ReactHighcharts component. + */ +interface ReactHighchartsProps { + /** + * Highcharts configuration options. + */ + config: Highcharts.Options; + /** + * + * @param after-render callback. + */ + callback?(chart: Highcharts.ChartObject): void; +} + +/** + * React interface for highcharts. + */ +declare class ReactHighcharts extends React.Component { + static Highcharts: Highcharts.Static; +} + +export default ReactHighcharts; diff --git a/types/react-highcharts/react-highcharts-tests.tsx b/types/react-highcharts/react-highcharts-tests.tsx new file mode 100644 index 0000000000..7c0841e566 --- /dev/null +++ b/types/react-highcharts/react-highcharts-tests.tsx @@ -0,0 +1,14 @@ +import * as React from "react"; +import * as Highcharts from "highcharts"; +import ReactHighcharts from "react-highcharts"; + +const config: Highcharts.Options = {}; + +function callback(chart: Highcharts.ChartObject): void {} + +export const _ = () => ( + <> + + + +); diff --git a/types/react-highcharts/tsconfig.json b/types/react-highcharts/tsconfig.json new file mode 100644 index 0000000000..a2060c82fe --- /dev/null +++ b/types/react-highcharts/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "jsx": "react", + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "react-highcharts-tests.tsx"] +} diff --git a/types/react-highcharts/tslint.json b/types/react-highcharts/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-highcharts/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-howler/index.d.ts b/types/react-howler/index.d.ts new file mode 100644 index 0000000000..51722f9079 --- /dev/null +++ b/types/react-howler/index.d.ts @@ -0,0 +1,49 @@ +// Type definitions for react-howler 3.7 +// Project: https://github.com/thangngoc89/react-howler +// Definitions by: Danijel Maksimovic +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2 + +/// +/// + +import * as React from 'react'; +import { Howl } from 'howler'; + +declare enum HOWLER_STATE { + UNLOADED = 'unloaded', + LOADING = 'loading', + LOADED = 'loaded' +} + +interface Props { + src: string | string[]; + format?: string[]; + playing?: boolean; + mute?: boolean; + loop?: boolean; + preload?: boolean; + volume?: number; + onEnd?: () => void; + onPause?: () => void; + onPlay?: (id: number) => void; + onVolume?: (id: number) => void; + onStop?: (id: number) => void; + onLoad?: () => void; + onLoadError?: (id: number) => void; + html5?: boolean; +} + +declare class ReactHowler extends React.Component { + stop(id?: number): void; + + duration(id?: number): number; + + seek(time: number): number; + + howlerState(): HOWLER_STATE; + + howler: Howl; +} + +export default ReactHowler; diff --git a/types/react-howler/react-howler-tests.tsx b/types/react-howler/react-howler-tests.tsx new file mode 100644 index 0000000000..e840da7dde --- /dev/null +++ b/types/react-howler/react-howler-tests.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import ReactHowler from 'react-howler'; + +export class ReactHowlerTest extends React.Component { + private readonly player = React.createRef(); + + render() { + const player = this.player.current; + + if (player) { + player.howler.duration(); + } + + return ( +
          + console.log('playing sound with id ', id)} + onLoad={() => console.log('sound loaded')} + onLoadError={id => + console.log('error loading sound with id ', id) + } + onEnd={() => console.log('sound ended')} + onPause={() => console.log('sound paused')} + onStop={id => console.log('sound with id paused', id)} + volume={0.5} + onVolume={id => console.log('volume changed', id)} + loop={true} + html5={true} + format={['mp3']} + preload={false} + ref={this.player} + /> +
          + ); + } +} diff --git a/types/react-howler/tsconfig.json b/types/react-howler/tsconfig.json new file mode 100644 index 0000000000..fe1b001df3 --- /dev/null +++ b/types/react-howler/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "jsx": "react", + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": false + }, + "files": ["index.d.ts", "react-howler-tests.tsx"] +} diff --git a/types/react-howler/tslint.json b/types/react-howler/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-howler/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-i18next/index.d.ts b/types/react-i18next/index.d.ts deleted file mode 100644 index 979c648f50..0000000000 --- a/types/react-i18next/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Type definitions for react-i18next 7.8 -// Project: https://github.com/i18next/react-i18next -// Definitions by: Giedrius Grabauskas -// Simon Baumann -// Benedict Etzel -// Wu Haotian -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import { TranslationFunction } from "i18next"; - -import { - setDefaults, - getDefaults, - setI18n, - getI18n, - ReactI18NextOptions, - reactI18nextModule -} from "./src/context"; -import I18n from "./src/I18n"; -import I18nextProvider from "./src/I18nextProvider"; -import Interpolate from "./src/interpolate"; -import loadNamespaces from "./src/loadNamespaces"; -import Trans from "./src/trans"; -import translate from "./src/translate"; - -export { - setDefaults, - getDefaults, - setI18n, - getI18n, - ReactI18NextOptions, - reactI18nextModule, - I18n, - I18nextProvider, - Interpolate, - loadNamespaces, - Trans, - translate, - TranslationFunction -}; - -export { InjectedI18nProps, InjectedTranslateProps } from "./src/props"; - -export as namespace reactI18Next; diff --git a/types/react-i18next/src/I18n.d.ts b/types/react-i18next/src/I18n.d.ts deleted file mode 100644 index 91de868caf..0000000000 --- a/types/react-i18next/src/I18n.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from "react"; -import { i18n, TranslationFunction } from "i18next"; - -export interface Options { - i18n: i18n; - t: TranslationFunction; -} - -export interface i18nProps { - wait?: boolean; - ns?: string | string[]; - nsMode?: string; - bindI18n?: string; - bindStore?: string; - i18n?: i18n; - initialI18nStore?: any; - initialLanguage?: string; - children: (t: TranslationFunction, options: Options) => React.ReactNode; -} - -export default class I18n extends React.Component { } diff --git a/types/react-i18next/src/I18nextProvider.d.ts b/types/react-i18next/src/I18nextProvider.d.ts deleted file mode 100644 index 2db5d0361b..0000000000 --- a/types/react-i18next/src/I18nextProvider.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from "react"; -import { i18n } from "i18next"; - -// tslint:disable-next-line:interface-name -export interface I18nextProviderProps { - i18n: i18n; - initialI18nStore?: any; - initialLanguage?: string; - children: React.ReactNode; -} - -export default class I18nextProvider extends React.Component { } diff --git a/types/react-i18next/src/context.d.ts b/types/react-i18next/src/context.d.ts deleted file mode 100644 index f772e8c1da..0000000000 --- a/types/react-i18next/src/context.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { i18n } from "i18next"; - -export interface ReactI18NextOptions { - wait?: boolean; - withRef?: boolean; - bindI18n?: string; - bindStore?: string; - translateFuncName?: string; - nsMode?: string; -} - -export function setDefaults(options: ReactI18NextOptions): void; - -export function getDefaults(): ReactI18NextOptions; - -export function setI18n(instance: i18n): void; - -export function getI18n(): i18n; - -export interface i18NextModule { - type: string; - - init: (instance: i18n) => void; -} - -export const reactI18nextModule: i18NextModule; diff --git a/types/react-i18next/src/interpolate.d.ts b/types/react-i18next/src/interpolate.d.ts deleted file mode 100644 index d6a4e64420..0000000000 --- a/types/react-i18next/src/interpolate.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from "react"; -import { i18n, InterpolationOptions, TranslationFunction } from "i18next"; - -export type InterpolateValue = string | JSX.Element; - -export interface InterpolatePropsBase { - parent?: string; - regexp?: RegExp; - useDangerouslySetInnerHTML?: boolean; - dangerouslySetInnerHTMLPartElement?: string; - options?: InterpolationOptions; - i18nKey?: string; - className?: string; - style?: React.CSSProperties; - i18n?: i18n; - t?: TranslationFunction; -} - -export interface OtherInterpolateProps { - [regexKey: string]: InterpolateValue | RegExp | InterpolationOptions | boolean | undefined; -} - -export type InterpolateProps = InterpolatePropsBase & OtherInterpolateProps; - -export default class Interpolate extends React.PureComponent { } diff --git a/types/react-i18next/src/loadNamespaces.d.ts b/types/react-i18next/src/loadNamespaces.d.ts deleted file mode 100644 index d0e0b372f5..0000000000 --- a/types/react-i18next/src/loadNamespaces.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as React from "react"; -import { i18n } from "i18next"; - -export interface LoadNamespacesArguments { - components: Array | React.StatelessComponent>; - i18n: i18n; -} - -export default function loadNamespaces(args: LoadNamespacesArguments): Promise; diff --git a/types/react-i18next/src/props.d.ts b/types/react-i18next/src/props.d.ts deleted file mode 100644 index 62a201049a..0000000000 --- a/types/react-i18next/src/props.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {i18n as I18n, TranslationFunction} from "i18next"; - -/** - * Extend your component's Prop interface with this one to get access to `this.props.t` - * - * Please note that if you use the `translateFuncName` option, you should create - * your own interface just like this one, but with your name of the translation function. - * - * interface MyComponentProps extends ReactI18next.InjectedTranslateProps {} - * - * Then specify the name of the translate function as generic argument - * - * const translated = translate("view", { translateFuncName: "_" })(YourComponent); - */ -export interface InjectedTranslateProps { - t: TranslationFunction; -} - -/** - * Extend your component's Prop interface with this one to get access to `this.props.i18n` - */ -export interface InjectedI18nProps { - i18n: I18n -} diff --git a/types/react-i18next/src/trans.d.ts b/types/react-i18next/src/trans.d.ts deleted file mode 100644 index 2b0e8e7738..0000000000 --- a/types/react-i18next/src/trans.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from "react"; -import { i18n, TranslationFunction } from "i18next"; - -export interface TOptions { - [key: string]: any; -} - -export interface Values { - [key: string]: any; -} - -export interface TransProps { - i18nKey?: string; - count?: number; - parent?: React.ReactNode | (() => React.ReactNode); - i18n?: i18n; - t?: TranslationFunction; - tOptions?: TOptions; - defaults?: string; - values?: Values; - components?: React.ReactNode[]; - ns?: string; -} - -export default class Trans extends React.Component { } diff --git a/types/react-i18next/src/translate.d.ts b/types/react-i18next/src/translate.d.ts deleted file mode 100644 index 0383ee1ead..0000000000 --- a/types/react-i18next/src/translate.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import * as React from "react"; -import { i18n as I18n, TranslationFunction } from "i18next"; -import { InjectedTranslateProps, InjectedI18nProps } from "./props"; -import { setDefaults, setI18n } from "./context"; - -export interface TranslateOptions { - withRef?: boolean; - bindI18n?: string; - bindStore?: string; - translateFuncName?: TTranslateFuncName; - wait?: boolean; - nsMode?: string; - i18n?: I18n; -} - -export interface TranslateHocProps { - i18n?: I18n; - initialI18nStore?: object; - initialLanguage?: string; -} - -// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -type Omit = Pick; - -type InjectedProps = InjectedI18nProps & InjectedTranslateProps; - -export interface WrapperComponentClass

          extends React.ComponentClass

          { - new (props: P, context?: any): React.Component

          & { getWrappedInstance(): React.Component }; -} - -// Injects props and removes them from the prop requirements. -// Adds the new properties t (or whatever the translation function is called) and i18n if needed. -export type InferableComponentEnhancerWithProps = -

          (component: React.ComponentClass

          | React.StatelessComponent

          ) => - React.ComponentClass & TranslateHocProps>; - -export type InferableComponentEnhancerWithPropsAndRef = -

          (component: React.ComponentClass

          | React.StatelessComponent

          ) => - WrapperComponentClass, P>; - -export interface Translate { - - (namespaces?: TNamespace | TNamespace[], options?: Omit & { withRef?: false }): - InferableComponentEnhancerWithProps<"t">; - - - (namespaces?: TNamespace | TNamespace[], options?: Omit & { withRef: true }): - InferableComponentEnhancerWithPropsAndRef<"t">; - - - (namespaces?: TNamespace | TNamespace[], options?: TranslateOptions & { withRef?: false }): - InferableComponentEnhancerWithProps; - - - (namespaces?: TNamespace | TNamespace[], options?: TranslateOptions & { withRef: true }): - InferableComponentEnhancerWithPropsAndRef; - - setDefaults: typeof setDefaults; - setI18n: typeof setI18n; -} - -declare const translate: Translate; -export default translate; diff --git a/types/react-i18next/test/react-i18next-tests.tsx b/types/react-i18next/test/react-i18next-tests.tsx deleted file mode 100644 index 30b95ece24..0000000000 --- a/types/react-i18next/test/react-i18next-tests.tsx +++ /dev/null @@ -1,201 +0,0 @@ -import * as React from 'react'; -import * as i18n from 'i18next'; -import { - setDefaults, - reactI18nextModule, - translate, - I18nextProvider, - Interpolate, - InjectedTranslateProps, - TranslationFunction, - loadNamespaces, - Trans, - I18n, - ReactI18NextOptions -} from 'react-i18next'; -import { InjectedI18nProps } from 'react-i18next/src/props'; - -interface InnerAnotherComponentProps { - _: TranslationFunction; -} - -class InnerAnotherComponent extends React.Component { - render() { - const _ = this.props._; - return

          {_('content.text', {/* options t options */})}

          ; - } -} - -const AnotherComponent = translate('view', {wait: true, translateFuncName: '_'})(InnerAnotherComponent); -const instanceWithoutRef = new AnotherComponent({}); -instanceWithoutRef.componentWillReceiveProps!({ - i18n, - initialI18nStore: { context: { text: "a message" } }, - initialLanguage: "en" -}, {}); - -translate.setDefaults({ wait: false }); -translate.setI18n(i18n); - -const AnotherComponentWithRef = translate("view" as Key, { translateFuncName: "_", withRef: true })(InnerAnotherComponent); -const instanceWithRef = new AnotherComponentWithRef({}); -const ref = instanceWithRef.getWrappedInstance(); -instanceWithRef.componentWillReceiveProps!({ - i18n, - initialI18nStore: { context: { text: "a message" } }, - initialLanguage: "en" -}, {}); - -class InnerYetAnotherComponent extends React.Component { - render() { - const t = this.props.t; - return

          {t('usingDefaultNS', {/* options t options */})}

          ; - } -} - -const YetAnotherComponent = translate()(InnerYetAnotherComponent); - -const YetAnotherComponentWithRef = translate(undefined, { withRef: true })(InnerYetAnotherComponent); -new YetAnotherComponentWithRef({}).getWrappedInstance(); -class TranslatableView extends React.Component { - render() { - const t = this.props.t; - const interpolateComponent = "a interpolated component"; - const options: i18n.InterpolationOptions = {}; - return ( -
          -

          {t('common:appName')}

          - - - - - {t('nav:link1')} -
          - ); - } -} - -const TranslatedView = translate(["view", "nav"] as Key[], { wait: true })(TranslatableView); - -class App extends React.Component { - render() { - return ( -
          -
          - -
          -
          - ); - } -} - - - -; - - - 123 -; - -loadNamespaces({components: [App], i18n}).then(() => { -}).catch(error => { -}); - -; -; -; -}/>; -
          }/>; -; -; - - -; -; -placeholder - ]} - values={{ - universe: "World" - }} -/>; - -type Key = "view" | "nav"; - -class GenericsTest extends React.Component { - render() { - return null; - } -} - -const TranslatedGenericsTest = translate(["view", "nav"] as Key[])(GenericsTest); -; - -class GenericsTest2 extends React.Component { - render() { - return null; - } -} - -const TranslatedGenericsTest2 = translate("view" as Key)(GenericsTest2); -; - -class ComponentWithInjectedI18n extends React.Component { - render() { return null; } -} - -const TranslatedComponentWithInjectedI18n = translate()(ComponentWithInjectedI18n); -; - -function StatlessComponent(props: InjectedTranslateProps) { - return

          {props.t("hy")}

          ; -} - -const TranslatedStatlessComponent = translate()(StatlessComponent); -; - -interface CustomTranslateFunctionProps { - _: TranslationFunction; -} - - - { - (t, {i18n}) => ( -
          -

          {t('keyFromDefault')}

          -

          {t('anotherNamespace:key.from.another.namespace', {/* options t options */})}

          -
          - ) - } -
          ; - - - {t => '123'} -; - -const defaults: ReactI18NextOptions = { - wait: true, - withRef: true, - bindI18n: 'string', - bindStore: 'string' -}; -setDefaults(defaults); - -reactI18nextModule.init(i18n.init()); diff --git a/types/react-i18next/tsconfig.json b/types/react-i18next/tsconfig.json deleted file mode 100644 index f90b5c3ff0..0000000000 --- a/types/react-i18next/tsconfig.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react", - "experimentalDecorators": true - }, - "files": [ - "index.d.ts", - "test/react-i18next-tests.tsx", - "src/context.d.ts", - "src/I18n.d.ts", - "src/I18nextProvider.d.ts", - "src/interpolate.d.ts", - "src/loadNamespaces.d.ts", - "src/trans.d.ts", - "src/translate.d.ts" - ] -} \ No newline at end of file diff --git a/types/react-i18next/v1/index.d.ts b/types/react-i18next/v1/index.d.ts deleted file mode 100644 index 0296da861c..0000000000 --- a/types/react-i18next/v1/index.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Type definitions for react-i18next 1.7.0 -// Project: https://github.com/i18next/react-i18next -// Definitions by: Kostya Esmukov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import * as I18next from "i18next"; -import * as React from "react"; - -export type TranslationFunction = I18next.TranslationFunction; - -// Extend your component's Prop interface with this one to get access to `this.props.t` -// -// Please note that if you use the `translateFuncName` option, you should create -// your own interface just like this one, but with your name of the translation function. -// -// interface MyComponentProps extends ReactI18next.InjectedTranslateProps {} -export interface InjectedTranslateProps { - t?: TranslationFunction; -} - -interface I18nextProviderProps { - i18n: I18next.I18n; - children?: React.ReactElement; -} - -export class I18nextProvider extends React.Component { } - - -type InterpolateValue = string | JSX.Element; - -interface InterpolateProps { - i18nKey: string; - - parent?: string; - regexp?: RegExp; - options?: I18next.TranslationOptions; - - useDangerouslySetInnerHTML?: boolean; - dangerouslySetInnerHTMLPartElement?: string; - - [regexKey: string]: InterpolateValue | RegExp | I18next.TranslationOptions | boolean | undefined; -} - -export class Interpolate extends React.Component { } - -interface TranslateOptions { - withRef?: boolean; - wait?: boolean; - translateFuncName?: string; -} - -export function translate(namespaces?: string[] | string, options?: TranslateOptions): (WrappedComponent: C) => C; - -export function loadNamespaces({ components, i18n }: { components: (React.ComponentClass | React.StatelessComponent)[], i18n: I18next.I18n }): Promise; - -export as namespace ReactI18Next; diff --git a/types/react-i18next/v1/react-i18next-tests.tsx b/types/react-i18next/v1/react-i18next-tests.tsx deleted file mode 100644 index 950e29d293..0000000000 --- a/types/react-i18next/v1/react-i18next-tests.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import * as i18n from 'i18next'; -import { translate, I18nextProvider, Interpolate, InjectedTranslateProps, TranslationFunction } from 'react-i18next'; - - -i18n - .init({ - fallbackLng: 'en', - - // have a common namespace used around the full app - ns: ['common'], - defaultNS: 'common', - - debug: true, - - interpolation: { - escapeValue: false // not needed for react!! - } - }); - - -interface InnerAnotherComponentProps { - _?: TranslationFunction; -} - -class InnerAnotherComponent extends React.Component { - render() { - const _ = this.props._!; - - return

          {_('content.text', { /* options t options */ })}

          ; - } -} - -const AnotherComponent = translate('view', { wait: true, translateFuncName: '_' })(InnerAnotherComponent); - - - -interface InnerYetAnotherComponentProps extends InjectedTranslateProps { -} - -class InnerYetAnotherComponent extends React.Component { - render() { - const t = this.props.t!; - - return

          {t('usingDefaultNS', { /* options t options */ })}

          ; - } -} -const YetAnotherComponent = translate()(InnerYetAnotherComponent); - - -interface TranslatableViewProps extends InjectedTranslateProps { -} - -@translate(['view', 'nav'], { wait: true }) -class TranslatableView extends React.Component { - render() { - const t = this.props.t!; - - let interpolateComponent = "a interpolated component"; - - return ( -
          -

          {t('common:appName')}

          - - - - - {t('nav:link1')} -
          - ) - } -} - -class App extends React.Component { - render() { - return ( -
          -
          - -
          -
          - ); - } -} - - -ReactDOM.render( - , - document.getElementById('app') -); diff --git a/types/react-i18next/v4/I18nextProvider.d.ts b/types/react-i18next/v4/I18nextProvider.d.ts deleted file mode 100644 index 2ecb87f4a1..0000000000 --- a/types/react-i18next/v4/I18nextProvider.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from "react"; -import { i18n } from "i18next"; - -// tslint:disable-next-line:interface-name -export interface I18nextProviderProps { - i18n: i18n; - children: React.ReactElement; - initialI18nStore?: any; - initialLanguage?: string; -} - -export default class I18nextProvider extends React.Component { } diff --git a/types/react-i18next/v4/index.d.ts b/types/react-i18next/v4/index.d.ts deleted file mode 100644 index 758a00edef..0000000000 --- a/types/react-i18next/v4/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Type definitions for react-i18next 4.6 -// Project: https://github.com/i18next/react-i18next -// Definitions by: Giedrius Grabauskas -// Netanel Gilad -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import { TranslationFunction } from "i18next"; - -import I18nextProvider from "./I18nextProvider"; -import Interpolate from "./interpolate"; -import loadNamespaces from "./loadNamespaces"; -import Trans from "./trans"; -import translate from "./translate"; - -export { - I18nextProvider, - Interpolate, - loadNamespaces, - Trans, - translate, - // Exports for TypeScript only - TranslationFunction -}; - -/** - * Extend your component's Prop interface with this one to get access to `this.props.t` - * - * Please note that if you use the `translateFuncName` option, you should create - * your own interface just like this one, but with your name of the translation function. - * - * interface MyComponentProps extends ReactI18next.InjectedTranslateProps {} - */ -export interface InjectedTranslateProps { - t: TranslationFunction; -} - -export as namespace reactI18Next; diff --git a/types/react-i18next/v4/interpolate.d.ts b/types/react-i18next/v4/interpolate.d.ts deleted file mode 100644 index e6f07893ed..0000000000 --- a/types/react-i18next/v4/interpolate.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from "react"; -import { InterpolationOptions } from "i18next"; - -export type InterpolateValue = string | JSX.Element; - -export interface InterpolatePropsBase { - parent?: string; - regexp?: RegExp; - useDangerouslySetInnerHTML?: boolean; - dangerouslySetInnerHTMLPartElement?: string; - options?: InterpolationOptions; - i18nKey?: string; - className?: string; - style?: React.CSSProperties; -} - -export interface OtherInterpolateProps { - [regexKey: string]: InterpolateValue | RegExp | InterpolationOptions | boolean | undefined; -} - -export type InterpolateProps = InterpolatePropsBase & OtherInterpolateProps; - -export default class Interpolate extends React.Component { } diff --git a/types/react-i18next/v4/loadNamespaces.d.ts b/types/react-i18next/v4/loadNamespaces.d.ts deleted file mode 100644 index d0e0b372f5..0000000000 --- a/types/react-i18next/v4/loadNamespaces.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as React from "react"; -import { i18n } from "i18next"; - -export interface LoadNamespacesArguments { - components: Array | React.StatelessComponent>; - i18n: i18n; -} - -export default function loadNamespaces(args: LoadNamespacesArguments): Promise; diff --git a/types/react-i18next/v4/react-i18next-tests.tsx b/types/react-i18next/v4/react-i18next-tests.tsx deleted file mode 100644 index 3e57dd091b..0000000000 --- a/types/react-i18next/v4/react-i18next-tests.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import * as React from 'react'; -import * as i18n from 'i18next'; -import { translate, I18nextProvider, Interpolate, InjectedTranslateProps, TranslationFunction, loadNamespaces, Trans } from 'react-i18next'; - -interface InnerAnotherComponentProps { - _?: TranslationFunction; -} - -class InnerAnotherComponent extends React.Component { - render() { - const _ = this.props._!; - return

          {_('content.text', { /* options t options */ })}

          ; - } -} - -const AnotherComponent = translate('view', { wait: true, translateFuncName: '_' })(InnerAnotherComponent); - -class InnerYetAnotherComponent extends React.Component { - render() { - const t = this.props.t; - return

          {t('usingDefaultNS', { /* options t options */ })}

          ; - } -} - -const YetAnotherComponent = translate()(InnerYetAnotherComponent); - -class TranslatableView extends React.Component { - render() { - const t = this.props.t; - const interpolateComponent = "a interpolated component"; - - return ( -
          -

          {t('common:appName')}

          - - - - - {t('nav:link1')} -
          - ); - } -} - -const WrappedTranslatableView = translate(['view', 'nav'], { wait: true })(TranslatableView); - -class App extends React.Component { - render() { - return ( -
          -
          - -
          -
          - ); - } -} - - - -; - -loadNamespaces({ components: [App], i18n }).then(() => { }).catch(error => { }); - -; -; - - -; - -type Key = "view" | "nav"; - -class GenericsTest extends React.Component { - render() { return null; } -} - -translate(['view', 'nav'])(GenericsTest); - -class GenericsTest2 extends React.Component { - render() { return null; } -} - -translate('view')(GenericsTest2); diff --git a/types/react-i18next/v4/trans.d.ts b/types/react-i18next/v4/trans.d.ts deleted file mode 100644 index 384e1605f9..0000000000 --- a/types/react-i18next/v4/trans.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as React from "react"; - -export interface TransProps { - i18nKey?: string; - [name: string]: any; -} - -export default class Trans extends React.Component { } diff --git a/types/react-i18next/v4/translate.d.ts b/types/react-i18next/v4/translate.d.ts deleted file mode 100644 index 9a4fb6ddc2..0000000000 --- a/types/react-i18next/v4/translate.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from "react"; -import { i18n } from "i18next"; -import { InjectedTranslateProps } from "react-i18next"; - -export interface TranslateOptions { - withRef?: boolean; - bindI18n?: string; - bindStore?: string; - translateFuncName?: string; - wait?: boolean; - nsMode?: string; - i18n?: i18n; -} - -// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -export type Omit = Pick; - -// Injects props and removes them from the prop requirements. -// Adds the new properties t (or whatever the translation function is called) and i18n if needed. -export type InferableComponentEnhancerWithProps = -

          (component: React.ComponentClass

          | React.StatelessComponent

          ) => - React.ComponentClass>; - -// tslint:disable-next-line:ban-types -export default function translate(namespaces?: TKey[] | TKey, options?: TranslateOptions): InferableComponentEnhancerWithProps<"t">; diff --git a/types/react-image-crop/index.d.ts b/types/react-image-crop/index.d.ts index 7f3637d093..9cb750dbd2 100644 --- a/types/react-image-crop/index.d.ts +++ b/types/react-image-crop/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-image-crop 3.0 +// Type definitions for react-image-crop 6.0 // Project: https://github.com/DominicTobias/react-image-crop // Definitions by: Daniela Yassuda +// Elias Chaaya // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -35,14 +36,17 @@ declare namespace ReactCrop { keepSelection?: boolean; onChange: (crop: Crop, pixelCrop: PixelCrop) => void; onComplete?: (crop: Crop, pixelCrop: PixelCrop) => void; - onImageLoaded?: (target: HTMLImageElement) => void; + onImageLoaded?: (target: HTMLImageElement, pixelCrop: PixelCrop) => void; onDragStart?: () => void; onDragEnd?: () => void; disabled?: boolean; - crossorigin?: string; + crossorigin?: 'anonymous' | 'use-credentials'; children?: ReactNode; style?: CSSProperties; imageStyle?: CSSProperties; + onImageError?: (event: React.SyntheticEvent) => void; + className?: string; + locked?: boolean; } function getPixelCrop(image: HTMLImageElement, percentCrop: Crop): Crop; diff --git a/types/react-image-crop/test/react-image-crop-global-tests.ts b/types/react-image-crop/test/react-image-crop-global-tests.ts index 1ba4759420..cec99abf95 100644 --- a/types/react-image-crop/test/react-image-crop-global-tests.ts +++ b/types/react-image-crop/test/react-image-crop-global-tests.ts @@ -85,6 +85,10 @@ class CompleteTest extends React.Component<{}, TestState> { }); } + onImageError = (event: React.SyntheticEvent) => { + console.warn('Error loading image'); + } + render() { return React.createElement( ReactCrop, @@ -104,6 +108,9 @@ class CompleteTest extends React.Component<{}, TestState> { onDragStart: () => console.log('Drag start'), onDragEnd: () => console.log('Drag end'), crossorigin: 'anonymous', + onImageError: this.onImageError, + className: 'my-cropper', + locked: false }, ); } diff --git a/types/react-image-crop/test/react-image-crop-module-tests.tsx b/types/react-image-crop/test/react-image-crop-module-tests.tsx index 7bd696bf32..a92371dc8a 100644 --- a/types/react-image-crop/test/react-image-crop-module-tests.tsx +++ b/types/react-image-crop/test/react-image-crop-module-tests.tsx @@ -81,6 +81,10 @@ class CompleteTest extends React.Component<{}, TestState> { }); } + onImageError = (event: React.SyntheticEvent) => { + console.warn('Error loading image'); + } + render() { return ( { onDragStart={() => console.log('Drag start')} onDragEnd={() => console.log('Drag end')} crossorigin="anonymous" + onImageError={this.onImageError} + className="my-cropper" + locked={false} /> ); } diff --git a/types/react-images/index.d.ts b/types/react-images/index.d.ts new file mode 100644 index 0000000000..4f3e1c8893 --- /dev/null +++ b/types/react-images/index.d.ts @@ -0,0 +1,157 @@ +// Type definitions for react-images 0.5 +// Project: http://jossmac.github.io/react-images +// Definitions by: Konstantin Lukaschenko +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +declare class Lightbox extends React.Component { + constructor(props: LightboxProps); +} + +export interface LightboxProps { + /** + * Array of image objects. Required. + */ + images: Image[]; + + /** + * Allow users to exit the lightbox by clicking the backdrop. Default value: false. + */ + backdropClosesModal?: boolean; + + /** + * Supports keyboard input - esc, arrow left, and arrow right. Default value: true + */ + enableKeyboardInput?: boolean; + + /** + * The index of the image to display initially. Default value: 0 + */ + currentImage?: number; + + /** + * An array of elements to display as custom controls on the top of lightbox. Default value: undefined + */ + customControls?: Array>; + + /** + * Whether or not the lightbox is displayed. Default value: false; + */ + isOpen?: boolean; + + /** + * Based on the direction the user is navigating, preload the next available image. Default value: true + */ + preloadNextImage?: boolean; + + /** + * Optionally display a close "X" button in top right corner. Default value: true + */ + showCloseButton?: boolean; + + /** + * Optionally display image index, e.g., "3 of 20". Default value: true + */ + showImageCount?: boolean; + + /** + * Maximum width of the carousel; defaults to 1024px + */ + width?: number; + + /** + * Spinner component. + */ + spinner?: () => React.ReactElement; + + /** + * Color of spinner. Default value: 'white' + */ + spinnerColor?: string; + + /** + * Size of spinner. Default value: 100 + */ + spinnerSize?: number; + + /** + * Determines whether scrolling is prevented via react-scrolllock. Default value: true + */ + preventScroll?: boolean; + + /** + * Optionally display thumbnails beneath the Lightbox + */ + showThumbnails?: boolean; + + /** + * The image count separator. Default value: ' of ' + */ + imageCountSeparator?: string; + + /** + * Customize right arrow title. Default value: ' Next (Right arrow key) ' + */ + rightArrowTitle?: string; + + /** + * Custom of left arrow title. Default value: ' Previous (Left arrow key) ' + */ + leftArrowTitle?: string; + + /** + * Custom close esc title. Default value: ' Close (Esc) ' + */ + closeButtonTitle?: string; + + /** + * Handle closing of the lightbox. Required. + */ + onClose: () => void; + + /** + * Fired on request of the previous image. + */ + onClickPrev?: () => void; + + /** + * Fired on request of the next image. + */ + onClickNext?: () => void; + + /** + * Handle click on image. + */ + onClickImage?: (e: React.MouseEvent) => void; + + /** + * Handle click on thumbnail. + */ + onClickThumbnail?: (index: number) => void; +} + +export interface Image { + /** + * The source of the image. Required. + */ + src: string; + + /** + * array of strings or string + */ + srcSet?: string | string[]; + + /** + * The image caption. + */ + caption?: string; + + /** + * The alt text for the image. + */ + alt?: string; +} + +export default Lightbox; diff --git a/types/react-images/react-images-tests.tsx b/types/react-images/react-images-tests.tsx new file mode 100644 index 0000000000..8b63d4bc8a --- /dev/null +++ b/types/react-images/react-images-tests.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import Lightbox, { Image } from 'react-images'; + +interface ImageGalerieState { + selectedImage: number; + showLightbox: boolean; +} + +class ImageGalerie extends React.Component { + constructor(props: undefined) { + super(props); + this.state = {selectedImage: 0, showLightbox: true}; + } + + render() { + const images: Image[] = [ + { + src: "http://localhost:8080/img1.jpg", + alt: "Image 1", + caption: "Image 1", + }, + { + src: "http://localhost:8080/img2.jpg", + alt: "Image 2", + caption: "Image 2", + }]; + + return this.setState({showLightbox: false})} + onClickImage={e => {}} + onClickNext={() => this.setState({selectedImage: (this.state.selectedImage + 1) % images.length})} + onClickPrev={() => this.setState({selectedImage: this.state.selectedImage === 0 ? images.length : this.state.selectedImage - 1})} + showThumbnails={true} + onClickThumbnail={(index) => this.setState({selectedImage: index})} + />; + } +} diff --git a/types/react-images/tsconfig.json b/types/react-images/tsconfig.json new file mode 100644 index 0000000000..3a505430d8 --- /dev/null +++ b/types/react-images/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-images-tests.tsx" + ] +} diff --git a/types/react-images/tslint.json b/types/react-images/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-images/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-imgpro/index.d.ts b/types/react-imgpro/index.d.ts new file mode 100644 index 0000000000..0f513e55cf --- /dev/null +++ b/types/react-imgpro/index.d.ts @@ -0,0 +1,88 @@ +// Type definitions for react-imgpro 1.3 +// Project: https://github.com/nitin42/react-imgpro +// Definitions by: Carlos Li +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +import ProcessImage = ReactImgpro.ProcessImage; +export default ProcessImage; + +declare namespace ReactImgpro { + type Mode = "neighbor" | "bilinear" | "bicubic" | "hermite" | "bezier"; + interface Shape { + width?: number; + height?: number; + mode?: Mode; + } + interface Size { + width: number; + height: number; + mode: + "horizontal_left" | + "horizontal_center" | + "horizontal_right" | + "vertical_top" | + "vertical_bottom" | + "vertical_middle"; + } + interface ProcessImageProps { + image: string; + resize?: Shape; + quality?: number; + greyscale?: boolean; + normalize?: boolean; + invert?: boolean; + opaque?: boolean; + sepia?: boolean; + dither565?: boolean; + scale?: boolean; + scaleToFitImage?: { + width: number; + height: number; + }; + flip?: { + horizontal?: boolean; + vertical?: boolean; + }; + rotate?: { + degree: number; + mode: Mode; + }; + brightness?: number; /* should be -1 to 1 */ + contrast?: number; /* should be -1 to 1 */ + fade?: number; /* should be 0 - 1 */ + opacity?: number; /* should be 0 - 1 */ + blur?: number; /* should be 0 - 100 */ + posterize?: number; /* should be 0 - 100 */ + cover?: Size; + contain?: Size; + colors?: { + lighten?: number; + brighten?: number; + darken?: number; + desaturate?: number; + saturate?: number; + greyscale?: number; + spin?: number; + mix?: { + color?: string; + amount?: number; + }, + tint?: number; + xor?: number; + shade?: number; + red?: number; + green?: number; + blue?: number; + }; + storage?: boolean; + disableWebWorker?: boolean; + disableRerender?: boolean; + customCdn?: string; + onProcessFinish: () => void; + } + + class ProcessImage extends React.Component {} +} diff --git a/types/react-imgpro/react-imgpro-tests.tsx b/types/react-imgpro/react-imgpro-tests.tsx new file mode 100644 index 0000000000..74fd1a3045 --- /dev/null +++ b/types/react-imgpro/react-imgpro-tests.tsx @@ -0,0 +1,25 @@ +import * as React from 'react'; +import ProcessImage from "react-imgpro"; + +class Test extends React.Component { + render() { + return ( + console.log("onProcessFinish")} + > +

          +
          +
          + + ); + } +} diff --git a/types/react-imgpro/tsconfig.json b/types/react-imgpro/tsconfig.json new file mode 100644 index 0000000000..e888d7e2c3 --- /dev/null +++ b/types/react-imgpro/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-imgpro-tests.tsx" + ] +} diff --git a/types/react-imgpro/tslint.json b/types/react-imgpro/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-imgpro/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/react-infinite-calendar/index.d.ts b/types/react-infinite-calendar/index.d.ts index 2110d4dbd0..ac09df7bf4 100644 --- a/types/react-infinite-calendar/index.d.ts +++ b/types/react-infinite-calendar/index.d.ts @@ -6,16 +6,33 @@ import * as React from 'react'; +export type DateType = Date | string | number; + +export enum EVENT_TYPE { + START = 1, + HOVER, + END +} + +export interface RangedSelection { + eventType: EVENT_TYPE; + start: Date; + end: Date; +} + +export type RangedSelectFunction = (rangedDate: RangedSelection) => void; +export type DateSelectFunction = (date: Date) => void; + export interface ReactInfiniteCalendarProps { - selected?: Date | boolean; - width?: number | 'auto'; + selected?: DateType | false | { start: DateType; end: DateType }; + width?: number | 'auto' | '100%'; height?: number | 'auto'; - min?: Date; - max?: Date; - minDate?: Date; - maxDate?: Date; + min?: DateType; + max?: DateType; + minDate?: DateType; + maxDate?: DateType; disabledDays?: Array<0 | 1 | 2 | 3 | 4 | 5 | 6>; - disabledDates?: Date[]; + disabledDates?: DateType[]; display?: 'days' | 'years'; displayOptions?: { hideYearsOnSelect?: boolean; @@ -55,12 +72,22 @@ export interface ReactInfiniteCalendarProps { weekdayColor?: string; }; className?: string; - onSelect?: (date: string) => void; + onSelect?: DateSelectFunction | RangedSelectFunction; onScroll?: (scrollTop: number) => void; onScrollEnd?: (scrollTop: number) => void; rowHeight?: number; autoFocus?: boolean; tabIndex?: number; + Component?: CalendarClass; } +export class Calendar extends React.Component {} +export type CalendarClass = React.ComponentClass; + +export function withRange(component: CalendarClass): CalendarClass; +export function withDateSelection(component: CalendarClass): CalendarClass; +export function withMultipleDates(component: CalendarClass): CalendarClass; +export function withKeyboardSupport(component: CalendarClass): CalendarClass; +export function defaultMultipleDateInterpolation(component: CalendarClass): CalendarClass; + export default class ReactInfiniteCalendar extends React.Component {} diff --git a/types/react-infinite-calendar/react-infinite-calendar-tests.tsx b/types/react-infinite-calendar/react-infinite-calendar-tests.tsx index ff1918d539..ba4b6a0ec7 100644 --- a/types/react-infinite-calendar/react-infinite-calendar-tests.tsx +++ b/types/react-infinite-calendar/react-infinite-calendar-tests.tsx @@ -1,5 +1,11 @@ import * as React from 'react'; -import ReactInfiniteCalendar from 'react-infinite-calendar'; +import ReactInfiniteCalendar, { + Calendar, + withRange, + withKeyboardSupport, + withMultipleDates, + withDateSelection +} from 'react-infinite-calendar'; const test: React.SFC = () => ( ( tabIndex={1} /> ); + +const testWithRange = withRange(Calendar); +const testWithDateSelection = withDateSelection(Calendar); +const testWithKeyboardSupport = withKeyboardSupport(Calendar); +const testWithMultipleDate = withMultipleDates(Calendar); diff --git a/types/react-infinite-scroll-component/index.d.ts b/types/react-infinite-scroll-component/index.d.ts index f43fc50e24..4380c2f11a 100644 --- a/types/react-infinite-scroll-component/index.d.ts +++ b/types/react-infinite-scroll-component/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Stephanie Roy // Bartosz Dotryw // David Kevork +// Joshua R. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -30,7 +31,7 @@ declare namespace InfiniteScroll { /** * This message is shown to the user when he has seen all the records which means he's at the bottom and hasMore is false */ - endMessage: React.ReactNode; + endMessage?: React.ReactNode; /** * You can send a loader component to show while the component waits for the next load of data. e.g.

          Loading...

          or any fancy loader element diff --git a/types/react-infinite-scroller/index.d.ts b/types/react-infinite-scroller/index.d.ts index 47c2166bc9..f0af24ac5e 100644 --- a/types/react-infinite-scroller/index.d.ts +++ b/types/react-infinite-scroller/index.d.ts @@ -1,7 +1,9 @@ -// Type definitions for react-infinite-scroller 1.0 +// Type definitions for react-infinite-scroller 1.2 // Project: https://github.com/CassetteRocks/react-infinite-scroller // Definitions by: Lauri Lavanti , // Piotr Srebniak +// Brett Miller +// Yipeng Zhao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -61,8 +63,14 @@ declare namespace InfiniteScroll { * Loader component for indicating "loading more". */ loader?: React.ReactElement; + /** + * Override method to return a different scroll listener if it's not the immediate parent of InfiniteScroll. + */ + getScrollParent?(): HTMLElement | null; + } + class InfiniteScroll extends React.Component { + getParentElement(elem?: HTMLElement | null): HTMLElement | undefined | null; } - class InfiniteScroll extends React.Component { } namespace InfiniteScroll {} } diff --git a/types/react-infinite-scroller/react-infinite-scroller-tests.tsx b/types/react-infinite-scroller/react-infinite-scroller-tests.tsx index 2f9009f667..eeb2214826 100644 --- a/types/react-infinite-scroller/react-infinite-scroller-tests.tsx +++ b/types/react-infinite-scroller/react-infinite-scroller-tests.tsx @@ -27,8 +27,38 @@ class Test2 extends React.Component { useCapture useWindow={false} > -
          Test 1
          +
          Test 2
          ); } } + +class Test3 extends React.Component { + inputRef = React.createRef(); + + render() { + return ( +
          + {}} + getScrollParent={() => this.inputRef.current} + > +
          Test 3
          +
          +
          + ); + } +} + +class InfiniteScrollOverride extends InfiniteScroll { + getParentElement(el: HTMLElement) { + if (document.getElementById("scroll-header")) { + return document.getElementById("scroll-header"); + } + return super.getParentElement(el); + } + + render() { + return super.render(); + } +} diff --git a/types/react-inlinesvg/index.d.ts b/types/react-inlinesvg/index.d.ts new file mode 100644 index 0000000000..e8e1f4095b --- /dev/null +++ b/types/react-inlinesvg/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for react-inlinesvg 0.8 +// Project: https://github.com/gilbarbara/react-inlinesvg#readme +// Definitions by: MyCrypto , Nick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ComponentType, ReactNode } from 'react'; + +export interface RequestError extends Error { + isHttpError: boolean; + status: number; +} + +export interface InlineSVGError extends Error { + name: 'InlineSVGError'; + isSupportedBrowser: boolean; + isConfigurationError: boolean; + isUnsupportedBrowserError: boolean; + message: string; +} + +export interface Props { + baseURL?: string; + cacheGetRequests?: boolean; + children?: ReactNode; + className?: string; + preloader?: ReactNode; + src: URL | string; + style?: object; + uniqueHash?: string; + uniquifyIDs?: boolean; + onError?(error: RequestError | InlineSVGError): void; + onLoad?(src: URL | string, isCached: boolean): void; + supportTest?(): void; + wrapper?(): ReactNode; +} + +declare const InlineSVG: ComponentType; +export default InlineSVG; diff --git a/types/react-inlinesvg/react-inlinesvg-tests.tsx b/types/react-inlinesvg/react-inlinesvg-tests.tsx new file mode 100644 index 0000000000..a7d90e0d86 --- /dev/null +++ b/types/react-inlinesvg/react-inlinesvg-tests.tsx @@ -0,0 +1,19 @@ +import * as React from "react"; +import SVG from 'react-inlinesvg'; + +function Loader() { + return null; +} + +function myOnLoadHandler(src: string | URL) { +} + +} + onLoad={(src) => { + myOnLoadHandler(src); + }} +> + +; diff --git a/types/react-inlinesvg/tsconfig.json b/types/react-inlinesvg/tsconfig.json new file mode 100644 index 0000000000..c68bc64bac --- /dev/null +++ b/types/react-inlinesvg/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "react-inlinesvg-tests.tsx" + ] +} diff --git a/types/react-inlinesvg/tslint.json b/types/react-inlinesvg/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-inlinesvg/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-instantsearch-core/index.d.ts b/types/react-instantsearch-core/index.d.ts new file mode 100644 index 0000000000..bceb91ca85 --- /dev/null +++ b/types/react-instantsearch-core/index.d.ts @@ -0,0 +1,542 @@ +// Type definitions for react-instantsearch-core 5.2 +// Project: https://community.algolia.com/react-instantsearch/ +// Definitions by: Gordon Burgett +// Justin Powell +// David Furlong +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +import * as React from 'react'; + +// Core +/** + * Creates a specialized root InstantSearch component. It accepts + * an algolia client and a specification of the root Element. + * @param defaultAlgoliaClient - a function that builds an Algolia client + * @param root - the defininition of the root of an InstantSearch sub tree. + * @returns an InstantSearch root + */ +export function createInstantSearch( + defaultAlgoliaClient: (appId: string, apiKey: string, options: { _useRequestCache: boolean }) => object, + root: object +): React.ComponentClass; + +/** + * Creates a specialized root Index component. It accepts + * a specification of the root Element. + * @param defaultRoot - the defininition of the root of an Index sub tree. + * @return a Index root + */ +export function createIndex(defaultRoot: object): React.ComponentClass; + +export interface ConnectorDescription { + displayName: string; + propTypes?: any; + defaultProps?: any; + + /** + * This method should return the props to forward to the composed component. + * props are the props that were provided to the higher-order component. + * searchState holds the search state of all widgets. You can find the shape of all widgets search state in the corresponding guide. + * searchResults holds the search results, search errors and search loading state, with the shape + * {results: ?SearchResults, error: ?Error, searching: boolean, searchingForFacetValues: boolean}. The SearchResults type is described in the Helper’s documentation. + * meta is the list of metadata from all widgets whose connector defines a getMetadata method. + * searchForFacetValuesResults holds the search for facet values results. + */ + getProvidedProps?(...args: any[]): any; + + /** + * This method defines exactly how the refine prop of widgets affects the search state. + * It takes in the current props of the higher-order component, the search state of all widgets, as well as all arguments passed + * to the refine and createURL props of stateful widgets, and returns a new state. + */ + refine?(...args: any[]): any; + + /** + * This method applies the current props and state to the provided SearchParameters, and returns a new SearchParameters. The SearchParameters + * type is described in the Helper’s documentation. + * Every time the props or state of a widget change, all the getSearchParameters methods of all the registered widgets are called in a chain + * to produce a new SearchParameters. Then, if the output SearchParameters differs from the previous one, a new search is triggered. + * As such, the getSearchParameters method allows you to describe how the state and props of a widget should affect the search parameters. + */ + getSearchParameters?(...args: any[]): any; + + /** + * This method allows the widget to register a custom metadata object for any props and state combination. + * If your widget is stateful, the corresponding URL key should be declared on the metadata object as the id property, so that the InstantSearch + * component can determine which URL keys it controls and which are foreign and should be left intact. + * The metadata object also allows you to declare any data that you would like to pass down to all other widgets. The list of metadata objects of + * all components is available as the fourth argument to the getProvidedProps method. + * The CurrentRefinements widget leverages this mechanism in order to allow any widget to declare the filters it has applied. If you want to add + * your own filter, declare a filters property on your widget’s metadata + */ + getMetadata?(...args: any[]): any; + + /** + * This method needs to be implemented if you want to have the ability to perform a search for facet values inside your widget. + * It takes in the current props of the higher-order component, the search state of all widgets, as well as all arguments passed to the searchForFacetValues + * props of stateful widgets, and returns an object of the shape: {facetName: string, query: string, maxFacetHits?: number}. The default value for the + * maxFacetHits is the one set by the API which is 10. + */ + searchForFacetValues?(...args: any[]): any; + + /** + * This method is called when a widget is about to unmount in order to clean the searchState. + * It takes in the current props of the higher-order component and the searchState of all widgets and expect a new searchState in return. + * props are the props that were provided to the higher-order component. + * searchState holds the searchState of all widgets, with the shape {[widgetId]: widgetState}. Stateful widgets describe the format of their searchState + * in their respective documentation entry. + */ + cleanUp?(...args: any[]): any; +} + +/** + * Connectors are the HOC used to transform React components + * into InstantSearch widgets. + * In order to simplify the construction of such connectors + * `createConnector` takes a description and transform it into + * a connector. + * @param connectorDesc the description of the connector + * @return a function that wraps a component into + * an instantsearch connected one. + */ +export function createConnector(connectorDesc: ConnectorDescription): (Composed: React.ComponentType) => React.ComponentClass; + +// Utils +export const HIGHLIGHT_TAGS: { + highlightPreTag: string, + highlightPostTag: string, +}; +export const version: string; +export function translatable(defaultTranslations: any): (Composed: React.ComponentType) => React.ComponentClass; + +// Widgets +/** + * Configure is a widget that lets you provide raw search parameters + * to the Algolia API. + * + * Any of the props added to this widget will be forwarded to Algolia. For more information + * on the different parameters that can be set, have a look at the + * [reference](https://www.algolia.com/doc/api-client/javascript/search#search-parameters). + * + * This widget can be used either with react-dom and react-native. It will not render anything + * on screen, only configure some parameters. + */ +export class Configure extends React.Component {} + +// Connectors +export function connectAutoComplete(Composed: React.ComponentType): React.ComponentClass; +export function connectBreadcrumb(Composed: React.ComponentType): React.ComponentClass; +export function connectConfigure(Composed: React.ComponentType): React.ComponentClass; + +export type Refinement = { + label: string; + attribute: string; + index: string; + id: string; + value: RefinementValue; +} & ({ + currentRefinement: string; +} | { + items: Array<{ label: string, value: RefinementValue }>; + currentRefinement: string[]; +}); + +export type RefinementValue = (searchState: SearchState) => SearchState; + +export interface CurrentRefinementsExposed { + /** + * Function to modify the items being displayed, e.g. for filtering or sorting them. + * Takes an items as parameter and expects it back in return. + */ + transformItems?: (...args: any[]) => any; + /** Pass true to also clear the search query */ + clearsQuery?: boolean; +} + +export interface CurrentRefinementsProvided { + /** a function to remove a single filter */ + refine: (refinement: RefinementValue | RefinementValue[]) => void; + /** + * all the filters, the value is to pass to the refine function for removing all currentrefinements, + * label is for the display. When existing several refinements for the same atribute name, then you + * get a nested items object that contains a label and a value function to use to remove a single filter. + * attribute and currentRefinement are metadata containing row values. + */ + items: Refinement[]; + /** the search query */ + query: string; +} + +export function connectCurrentRefinements( + stateless: React.StatelessComponent, +): React.ComponentClass; +export function connectCurrentRefinements>( + Composed: React.ComponentType, +): ConnectedComponentClass; + +export interface NESW { + northEast: { lat: number, lng: number }; + southWest: { lat: number, lng: number }; +} + +export interface GeoSearchExposed { + defaultRefinement?: NESW; +} +export interface GeoSearchProvided { + /** a function to toggle the refinement */ + refine: (refinement: NESW) => void; + /** a function to generate a URL for the corresponding search state */ + createURL: (...args: any[]) => any; + /** the records that matched the search */ + hits: THit[]; + /** true if the current refinement is set with the map bounds */ + isRefinedWithMap: boolean; + /** the refinement currently applied */ + currentRefinement: NESW; + /** the position of the search */ + position: { lat: number, lng: number }; +} +/** + * The GeoSearch connector provides the logic to build a widget that will display the results on a map. + * It also provides a way to search for results based on their position. The connector provides function to manage the + * search experience (search on map interaction). + * + * https://community.algolia.com/react-instantsearch/connectors/connectGeoSearch.html + */ +export function connectGeoSearch(stateless: React.StatelessComponent): React.ComponentClass; +export function connectGeoSearch>, THit>(ctor: React.ComponentType): ConnectedComponentClass, GeoSearchExposed>; + +export function connectHierarchicalMenu(Composed: React.ComponentType): React.ComponentClass; +export function connectHighlight(Composed: React.ComponentType): React.ComponentClass; + +/** + * connectHits connector provides the logic to create connected components that will render the results retrieved from Algolia. + * To configure the number of hits retrieved, use HitsPerPage widget, connectHitsPerPage connector or pass the hitsPerPage prop to a Configure widget. + * Warning: you will need to use the objectID property available on every hit as a key when iterating over them. This will ensure you have the best possible UI experience especially on slow networks. + * + * https://community.algolia.com/react-instantsearch/connectors/connectHits.html + */ +export function connectHits(ctor: React.ComponentType): ConnectedComponentClass; + +export function connectHitsPerPage(Composed: React.ComponentType): React.ComponentClass; + +export interface InfiniteHitsProvided { + /** the records that matched the search */ + hits: THit[]; + /** a function to toggle the refinement */ + refine: (...args: any[]) => any; + /** indicates if there are more pages to load */ + hasMore: boolean; +} + +/** + * InfiniteHits connector provides the logic to create connected components that will render an continuous list of results retrieved from Algolia. + * This connector provides a function to load more results. + * + * https://community.algolia.com/react-instantsearch/connectors/connectInfiniteHits.html + */ +export function connectInfiniteHits(Composed: React.ComponentType): React.ComponentClass; +export function connectInfiniteHits>, THit>(ctor: React.ComponentType): ConnectedComponentClass>; + +export interface MenuProvided { + items: Array<{ count: number, isRefined: boolean, label: string, value: string }>; + currentRefinement: string; + refine: (...args: any[]) => any; + createURL: (...args: any[]) => any; + searchForItems: (...args: any[]) => any; + isFromSearch: boolean; +} +export interface MenuExposed { + attribute: string; + showMore?: boolean; + limit?: number; + showMoreLimit?: number; + defaultRefinement?: string; + transformItems?: (...args: any[]) => any; + searchable?: boolean; +} +/** + * connectMenu connector provides the logic to build a widget that will give the user the ability to choose a single value for a specific facet. + * + * https://community.algolia.com/react-instantsearch/connectors/connectMenu.html + */ +export function connectMenu(stateless: React.StatelessComponent): React.ComponentClass; +export function connectMenu>(ctor: React.ComponentType): ConnectedComponentClass; + +export interface NumericMenuProvided { + /** the list of ranges the NumericMenu can display. */ + items: Array<{isRefined: boolean, label: string, value: string, noRefinement: boolean}>; + /** + * the refinement currently applied. follow the shape of a string with a pattern of '{start}:{end}' which corresponds to the current selected item. + * For instance, when the selected item is {start: 10, end: 20}, the searchState of the widget is '10:20'. When start isn’t defined, the searchState + * of the widget is ':{end}', and the same way around when end isn’t defined. However, when neither start nor end are defined, the searchState is an empty string. + */ + currentRefinement: string; + /** a function to select a range. */ + refine: (...args: any[]) => any; + /** a function to generate a URL for the corresponding search state */ + createURL: (...args: any[]) => any; +} +export interface NumericMenuExposed { + id?: string; + /** the name of the attribute in the records */ + attribute: string; + /** List of options. With a text label, and upper and lower bounds. */ + items: Array<{ + label: string | JSX.Element; + start?: number; + end?: number; + }>; + /** the value of the item selected by default, follow the shape of a string with a pattern of '{start}:{end}'. */ + defaultRefinement?: string; + /** (...args: any[]) => any to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. */ + transformItems?: (...args: any[]) => any; +} +/** + * connectNumericMenu connector provides the logic to build a widget that will give the user the ability to select a range value for a numeric attribute. + * Ranges are defined statically. + * + * https://community.algolia.com/react-instantsearch/connectors/connectNumericMenu.html + */ +export function connectNumericMenu(stateless: React.StatelessComponent): React.ComponentClass; +export function connectNumericMenu>(ctor: React.ComponentType): ConnectedComponentClass; + +export function connectPagination(Composed: React.ComponentType): React.ComponentClass; +export function connectPoweredBy(Composed: React.ComponentType): React.ComponentClass; +export function connectRange(Composed: React.ComponentType): React.ComponentClass; + +export interface RefinementListProvided { + /** a function to toggle a refinement */ + refine: (value: string[]) => any; + /** a function to generate a URL for the corresponding search state */ + createURL: (...args: any[]) => any; + /** the refinement currently applied */ + currentRefinement: string[]; + /** + * The list of items the RefinementList can display. + * If isFromSearch is false, the hit properties like _highlightResult are undefined + */ + items: Array>; + /** a function to toggle a search inside items values */ + searchForItems: (...args: any[]) => any; + /** a boolean that says if the items props contains facet values from the global search or from the search inside items. */ + isFromSearch: boolean; + /** a boolean that says whether you can currently refine */ + canRefine: boolean; +} +export interface RefinementListExposed { + /** the name of the attribute in the record */ + attribute: string; + /** allow search inside values */ + searchable?: boolean; + /** How to apply the refinements. Possible values: ‘or’ or ‘and’. */ + operator?: 'or' | 'and'; + /** true if the component should display a button that will expand the number of items */ + showMore?: boolean; + /** the minimum number of displayed items */ + limit?: number; + /** the maximun number of displayed items. Only used when showMore is set to true */ + showMoreLimit?: number; + /** + * the values of the items selected by default. The searchState of this widget takes the form of a list of strings, + * which correspond to the values of all selected refinements. However, when there are no refinements selected, + * the value of the searchState is an empty string. + */ + defaultRefinement?: string[]; + /** (...args: any[]) => any to modify the items being displayed, e.g. for filtering or sorting them. Takes an items as parameter and expects it back in return. */ + transformItems?: (...args: any[]) => any; +} + +/** + * connectRefinementList connector provides the logic to build a widget that will give the user the ability to choose multiple values for a specific facet. + * + * https://community.algolia.com/react-instantsearch/connectors/connectRefinementList.html + */ +export function connectRefinementList(stateless: React.StatelessComponent): React.ComponentClass; +export function connectRefinementList>(ctor: React.ComponentType): + ConnectedComponentClass; + +export function connectScrollTo(Composed: React.ComponentType): React.ComponentClass; + +export interface SearchBoxProvided { + /** a function to change the current query */ + refine: (...args: any[]) => any; + /** the current query used */ + currentRefinement: string; + /** a flag that indicates if InstantSearch has detected that searches are stalled */ + isSearchStalled: boolean; +} +export interface SearchBoxExposed { + /** Provide a default value for the query */ + defaultRefinement?: string; +} +export function connectSearchBox(stateless: React.StatelessComponent): React.ComponentClass; +export function connectSearchBox>(ctor: React.ComponentType): ConnectedComponentClass; + +export function connectSortBy(Composed: React.ComponentType): React.ComponentClass; + +export interface StateResultsProvided { + /** The search state of the instant search component. */ + searchState: SearchState; + /** + * The search results. + * In case of multiple indices: if used under , results will be those of the corresponding index + * otherwise it’ll be those of the root index + */ + searchResults: SearchResults; + /** In case of multiple indices you can retrieve all the results */ + allSearchResults: { [index: string]: SearchResults }; + /** If there is a search in progress. */ + searching: boolean; + /** Flag that indicates if React InstantSearch has detected that searches are stalled. */ + isSearchStalled: any; + /** If the search failed, the error will be logged here. */ + error: AlgoliaError; + /** If there is a search in a list in progress. */ + searchingForFacetValues: any; +} +/** + * The connectStateResults connector provides a way to access the `searchState` and the `searchResults` of InstantSearch. + * For instance this connector allows you to create results/noResults or query/noQuery pages. + * + * https://community.algolia.com/react-instantsearch/connectors/connectStateResults.html + */ +export function connectStateResults(stateless: React.StatelessComponent): React.ComponentClass; +export function connectStateResults>, TDoc>(ctor: React.ComponentType): ConnectedComponentClass>; + +export function connectStats(Composed: React.ComponentType): React.ComponentClass; +export function connectToggleRefinement(Composed: React.ComponentType): React.ComponentClass; + +export interface AlgoliaError { + stack: string; + name: string; + message: string; + debugData: any[]; + statusCode: number; +} + +type Omit = Pick>; + +export type ConnectedComponentClass + = React.ComponentClass & TExposedProps>; + +/** + * The searchState contains all widgets states. If a widget uses an attribute, + * we store it under its widget category to prevent collision. + * + * https://community.algolia.com/react-instantsearch/guide/Search_state.html + */ +export interface SearchState { + range?: { + [key: string]: { + min: number; + max: number; + } + }; + configure?: { + aroundLatLng: boolean; + [key: string]: any; + }; + refinementList?: { + [key: string]: string[] + }; + hierarchicalMenu?: { + [key: string]: string + }; + menu?: { + [key: string]: string + }; + multiRange?: { + [key: string]: string + }; + toggle?: { + [key: string]: boolean + }; + hitsPerPage?: number; + sortBy?: string; + query?: string; + page?: number; + + indices?: { + [index: string]: { + configure: { + hitsPerPage: number, + }, + } + }; +} + +/** + * The most basic possible document in an Algolia index: + * a set of string-value pairs. + */ +export interface BasicDoc { [k: string]: string; } + +/** + * The shape of the searchResults object provided + * via connectors + * https://community.algolia.com/algoliasearch-helper-js/reference.html#searchresults + */ +export interface SearchResults { + query: string; + hits: Array>; + index: string; + hitsPerPage: number; + nbHits: number; + nbPages: number; + page: number; + processingTimeMS: number; + exhaustiveNbHits: true; + disjunctiveFacets: any[]; + hierarchicalFacets: any[]; + facets: any[]; + aroundLatLng?: string; + automaticRadius?: string; +} + +/** + * All the records that match the search parameters. + * Each record is augmented with a new attribute `_highlightResult` which is an + * object keyed by attribute and contains additional properties + * https://community.algolia.com/algoliasearch-helper-js/reference.html#SearchResults#hits + */ +export type Hit = TDoc & { + objectID: string; + /** + * Contains the searchable attributes within the document and shows which part of the + * attribute was matched by the search terms. Note that if the index has defined + * any searchable attributes, this object will only contain those keys and others + * will not exist. + */ + '_highlightResult': HighlightResult; +}; + +export type HighlightResult = + TDoc extends { [k: string]: any } ? + { [K in keyof TDoc]?: HighlightResultField } : + never; + +type HighlightResultField = + TField extends Array ? + HighlightResultArray : + TField extends string ? + HighlightResultPrimitive : + HighlightResult; + +type HighlightResultArray = + TItem extends string ? + HighlightResultPrimitive[] : + Array>; + +interface HighlightResultPrimitive { + /** the value of the facet highlighted (html) */ + value: string; + /** full, partial or none depending on how the query terms match */ + matchLevel: 'none' | 'partial' | 'full'; + matchedWords: string[]; + fullyHighlighted?: boolean; +} + +// Turn off automatic exports - so we don't export internal types like Omit<> +export {}; diff --git a/types/react-instantsearch-core/react-instantsearch-core-tests.tsx b/types/react-instantsearch-core/react-instantsearch-core-tests.tsx new file mode 100644 index 0000000000..e39a9f53e6 --- /dev/null +++ b/types/react-instantsearch-core/react-instantsearch-core-tests.tsx @@ -0,0 +1,221 @@ +import * as React from 'react'; +import { + createInstantSearch, + createIndex, + createConnector, + SearchResults, + connectStateResults, + SearchBoxProvided, + connectSearchBox, + connectRefinementList, + CurrentRefinementsProvided, + connectCurrentRefinements, + RefinementListProvided, + Refinement +} from 'react-instantsearch-core'; + +() => { + const InstantSearch = createInstantSearch(() => ({}), {Root: 'div', props: {className: `widget`}}); + + +
          +
          ; +}; + +() => { + const Index = createIndex({Root: 'div', props: {className: `widget`}}); + + +
          +
          ; +}; + +// https://community.algolia.com/react-instantsearch/guide/Custom_connectors.html +() => { + const CoolWidget = createConnector({ + displayName: 'CoolWidget', + + getProvidedProps(props, searchState) { + // Since the `queryAndPage` searchState entry isn't necessarily defined, we need + // to default its value. + const [query, page] = searchState.queryAndPage || ['', 0]; + + // Connect the underlying component to the `queryAndPage` searchState entry. + return { + query, + page, + }; + }, + + refine(props, searchState, newQuery, newPage) { + // When the underlying component calls its `refine` prop, update the searchState + // with the new query and page. + return { + // `searchState` represents the search state of *all* widgets. We need to extend it + // instead of replacing it, otherwise other widgets will lose their + // respective state. + ...searchState, + queryAndPage: [newQuery, newPage], + }; + }, + })(props => +
          + The query is {props.query}, the page is {props.page}. + {/* + Clicking on this button will update the searchState to: + { + ...otherSearchState, + query: 'algolia', + page: 20, + } + */} +
          + ); + + +
          +
          ; +}; + +() => { + interface StateResultsProps { + searchResults: SearchResults<{ + field1: string + field2: number + field3: { compound: string } + }>; + // partial of StateResultsProvided + + additionalProp: string; + } + + const Stateless = ({ additionalProp, searchResults }: StateResultsProps) => +
          +

          {additionalProp}

          + {searchResults.hits.map((h) => { + // $ExpectType string + const compound = h._highlightResult.field3!.compound!.value; + return {compound}; + })} +
          ; + const ComposedStateless = connectStateResults(Stateless); + + ; // $ExpectError + + ; + + class MyComponent extends React.Component { + render() { + const { additionalProp, searchResults } = this.props; + return
          +

          {additionalProp}

          + {searchResults.hits.map((h) => { + // $ExpectType string[] + const words = h._highlightResult.field3!.compound!.matchedWords; + return {h.field2}: {words.join(',')}; + })} +
          ; + } + } + const ComposedMyComponent = connectStateResults(MyComponent); + + ; // $ExpectError + + ; +}; + +() => { + const InstantSearch = createInstantSearch( + () => null, // $ExpectError + {} + ); +}; + +// https://community.algolia.com/react-instantsearch/guide/Connectors.html +() => { + const MySearchBox = ({currentRefinement, refine}: SearchBoxProvided) => + refine(e.target.value)} + />; + + // `ConnectedSearchBox` renders a `` widget that is connected to + // the state, providing it with `currentRefinement` and `refine` props for + // reading and manipulating the current query of the search. + const ConnectedSearchBox = connectSearchBox(MySearchBox); +}; + +() => { + const MyCurrentRefinements = ({refine, items, query}: CurrentRefinementsProvided) => + <> + {items.map((refinement) => ( +
          refine(refinement.value) }> + +
          + ))} + ; + + const ConnectedCurrentRefinements = connectCurrentRefinements(MyCurrentRefinements); + + item} />; +}; + +() => { + function renderRefinement( + label: string, + value: Refinement['value'], + refine: CurrentRefinementsProvided['refine'], + ) { + return ; + } + + const MyCurrentRefinements = connectCurrentRefinements(({refine, items, query}: CurrentRefinementsProvided) => { + return <> + {items.map((refinement) => { + let str: string = refinement.currentRefinement; // $ExpectError + /* + * When existing several refinements for the same atribute name, then you get a + * nested items object that contains a label and a value function to use to remove a single filter. + * https://community.algolia.com/react-instantsearch/connectors/connectCurrentRefinements.html + */ + if ('items' in refinement) { + str = refinement.currentRefinement; // $ExpectError + return <> + {refinement.items.map((i) => renderRefinement(i.label, i.value, refine))} + ; + } + + console.log(refinement.items); // $ExpectError + return renderRefinement(refinement.currentRefinement, refinement.value, refine); + })} + ; + }); +}; + +() => { + const MyRefinementList = ({items, refine}: RefinementListProvided) => + <> + {items.map((item) => ( + + ))} + ; + const ConnectedRefinementList = connectRefinementList(MyRefinementList); + + ; +}; diff --git a/types/react-instantsearch-core/tsconfig.json b/types/react-instantsearch-core/tsconfig.json new file mode 100644 index 0000000000..44fe46a735 --- /dev/null +++ b/types/react-instantsearch-core/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "jsx": "react", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-instantsearch-core-tests.tsx" + ] +} diff --git a/types/react-instantsearch-core/tslint.json b/types/react-instantsearch-core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-instantsearch-core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-instantsearch-dom/index.d.ts b/types/react-instantsearch-dom/index.d.ts new file mode 100644 index 0000000000..6ecb03c981 --- /dev/null +++ b/types/react-instantsearch-dom/index.d.ts @@ -0,0 +1,137 @@ +// Type definitions for react-instantsearch 5.2 +// Project: https://community.algolia.com/react-instantsearch/ +// Definitions by: Gordon Burgett +// Justin Powell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +import * as React from 'react'; + +import { Hit, BasicDoc } from 'react-instantsearch-core'; + +// Core +export { createConnector } from 'react-instantsearch-core'; +export { HIGHLIGHT_TAGS } from 'react-instantsearch-core'; +export { translatable } from 'react-instantsearch-core'; + +// Widget +export { Configure } from 'react-instantsearch-core'; + +// Connectors +export { connectAutoComplete } from 'react-instantsearch-core'; +export { connectBreadcrumb } from 'react-instantsearch-core'; +export { connectConfigure } from 'react-instantsearch-core'; +export { connectCurrentRefinements } from 'react-instantsearch-core'; +export { connectGeoSearch } from 'react-instantsearch-core'; +export { connectHierarchicalMenu } from 'react-instantsearch-core'; +export { connectHighlight } from 'react-instantsearch-core'; +export { connectHits } from 'react-instantsearch-core'; +export { connectHitsPerPage } from 'react-instantsearch-core'; +export { connectInfiniteHits } from 'react-instantsearch-core'; +export { connectMenu } from 'react-instantsearch-core'; +export { connectNumericMenu } from 'react-instantsearch-core'; +export { connectPagination } from 'react-instantsearch-core'; +export { connectPoweredBy } from 'react-instantsearch-core'; +export { connectRange } from 'react-instantsearch-core'; +export { connectRefinementList } from 'react-instantsearch-core'; +export { connectScrollTo } from 'react-instantsearch-core'; +export { connectSearchBox } from 'react-instantsearch-core'; +export { connectSortBy } from 'react-instantsearch-core'; +export { connectStateResults } from 'react-instantsearch-core'; +export { connectStats } from 'react-instantsearch-core'; +export { connectToggleRefinement } from 'react-instantsearch-core'; + +// DOM +interface CommonWidgetProps { + /** + * All static text rendered by widgets, such as “Load more”, “Show more” are translatable using the translations prop on relevant widgets. + * This prop is a mapping of keys to translation values. Translation values can be either a String or a (...args: any[]) => any, as some take parameters. + * + * https://community.algolia.com/react-instantsearch/guide/i18n.html + */ + translations?: { [key: string]: string | ((...args: any[]) => any) }; +} + +export interface InstantSearchProps { + apiKey: string; + appId: string; + indexName: string; + + algoliaClient?: any; + searchClient?: any; + createURL?: (...args: any[]) => any; + searchState?: any; + refresh?: boolean; + onSearchStateChange?: (...args: any[]) => any; + onSearchParameters?: (...args: any[]) => any; + resultsState?: any; + root?: { + Root: string | ((...args: any[]) => any); + props: any; + }; +} +/** + * is the root component of all React InstantSearch implementations. It provides all the connected components (aka widgets) a means to interact with the searchState. + * + * https://community.algolia.com/react-instantsearch/widgets/%3CInstantSearch%3E.html + */ +export class InstantSearch extends React.Component {} +export class Index extends React.Component {} +export class Breadcrumb extends React.Component {} +export class ClearRefinements extends React.Component {} +export class CurrentRefinements extends React.Component {} +export class HierarchicalMenu extends React.Component {} +export class Highlight extends React.Component {} + +export interface HitsProps { + hitComponent?: React.ComponentType<{ hit: Hit }>; +} +/** + * Displays a list of hits. + * To configure the number of hits being shown, use the HitsPerPage widget, connectHitsPerPage connector or the Configure widget. + * + * https://community.algolia.com/react-instantsearch/widgets/Hits.html + */ +export class Hits extends React.Component> {} +export class HitsPerPage extends React.Component {} +export class InfiniteHits extends React.Component {} +export class Menu extends React.Component {} +export class MenuSelect extends React.Component {} +export class NumericMenu extends React.Component {} +export class Pagination extends React.Component {} +export class Panel extends React.Component {} +export class PoweredBy extends React.Component {} +export class RangeInput extends React.Component {} +export class RangeSlider extends React.Component {} +export class RatingMenu extends React.Component {} +export class RefinementList extends React.Component {} +export class ScrollTo extends React.Component {} + +export interface SearchBoxProps extends CommonWidgetProps { + focusShortcuts?: string[]; + autoFocus?: boolean; + defaultRefinement?: string; + searchAsYouType?: boolean; + showLoadingIndicator?: boolean; + + submit?: JSX.Element; + reset?: JSX.Element; + loadingIndicator?: JSX.Element; + + onSubmit?: (event: React.SyntheticEvent) => any; + onReset?: (event: React.SyntheticEvent) => any; + onChange?: (event: React.SyntheticEvent) => any; +} +/** + * The SearchBox component displays a search box that lets the user search for a specific query. + * + * https://community.algolia.com/react-instantsearch/widgets/SearchBox.html + */ +export class SearchBox extends React.Component {} +export class Snippet extends React.Component {} +export class SortBy extends React.Component {} +/** + * The Stats component displays the total number of matching hits and the time it took to get them (time spent in the Algolia server). + */ +export class Stats extends React.Component<{translations?: { [key: string]: (n: number, ms: number) => string }}> {} +export class ToggleRefinement extends React.Component {} diff --git a/types/react-instantsearch-dom/react-instantsearch-dom-tests.tsx b/types/react-instantsearch-dom/react-instantsearch-dom-tests.tsx new file mode 100644 index 0000000000..e10d3fde08 --- /dev/null +++ b/types/react-instantsearch-dom/react-instantsearch-dom-tests.tsx @@ -0,0 +1,280 @@ +import * as React from 'react'; +import { InstantSearch, Hits, Highlight, SearchBox, RefinementList, CurrentRefinements, ClearRefinements, Pagination, Menu, Configure, Index } from 'react-instantsearch/dom'; +import { Hit, connectRefinementList, connectMenu } from 'react-instantsearch-core'; + +// DOM +// https://community.algolia.com/react-instantsearch/Getting_started.html +() => { + const App = () => ( + + + + ); + + function Search() { + return ( +
          + +
          + ); + } + + function Product({ hit }: { hit: Hit }) { + return
          {hit.name}
          ; + } + + function Search2() { + return ( +
          + +
          + ); + } + + function Product2({ hit }: { hit: Hit }) { + return ( +
          + + + +
          + ); + } + + function Search3() { + return ( +
          + + + +
          + ); + } + + function Search4() { + return ( +
          + + + + + + +
          + ); + } +}; + +// https://community.algolia.com/react-instantsearch/guide//Highlighting_results.html +() => { + const Hit = ({ hit }: { hit: Hit }) => ( +

          + +

          + ); + + function App() { + return ( + + + + ); + } +}; + +// TODO +// () => { +// const CustomHighlight = connectHighlight( +// ({ highlight, attribute, hit, highlightProperty }) => { +// const parsedHit = highlight({ +// attribute, +// hit, +// highlightProperty: '_highlightResult' +// }); +// const highlightedHits = parsedHit.map(part => { +// if (part.isHighlighted) return {part.value}; +// return part.value; +// }); +// return
          {highlightedHits}
          ; +// } +// ); + +// const Hit = ({ hit }: { hit: Hit }) => ( +//

          +// +//

          +// ); + +// function App() { +// return ( +// +// +// +// ); +// } +// }; + +// https://community.algolia.com/react-instantsearch/guide/i18n.html +() => { + const App = () => ( + + + + ); +}; + +// https://community.algolia.com/react-instantsearch/guide/Sorting_and_filtering.html +// TODO +// () => { +// const App = () => ( +// +// +// +// orderBy(items, ['label', 'count'], ['asc', 'desc']) +// } +// /> +// +// ); +// }; + +// https://community.algolia.com/react-instantsearch/guide/Default_refinements.html +() => { + const App = () => ( + + + + + ); +}; + +// TODO +// () => { +// const VirtualMenu = connectMenu(() => null); + +// const App = () => ( +// +//
          +// +// items.filter(item => item.currentRefinement !== 'Orange') +// } +// /> +// +// +// +//
          +//
          +// ); +// }; + +// https://community.algolia.com/react-instantsearch/guide/Searching_in_Lists.html + +; + +() => { + // https://community.algolia.com/react-instantsearch/guide/Search_parameters.html + + + // widgets + ; +}; + +(() => { + function onSearchBoxChange(event: React.SyntheticEvent) { + } + + function onSearchBoxReset(event: React.SyntheticEvent) { + } + + function onSearchBoxSubmit(event: React.SyntheticEvent) { + } + + } />; +}); + +import { createInstantSearch } from 'react-instantsearch-dom/server'; +// import { createServer } from 'http'; +declare function createServer(handler: (req: any, res: any) => any): any; +import { renderToString } from 'react-dom/server'; + +() => { + // https://community.algolia.com/react-instantsearch/guide/Server-side_rendering.html + + // Now we create a dedicated `InstantSearch` component + const { InstantSearch, findResultsState } = createInstantSearch(); + + class App extends React.Component { + render() { + return ( + + + + + ); + } + } + + const server = createServer(async (req, res) => { + const searchState = {query: 'chair'}; + const resultsState = await findResultsState(App, {searchState}); + const appInitialState = {searchState, resultsState}; + const appAsString = renderToString(); + res.send( + ` + + + +

          Awesome server-side rendered search

          + ${appAsString}
          + + + + ` + ); + }); +}; diff --git a/types/react-instantsearch-dom/server.d.ts b/types/react-instantsearch-dom/server.d.ts new file mode 100644 index 0000000000..b1ba930ace --- /dev/null +++ b/types/react-instantsearch-dom/server.d.ts @@ -0,0 +1,14 @@ +import * as React from 'react'; + +/** + * Creates a specialized root InstantSearch component. It accepts + * an algolia client and a specification of the root Element. + * @param defaultAlgoliaClient - a function that builds an Algolia client + * @returns an InstantSearch root + */ +export function createInstantSearch( + defaultAlgoliaClient?: (appId: string, apiKey: string, options: { _useRequestCache: boolean }) => object +): { + InstantSearch: React.ComponentClass; + findResultsState(App: React.ComponentType, props: any): Promise +}; diff --git a/types/react-instantsearch-dom/tsconfig.json b/types/react-instantsearch-dom/tsconfig.json new file mode 100644 index 0000000000..15ec605c21 --- /dev/null +++ b/types/react-instantsearch-dom/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 + }, + "files": [ + "index.d.ts", + "server.d.ts", + "react-instantsearch-dom-tests.tsx" + ] +} diff --git a/types/react-instantsearch-dom/tslint.json b/types/react-instantsearch-dom/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-instantsearch-dom/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-instantsearch-native/index.d.ts b/types/react-instantsearch-native/index.d.ts new file mode 100644 index 0000000000..6b328de132 --- /dev/null +++ b/types/react-instantsearch-native/index.d.ts @@ -0,0 +1,68 @@ +// Type definitions for react-instantsearch-native 5.3 +// Project: https://community.algolia.com/react-instantsearch +// Definitions by: Gordon Burgett +// Justin Powell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +import * as React from 'react'; + +// Core +export { createConnector } from 'react-instantsearch-core'; +export { HIGHLIGHT_TAGS } from 'react-instantsearch-core'; +export { translatable } from 'react-instantsearch-core'; + +// Widget +export { Configure } from 'react-instantsearch-core'; + +// Connectors +export { connectAutoComplete } from 'react-instantsearch-core'; +export { connectBreadcrumb } from 'react-instantsearch-core'; +export { connectConfigure } from 'react-instantsearch-core'; +export { connectCurrentRefinements } from 'react-instantsearch-core'; +export { connectGeoSearch } from 'react-instantsearch-core'; +export { connectHierarchicalMenu } from 'react-instantsearch-core'; +export { connectHighlight } from 'react-instantsearch-core'; +export { connectHits } from 'react-instantsearch-core'; +export { connectHitsPerPage } from 'react-instantsearch-core'; +export { connectInfiniteHits } from 'react-instantsearch-core'; +export { connectMenu } from 'react-instantsearch-core'; +export { connectNumericMenu } from 'react-instantsearch-core'; +export { connectPagination } from 'react-instantsearch-core'; +export { connectPoweredBy } from 'react-instantsearch-core'; +export { connectRange } from 'react-instantsearch-core'; +export { connectRefinementList } from 'react-instantsearch-core'; +export { connectScrollTo } from 'react-instantsearch-core'; +export { connectSearchBox } from 'react-instantsearch-core'; +export { connectSortBy } from 'react-instantsearch-core'; +export { connectStateResults } from 'react-instantsearch-core'; +export { connectStats } from 'react-instantsearch-core'; +export { connectToggleRefinement } from 'react-instantsearch-core'; + +// Native +export interface InstantSearchProps { + apiKey: string; + appId: string; + indexName: string; + + algoliaClient?: any; + searchClient?: any; + createURL?: (...args: any[]) => any; + searchState?: any; + refresh?: boolean; + onSearchStateChange?: (...args: any[]) => any; + onSearchParameters?: (...args: any[]) => any; + resultsState?: any; + root?: { + Root: string | ((...args: any[]) => any); + props: any; + }; +} +/** + * is the root component of all React InstantSearch implementations. It provides all the connected components (aka widgets) a means to interact with the searchState. + * + * https://community.algolia.com/react-instantsearch/widgets/%3CInstantSearch%3E.html + */ +export class InstantSearch extends React.Component {} + +export class Index extends React.Component {} diff --git a/types/react-instantsearch-native/react-instantsearch-native-tests.tsx b/types/react-instantsearch-native/react-instantsearch-native-tests.tsx new file mode 100644 index 0000000000..7a369b0487 --- /dev/null +++ b/types/react-instantsearch-native/react-instantsearch-native-tests.tsx @@ -0,0 +1,69 @@ +import * as React from "react"; + +import { SearchBox, Hits, Highlight, Menu } from "react-instantsearch-dom"; +import { InstantSearch, Index, connectStateResults } from 'react-instantsearch-native'; +import { values } from 'lodash'; + +// https://community.algolia.com/react-instantsearch/guide/Conditional_display.html +const App = () => ( + + + +
          + + +
          +
          first:
          + +
          +
          +
          + + +
          +
          second:
          + +
          +
          +
          + + +
          +
          third:
          + +
          +
          +
          +
          +
          +
          +); + +const IndexResults = connectStateResults( + ({ searchState, searchResults, children }) => + searchResults && searchResults.nbHits !== 0 ? ( + children as React.ReactElement + ) : ( +
          + No results has been found for {searchState.query} and index{' '} + {searchResults ? searchResults.index : ''} +
          + ) +); + +const AllResults = connectStateResults(({ allSearchResults, children }) => { + const hasResults = + allSearchResults && + values(allSearchResults).some(results => results.nbHits > 0); + + return !hasResults ? ( +
          +
          No results in category, products or brand
          + + + +
          + ) : ( + children as React.ReactElement + ); +}); diff --git a/types/react-instantsearch-native/tsconfig.json b/types/react-instantsearch-native/tsconfig.json new file mode 100644 index 0000000000..d4fb7501c4 --- /dev/null +++ b/types/react-instantsearch-native/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-instantsearch-native-tests.tsx" + ] +} diff --git a/types/react-instantsearch-native/tslint.json b/types/react-instantsearch-native/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-instantsearch-native/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-instantsearch/connectors.d.ts b/types/react-instantsearch/connectors.d.ts new file mode 100644 index 0000000000..e926f79e0a --- /dev/null +++ b/types/react-instantsearch/connectors.d.ts @@ -0,0 +1,22 @@ +export { connectAutoComplete } from 'react-instantsearch-core'; +export { connectBreadcrumb } from 'react-instantsearch-core'; +export { connectConfigure } from 'react-instantsearch-core'; +export { connectCurrentRefinements } from 'react-instantsearch-core'; +export { connectGeoSearch, GeoSearchExposed, GeoSearchProvided, NESW } from 'react-instantsearch-core'; +export { connectHierarchicalMenu } from 'react-instantsearch-core'; +export { connectHighlight } from 'react-instantsearch-core'; +export { connectHits, Hit } from 'react-instantsearch-core'; +export { connectHitsPerPage } from 'react-instantsearch-core'; +export { connectInfiniteHits } from 'react-instantsearch-core'; +export { connectMenu, MenuExposed, MenuProvided } from 'react-instantsearch-core'; +export { connectNumericMenu, NumericMenuExposed, NumericMenuProvided } from 'react-instantsearch-core'; +export { connectPagination } from 'react-instantsearch-core'; +export { connectPoweredBy } from 'react-instantsearch-core'; +export { connectRange } from 'react-instantsearch-core'; +export { connectRefinementList, RefinementListExposed, RefinementListProvided } from 'react-instantsearch-core'; +export { connectScrollTo } from 'react-instantsearch-core'; +export { connectSearchBox, SearchBoxExposed, SearchBoxProvided } from 'react-instantsearch-core'; +export { connectSortBy } from 'react-instantsearch-core'; +export { connectStateResults, StateResultsProvided, SearchState, SearchResults } from 'react-instantsearch-core'; +export { connectStats } from 'react-instantsearch-core'; +export { connectToggleRefinement } from 'react-instantsearch-core'; diff --git a/types/react-instantsearch/dom.d.ts b/types/react-instantsearch/dom.d.ts new file mode 100644 index 0000000000..ad857eaa58 --- /dev/null +++ b/types/react-instantsearch/dom.d.ts @@ -0,0 +1,27 @@ +export { InstantSearch, InstantSearchProps } from 'react-instantsearch-dom'; +export { Index } from 'react-instantsearch-dom'; +export { Breadcrumb } from 'react-instantsearch-dom'; +export { ClearRefinements } from 'react-instantsearch-dom'; +export { Configure } from 'react-instantsearch-dom'; +export { CurrentRefinements } from 'react-instantsearch-dom'; +export { HierarchicalMenu } from 'react-instantsearch-dom'; +export { Highlight } from 'react-instantsearch-dom'; +export { Hits, HitsProps } from 'react-instantsearch-dom'; +export { HitsPerPage } from 'react-instantsearch-dom'; +export { InfiniteHits } from 'react-instantsearch-dom'; +export { Menu } from 'react-instantsearch-dom'; +export { MenuSelect } from 'react-instantsearch-dom'; +export { NumericMenu } from 'react-instantsearch-dom'; +export { Pagination } from 'react-instantsearch-dom'; +export { Panel } from 'react-instantsearch-dom'; +export { PoweredBy } from 'react-instantsearch-dom'; +export { RangeInput } from 'react-instantsearch-dom'; +export { RangeSlider } from 'react-instantsearch-dom'; +export { RatingMenu } from 'react-instantsearch-dom'; +export { RefinementList } from 'react-instantsearch-dom'; +export { ScrollTo } from 'react-instantsearch-dom'; +export { SearchBox, SearchBoxProps } from 'react-instantsearch-dom'; +export { Snippet } from 'react-instantsearch-dom'; +export { SortBy } from 'react-instantsearch-dom'; +export { Stats } from 'react-instantsearch-dom'; +export { ToggleRefinement } from 'react-instantsearch-dom'; diff --git a/types/react-instantsearch/index.d.ts b/types/react-instantsearch/index.d.ts new file mode 100644 index 0000000000..3f80cf4aa3 --- /dev/null +++ b/types/react-instantsearch/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for react-instantsearch 5.2 +// Project: https://community.algolia.com/react-instantsearch/ +// Definitions by: Gordon Burgett +// Justin Powell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +export { createConnector } from 'react-instantsearch-core'; diff --git a/types/react-instantsearch/native.d.ts b/types/react-instantsearch/native.d.ts new file mode 100644 index 0000000000..ff6ff89a3f --- /dev/null +++ b/types/react-instantsearch/native.d.ts @@ -0,0 +1,3 @@ +export { InstantSearch } from 'react-instantsearch-native'; +export { Index } from 'react-instantsearch-native'; +export { Configure } from 'react-instantsearch-native'; diff --git a/types/react-instantsearch/react-instantsearch-tests.tsx b/types/react-instantsearch/react-instantsearch-tests.tsx new file mode 100644 index 0000000000..9abf91c0ef --- /dev/null +++ b/types/react-instantsearch/react-instantsearch-tests.tsx @@ -0,0 +1,386 @@ +import * as React from "react"; + +import { connectMenu, connectRefinementList, connectStateResults, SearchState } from "react-instantsearch/connectors"; +import { InstantSearch, SearchBox, Index, Hits, Highlight, Menu } from "react-instantsearch/dom"; +import { orderBy, omit, values } from 'lodash'; +import { createInstantSearch } from "react-instantsearch-core"; + +// https://community.algolia.com/react-instantsearch/guide/Search_state.html +() => { + const searchState: SearchState = { + range: { + price: { + min: 20, + max: 3000 + } + }, + configure: { + aroundLatLng: true, + }, + refinementList: { + fruits: ['lemon', 'orange'] + }, + hierarchicalMenu: { + products: 'Laptops > Surface' + }, + menu: { + brands: 'Sony' + }, + multiRange: { + rank: '2:5' + }, + toggle: { + freeShipping: true + }, + hitsPerPage: 10, + sortBy: 'mostPopular', + query: 'ora', + page: 2 + }; +}; + +() => { + const searchState: SearchState = { + query: 'ora', // shared state between all indices + page: 2, // shared state between all indices + indices: { + index1: { + configure: { + hitsPerPage: 3, + }, + }, + index2: { + configure: { + hitsPerPage: 10, + }, + }, + }, + }; +}; + +// https://community.algolia.com/react-instantsearch/guide/Custom_connectors.html +// TODO +// () => { +// const CoolWidget = createConnector({ +// displayName: 'CoolWidget', + +// getProvidedProps(props, searchState) { +// // Since the `queryAndPage` searchState entry isn't necessarily defined, we need +// // to default its value. +// const [query, page] = searchState.queryAndPage || ['', 0]; + +// // Connect the underlying component to the `queryAndPage` searchState entry. +// return { +// query, +// page, +// }; +// }, + +// refine(props, searchState, newQuery, newPage) { +// // When the underlying component calls its `refine` prop, update the searchState +// // with the new query and page. +// return { +// // `searchState` represents the search state of *all* widgets. We need to extend it +// // instead of replacing it, otherwise other widgets will lose their +// // respective state. +// ...searchState, +// queryAndPage: [newQuery, newPage], +// }; +// }, +// })(props => +//
          +// The query is {props.query}, the page is {props.page}. +// {/* +// Clicking on this button will update the searchState to: +// { +// ...otherSearchState, +// query: 'algolia', +// page: 20, +// } +// */} +//
          +// ); +// }; + +// TODO +// () => { +// const Widget = () => null; + +// const CoolWidget = createConnector({ +// // displayName, getProvidedProps, refine + +// getSearchParameters(searchParameters, props, searchState) { +// // Since the `queryAndPage` state entry isn't necessarily defined, we need +// // to default its value. +// const [query, page] = searchState.queryAndPage || ['', 0]; + +// // When the `queryAndPage` state entry changes, update the query and page of +// // search. +// return searchParameters +// .setQuery(query) +// .setPage(page); +// }, +// })(Widget); +// }; + +// TODO +// () => { +// const Widget = () => null; + +// const CoolWidget = createConnector({ +// // displayName, getProvidedProps, refine, getSearchParameters + +// getMetadata(props, searchState) { +// // Since the `queryAndPage` searchState entry isn't necessarily defined, we need +// // to default its value. +// const [query, page] = searchState.queryAndPage || ['', 0]; + +// const filters = []; +// if (query !== '') { +// filters.push({ +// // Unique identifier for this filter. +// key: `queryAndPage.query`, +// // String label (or node) that should appear in the CurrentRefinements +// // component. +// label: `Query: ${query}`, +// // Describes how clearing this filter affects the InstantSearch searchState. +// // In our case, clearing the query just resets it to an empty string +// // without affecting the page. +// clear: nextSearchState => { +// return { +// ...nextSearchState, +// // Do not depend on the current `searchState` here. Since filters can be +// // cleared in batches, the `searchState` parameter is not up-to-date when +// // this method is called. +// queryAndPage: ['', nextSearchState.queryAndPage[1]], +// }; +// }, +// }); +// } + +// if (page !== 0) { +// filters.push({ +// key: `queryAndPage.page`, +// label: `Page: ${page}`, +// clear: nextSearchState => { +// return { +// ...nextSearchState, +// queryAndPage: [nextSearchState.queryAndPage[0], 0], +// }; +// }, +// }); +// } + +// return { +// // This widget manipulates the `queryAndPage` state entry. +// id: 'queryAndPage', +// filters, +// }; +// }, +// })(Widget); +// }; + +// TODO +// () => { +// const Widget = () => null; + +// const CoolWidget = createConnector({ +// // displayName, getProvidedProps, refine, getSearchParameters, getMetadata + +// searchForFacetValues(props, searchState, nextRefinement) { +// return {facetName: props.attribute, query: nextRefinement}; +// }, +// })(Widget); +// }; + +// TODO +// () => { +// const Widget = () => null; + +// const CoolWidget = createConnector({ +// // displayName, getProvidedProps, refine, getSearchParameters, getMetadata + +// cleanUp(props, searchState) { +// return omit('queryAndPage', searchState); +// }, +// })(Widget); +// }; + +// https://community.algolia.com/react-instantsearch/guide/Conditional_display.html +() => { + const Content = connectStateResults( + ({ searchState }) => + searchState && searchState.query + ?
          + The query {searchState.query} exists +
          + :
          No query
          + ); +}; + +() => { + const Content = connectStateResults( + ({ searchState, searchResults }) => + searchResults && searchResults.nbHits !== 0 + ?
          Some results
          + :
          + No results has been found for {searchState.query} +
          + ); +}; + +() => { + const Content = connectStateResults( + ({ error }) => + error ?
          Some error
          :
          No error
          + ); +}; + +() => { + const Content = connectStateResults( + ({ searching }) => + searching ?
          We are searching
          :
          Search finished
          + ); +}; + +() => { + const Content = connectStateResults( + ({ searchingForFacetValues }) => + searchingForFacetValues ?
          We are searching
          :
          Search finished
          + ); +}; + +() => { + const App = () => ( + + + +
          + + +
          +
          first:
          + +
          +
          +
          + + +
          +
          second:
          + +
          +
          +
          + + +
          +
          third:
          + +
          +
          +
          +
          +
          +
          + ); + + const IndexResults = connectStateResults( + ({ searchState, searchResults, children }) => + searchResults && searchResults.nbHits !== 0 ? ( + children as React.ReactElement + ) : ( +
          + No results has been found for {searchState.query} and index{' '} + {searchResults ? searchResults.index : ''} +
          + ) + ); + + const AllResults = connectStateResults(({ allSearchResults, children }) => { + const hasResults = + allSearchResults && + values(allSearchResults).some(results => results.nbHits > 0); + + return !hasResults ? ( +
          +
          No results in category, products or brand
          + + + +
          + ) : ( + children as React.ReactElement + ); + }); +}; + +// https://github.com/algolia/react-instantsearch/blob/master/packages/react-instantsearch-dom/src/widgets/InstantSearch.js +() => { + const InstantSearch = createInstantSearch( + () => ({}), + { + Root: 'div', + props: { + className: 'ais-InstantSearch__root', + }, + } + ); + + ; +}; + +() => { + const RefinementListWithSearchBox = connectRefinementList(props => { + const values = props.items.map(item => { + const label = item._highlightResult + ? + : item.label; + + return ( +
        1. + props.refine(item.value)}> + {label} {item.isRefined ? '- selected' : ''} + +
        2. + ); + }); + + return ( +
          + props.searchForItems((e.target as HTMLInputElement).value)}/> +
            {values}
          +
          + ); + }); + + return ; +}; + +// https://community.algolia.com/react-instantsearch/guide/Virtual_widgets.html +() => { + const VirtualMenu = connectMenu(() => null); + const Hoodies = () => ; + + const App = () => ( + + + + + + ); +}; diff --git a/types/react-instantsearch/server.d.ts b/types/react-instantsearch/server.d.ts new file mode 100644 index 0000000000..d8fb0d1a46 --- /dev/null +++ b/types/react-instantsearch/server.d.ts @@ -0,0 +1 @@ +export { createInstantSearch } from 'react-instantsearch-dom/server'; diff --git a/types/react-instantsearch/tsconfig.json b/types/react-instantsearch/tsconfig.json new file mode 100644 index 0000000000..79afa53442 --- /dev/null +++ b/types/react-instantsearch/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "experimentalDecorators": true, + "jsx": "react", + "lib": ["es6", "dom"], + "module": "commonjs", + "noEmit": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "connectors.d.ts", + "dom.d.ts", + "native.d.ts", + "server.d.ts", + "react-instantsearch-tests.tsx" + ] +} diff --git a/types/react-instantsearch/tslint.json b/types/react-instantsearch/tslint.json new file mode 100644 index 0000000000..30a1bdde2e --- /dev/null +++ b/types/react-instantsearch/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/react-intl-redux/index.d.ts b/types/react-intl-redux/index.d.ts index 9d9e805df9..4410e7c019 100644 --- a/types/react-intl-redux/index.d.ts +++ b/types/react-intl-redux/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/ratson/react-intl-redux // Definitions by: Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.0 import { Action, AnyAction } from "redux" import { Provider as ReduxProvider } from "react-redux" diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index 899859a69d..33effbff95 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -9,6 +9,7 @@ // Krister Kari // Martin Raedlinger // Kanitkorn Sujautra +// obedm503 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -29,8 +30,8 @@ declare namespace ReactIntl { withRef?: boolean; } - function injectIntl

          (component: React.ComponentType

          , options?: InjectIntlConfig): - React.ComponentClass>> & { WrappedComponent: React.ComponentType

          }; + function injectIntl

          (component: React.ComponentType

          , options?: InjectIntlConfig): + React.ComponentClass>> & { WrappedComponent: React.ComponentType

          }; function addLocaleData(data: Locale[] | Locale): void; @@ -46,6 +47,7 @@ declare namespace ReactIntl { messages: React.Requireable; defaultLocale: React.Requireable; defaultFormats: React.Requireable; + onError: React.Requireable; } interface IntlFormat { @@ -78,6 +80,7 @@ declare namespace ReactIntl { defaultLocale: string; defaultFormats: any; now(): number; + onError(error: string): void; } interface InjectedIntlProps { @@ -143,7 +146,7 @@ declare namespace ReactIntl { interface Props extends MessageDescriptor { values?: {[key: string]: MessageValue | JSX.Element}; - tagName?: string; + tagName?: React.ReactType; children?: (...formattedMessage: Array) => React.ReactNode; } } @@ -190,12 +193,14 @@ declare namespace ReactIntl { namespace IntlProvider { interface Props { locale?: string; + timeZone?: string; formats?: any; messages?: any; defaultLocale?: string; defaultFormats?: any; textComponent?: any; initialNow?: any; + onError?: (error: string) => void; } } diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index d3d30757a1..bd02a1701b 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -156,6 +156,13 @@ class SomeComponent extends React.Component +

          {children}
          } /> + + console.error(error)} + > diff --git a/types/react-is/index.d.ts b/types/react-is/index.d.ts index 35d4b4db12..962d3e1a13 100644 --- a/types/react-is/index.d.ts +++ b/types/react-is/index.d.ts @@ -1,13 +1,19 @@ -// Type definitions for react-is 16.5 +// Type definitions for react-is 16.7 // Project: https://reactjs.org/ // Definitions by: Avi Vahl // Christian Chown +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 export as namespace ReactIs; -import { ReactElement, ReactType } from 'react'; +import { + LazyExoticComponent, + MemoExoticComponent, + ReactElement, + ReactType +} from "react"; export function typeOf(value: any): symbol | undefined; export function isValidElementType(value: any): value is ReactType; @@ -17,16 +23,22 @@ export function isContextProvider(value: any): value is ReactElement; export function isElement(value: any): value is ReactElement; export function isForwardRef(value: any): value is ReactElement; export function isFragment(value: any): value is ReactElement; +export function isLazy(value: any): value is LazyExoticComponent; +export function isMemo(value: any): value is MemoExoticComponent; export function isProfiler(value: any): value is ReactElement; export function isPortal(value: any): value is ReactElement; export function isStrictMode(value: any): value is ReactElement; +export function isSuspense(value: any): value is ReactElement; export const AsyncMode: symbol; -export const ContextProvider: symbol; export const ContextConsumer: symbol; +export const ContextProvider: symbol; export const Element: symbol; export const ForwardRef: symbol; export const Fragment: symbol; +export const Lazy: symbol; +export const Memo: symbol; export const Portal: symbol; export const Profiler: symbol; export const StrictMode: symbol; +export const Suspense: symbol; diff --git a/types/react-is/react-is-tests.tsx b/types/react-is/react-is-tests.tsx index 18ae0c4a26..d41b2a828b 100644 --- a/types/react-is/react-is-tests.tsx +++ b/types/react-is/react-is-tests.tsx @@ -6,7 +6,7 @@ import * as ReactIs from 'react-is'; // Determining if a Component is Valid interface CompProps { - forwardedRef?: React.Ref; + forwardedRef: React.Ref; children?: React.ReactNode; } @@ -22,6 +22,12 @@ const ForwardRefComponent = React.forwardRef((props, ref) => React.createElement(ClassComponent, { forwardedRef: ref, ...props }) ); +const LazyComponent = React.lazy(() => + Promise.resolve({ default: ForwardRefComponent }) +); + +const MemoComponent = React.memo(StatelessComponent); + const Context = React.createContext(false); ReactIs.isValidElementType('div'); // true @@ -31,6 +37,8 @@ ReactIs.isValidElementType(ForwardRefComponent); // true ReactIs.isValidElementType(Context.Provider); // true ReactIs.isValidElementType(Context.Consumer); // true ReactIs.isValidElementType(React.createFactory('div')); // true +ReactIs.isValidElementType(LazyComponent); +ReactIs.isValidElementType(MemoComponent); // Determining an Element's Type @@ -74,5 +82,17 @@ ReactIs.typeOf(null) === undefined; ReactIs.typeOf(undefined) === undefined; // ForwardRef -const forwardRef = React.forwardRef((props, ref) =>
          ); -ReactIs.isForwardRef(forwardRef); // true +ReactIs.isForwardRef(); // true +ReactIs.typeOf() === ReactIs.ForwardRef; // true + +// Lazy +ReactIs.isLazy(LazyComponent); // true +ReactIs.typeOf(LazyComponent) === ReactIs.Lazy; // true + +// Memo +ReactIs.isMemo(MemoComponent); // true +ReactIs.typeOf(MemoComponent) === ReactIs.Memo; // true + +// Suspense +ReactIs.isForwardRef(); // true +ReactIs.typeOf() === ReactIs.Suspense; // true diff --git a/types/react-joyride/index.d.ts b/types/react-joyride/index.d.ts index d081aa87cf..13f691e56e 100644 --- a/types/react-joyride/index.d.ts +++ b/types/react-joyride/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-joyride 2.0 // Project: https://github.com/gilbarbara/react-joyride // Definitions by: DongYoon Kang +// Kamran Ayub // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -106,7 +107,7 @@ export interface Props extends OverridableProps { /** * It will be called when Joyride's state changes. It returns a single parameter with the state. */ - callback?(options: (data: State) => any): void; + callback?: (data: State) => any; /** * The tour is played sequentially with the Next button. Defaults to false. @@ -135,6 +136,11 @@ export interface OverridableProps { */ showProgress?: boolean; + /** + * Display a button to skip the tour. + */ + showSkipButton?: boolean; + /** * Disable closing the tooltip on ESC. Defaults to false. */ @@ -150,6 +156,11 @@ export interface OverridableProps { */ disableOverlayClose?: boolean; + /** + * Disable auto scrolling between steps. + */ + disableScrolling?: boolean; + /** * The strings used in the tooltip. Defaults to `{ back: 'Back', close: 'Close', last: 'Last', next: 'Next', skip: 'Skip' }` */ diff --git a/types/react-joyride/react-joyride-tests.tsx b/types/react-joyride/react-joyride-tests.tsx index 82171e98e2..d69d151174 100644 --- a/types/react-joyride/react-joyride-tests.tsx +++ b/types/react-joyride/react-joyride-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import Joyride, { Step } from "react-joyride"; +import Joyride, { Step, State } from "react-joyride"; class NewComponent extends React.Component { j: Joyride; @@ -42,7 +42,7 @@ class NewComponent extends React.Component { }]; render() { - return ; + return ; } doStuff() { @@ -56,4 +56,8 @@ class NewComponent extends React.Component { const { title, placement } = this.j.getProgress().step; } + + onCallback(data: State) { + return; + } } diff --git a/types/react-json-tree/index.d.ts b/types/react-json-tree/index.d.ts index f32cc61521..c57cdd3d51 100644 --- a/types/react-json-tree/index.d.ts +++ b/types/react-json-tree/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-json-tree v0.6.5 +// Type definitions for react-json-tree 0.6 // Project: https://github.com/alexkuz/react-json-tree/ // Definitions by: Grant Nestor +// Zain Afzal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -18,8 +19,8 @@ export interface JSONTreeProps extends Props { sortObjectKeys?: Function | boolean; shouldExpandNode?: (keyPath: (string | number)[], data: [any] | {}, level: number) => boolean; getItemString?: (type: string, data: [any] | {}, itemType: string, itemString: string) => JSX.Element; - labelRenderer?: (raw: [string, string]) => JSX.Element; - valueRenderer?: (raw: string) => JSX.Element; + labelRenderer?: (keyPath: string[], nodeType?: string, expanded?: boolean, expandable?: boolean) => JSX.Element; + valueRenderer?: (displayValue: string|number, rawValue?: string|number|boolean|null, ...keyPath: (string|number)[]) => JSX.Element; postprocessValue?: (raw: string) => JSX.Element; isCustomNode?: () => boolean; collectionLimit?: number; diff --git a/types/react-json-tree/tslint.json b/types/react-json-tree/tslint.json index e3610fefae..92d14c6344 100644 --- a/types/react-json-tree/tslint.json +++ b/types/react-json-tree/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/react-jsonschema-form/index.d.ts b/types/react-jsonschema-form/index.d.ts index 63a4de1b89..b860fa3cd4 100644 --- a/types/react-jsonschema-form/index.d.ts +++ b/types/react-jsonschema-form/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for react-jsonschema-form 1.0.0 +// Type definitions for react-jsonschema-form 1.0.1 // Project: https://github.com/mozilla-services/react-jsonschema-form // Definitions by: Dan Fox // Ivan Jiang -// Kurt Preston // Philippe Bourdages // Lucian Buzzo // Sylvain Thénault +// Sebastian Busch // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -15,6 +15,7 @@ declare module "react-jsonschema-form" { export interface FormProps { schema: JSONSchema6; + disabled?: boolean; uiSchema?: UiSchema; formData?: T; formContext?: any; @@ -68,7 +69,12 @@ declare module "react-jsonschema-form" { [key: string]: FieldId; }; - export interface WidgetProps extends React.HTMLAttributes { + export interface WidgetProps extends Pick< + React.HTMLAttributes, + Exclude< + keyof React.HTMLAttributes, + "onBlur"|"onFocus"> + > { id: string; schema: JSONSchema6; value: any; @@ -79,6 +85,8 @@ declare module "react-jsonschema-form" { onChange: (value: any) => void; options: object; formContext: any; + onBlur: (id: string, value: string) => void; + onFocus: (id: string, value: string) => void; } export type Widget = diff --git a/types/react-jsonschema-form/react-jsonschema-form-tests.tsx b/types/react-jsonschema-form/react-jsonschema-form-tests.tsx index 0bb6715372..90116127fd 100644 --- a/types/react-jsonschema-form/react-jsonschema-form-tests.tsx +++ b/types/react-jsonschema-form/react-jsonschema-form-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import Form, { UiSchema, ErrorListProps } from "react-jsonschema-form"; +import Form, { UiSchema, ErrorListProps, WidgetProps } from "react-jsonschema-form"; import { JSONSchema6 } from "json-schema"; // example taken from the react-jsonschema-form playground: @@ -108,3 +108,9 @@ export class Example extends React.Component { ); } } + +export const CustomWidget: React.SFC = (props) => + props.onFocus('id', 'value')} + onBlur={()=> props.onFocus('id', 'value')} + /> diff --git a/types/react-jss/index.d.ts b/types/react-jss/index.d.ts index 7656897a08..c2ee0a008a 100644 --- a/types/react-jss/index.d.ts +++ b/types/react-jss/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-jss 8.6 // Project: https://github.com/cssinjs/react-jss#readme // Definitions by: Sebastian Silbermann +// James Lawrence // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import { createGenerateClassName, JSS, SheetsRegistry } from "jss"; diff --git a/types/react-jss/lib/injectSheet.d.ts b/types/react-jss/lib/injectSheet.d.ts index fd66af5c38..ef6bdb3dbb 100644 --- a/types/react-jss/lib/injectSheet.d.ts +++ b/types/react-jss/lib/injectSheet.d.ts @@ -53,26 +53,33 @@ export type PropsOf = C extends new (props: infer P) => React.Component */ export type PropInjector = < C extends React.ComponentType, InjectedProps>> ->( + >( component: C ) => React.ComponentType< Omit>, keyof InjectedProps> & - AdditionalProps ->; + AdditionalProps + >; -export interface CSSProperties extends CSS.Properties { +// Allow functions that take the properties of the component and return a CSS value +export type DynamicCSSRule = { + [K in keyof CSS.Properties]: + | CSS.Properties[K] + | ((props: Props) => CSS.Properties[K]) +}[keyof CSS.Properties]; + +export interface CSSProperties { // Allow pseudo selectors and media queries [k: string]: - | CSS.Properties[keyof CSS.Properties] - | CSSProperties; + | DynamicCSSRule + | CSSProperties; } -export type Styles = Record< +export type Styles = Record< ClassKey, - CSSProperties ->; -export type StyleCreator = ( + CSSProperties + >; +export type StyleCreator = ( theme: T -) => Styles; +) => Styles; export interface Theming { channel: string; @@ -89,15 +96,16 @@ export interface InjectOptions extends CreateStyleSheetOptions { export type ClassNameMap = Record; export type WithSheet< S extends string | Styles | StyleCreator, - GivenTheme = undefined -> = { + GivenTheme = undefined, + Props = {} + > = { classes: ClassNameMap< S extends string ? S - : S extends StyleCreator - ? C - : S extends Styles ? C : never - >; + : S extends StyleCreator + ? C + : S extends Styles ? C : never + >; } & WithTheme ? T : GivenTheme>; export interface WithTheme { @@ -110,7 +118,7 @@ export interface StyledComponentProps { innerRef?: React.Ref | React.RefObject; } -export default function injectSheet( - stylesOrCreator: Styles | StyleCreator, +export default function injectSheet( + stylesOrCreator: Styles | StyleCreator, options?: InjectOptions -): PropInjector, StyledComponentProps>; +): PropInjector, StyledComponentProps>; diff --git a/types/react-jss/react-jss-tests.tsx b/types/react-jss/react-jss-tests.tsx index 803170bb99..0ba2ee3d8b 100644 --- a/types/react-jss/react-jss-tests.tsx +++ b/types/react-jss/react-jss-tests.tsx @@ -17,42 +17,44 @@ interface MyTheme { /** * helper function to counter typescripts type widening */ -function createStyles(styles: Styles): Styles { - return styles; +// tslint:disable-next-line:no-unnecessary-generics +function createStyles(styles: Styles): Styles { + return styles as Styles; } -const styles = (theme: MyTheme) => - createStyles({ - myButton: { - color: theme.color.primary, - margin: 1, - "& span": { - fontWeight: "revert" - } - }, - myLabel: { - fontStyle: "italic" - } - }); - -interface ButtonProps extends WithSheet { +interface ButtonProps { label: string; + active?: boolean; } -const Button: React.SFC = ({ classes, children }) => { +const styles = (theme: MyTheme) => createStyles({ + myButton: { + color: (props: ButtonProps) => props.active ? 'red' : theme.color.primary, + margin: 1, + "& span": { + fontWeight: "revert" + } + }, + myLabel: { + fontStyle: "italic" + } +}); +const Button: React.SFC> = ({active, classes, children}) => { return ( - + <> + + ); }; const ManuallyStyles = () => { return ( + + ); +}; + +export const TestMultipleTrigger: React.SFC = (props) => { + return ( + + ( +
          + {highlightedDisplay} +
          + )} + onAdd={props.onAdd} + /> + + [{ id: search, display: search }]} + onAdd={props.onAdd} + /> +
          + ); +}; + +mapPlainTextIndex("foo", "bar", 1, "NULL", login => `@${login}`, /.*/); // $ExpectType number diff --git a/types/react-mentions/tsconfig.json b/types/react-mentions/tsconfig.json new file mode 100644 index 0000000000..973ede82b7 --- /dev/null +++ b/types/react-mentions/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", + "lib/utils.d.ts", + "react-mentions-tests.tsx" + ] +} diff --git a/types/react-mentions/tslint.json b/types/react-mentions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-mentions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-modal/index.d.ts b/types/react-modal/index.d.ts index 237c725332..0117a69656 100644 --- a/types/react-modal/index.d.ts +++ b/types/react-modal/index.d.ts @@ -1,11 +1,12 @@ -// Type definitions for react-modal 3.2 +// Type definitions for react-modal 3.8 // Project: https://github.com/reactjs/react-modal // Definitions by: Rajab Shakirov , // Drew Noakes , // Thomas B Homburg , // Tatu Tamminen , // Uwe Wiemer , -// Peter Blazejewicz +// Peter Blazejewicz , +// Justin Powell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -48,6 +49,9 @@ declare namespace ReactModal { /* String className to be applied to the document.body. */ bodyOpenClassName?: string; + /* String className to be applied to the document.html. */ + htmlOpenClassName?: string; + /* String or object className to be applied to the modal content. */ className?: string | Classes; @@ -60,6 +64,9 @@ declare namespace ReactModal { /* Function that will be run after the modal has opened. */ onAfterOpen?(): void; + /* Function that will be run after the modal has closed. */ + onAfterClose?(): void; + /* Function that will be run when the modal is requested to be closed, prior to actually closing. */ onRequestClose?(event: (MouseEvent | KeyboardEvent)): void; @@ -87,6 +94,9 @@ declare namespace ReactModal { /* Additional aria attributes. */ aria?: Aria; + /* Additional data attributes to be applied to to the modal content in the form of "data-*" */ + data?: any; + /* String indicating the role of the modal, allowing the 'dialog' role to be applied if desired. */ role?: string; diff --git a/types/react-modal/react-modal-tests.tsx b/types/react-modal/react-modal-tests.tsx index 463ac1c7be..96c18ea881 100644 --- a/types/react-modal/react-modal-tests.tsx +++ b/types/react-modal/react-modal-tests.tsx @@ -12,6 +12,7 @@ class ExampleOfUsingReactModal extends React.Component { overlayRef: HTMLDivElement; render() { const onAfterOpenFn = () => { }; + const onAfterCloseFn = () => { }; const onRequestCloseFn = () => { }; const customStyle = { overlay: { @@ -51,10 +52,15 @@ class ExampleOfUsingReactModal extends React.Component { labelledby: 'labelledby', describedby: 'describedby' }; + const customDataVariables = { + dataOne: 'one', + dataTwo: 'two' + }; return ( this.contentRef = instance} overlayRef={instance => this.overlayRef = instance} > diff --git a/types/react-native-auth0/index.d.ts b/types/react-native-auth0/index.d.ts index d6bd3e7cf1..e738cf69b3 100644 --- a/types/react-native-auth0/index.d.ts +++ b/types/react-native-auth0/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-native-auth0 1.2 +// Type definitions for react-native-auth0 1.3 // Project: https://github.com/auth0/react-native-auth0 // Definitions by: Andrea Ascari +// Mark Nelissen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -70,7 +71,12 @@ export interface UserInfoParams { token: string; } -export interface UserInfo { +export interface ResetPasswordParams { + email: string; + connection: string; +} + +export type UserInfo = { email: string; emailVerified: boolean; name: string; @@ -78,7 +84,8 @@ export interface UserInfo { picture: string; sub: string; updatedAt: string; -} +} & CustomClaims; + export class Auth { authorizationUrl(params: AuthorizationUrlParams): string; /* tslint:disable-next-line no-unnecessary-generics */ @@ -86,10 +93,11 @@ export class Auth { exchange(params: ExchangeParams): Promise; logoutUrl(params: LogoutParams): string; passwordRealm(params: PasswordRealmParams): Promise; - refreshToken(params: RefreshTokenParams): Promise; + resetPassword(params: ResetPasswordParams): Promise; revoke(params: RevokeParams): Promise; - userInfo(params: UserInfoParams): Promise; + /* tslint:disable-next-line no-unnecessary-generics */ + userInfo(params: UserInfoParams): Promise>; } /** diff --git a/types/react-native-auth0/react-native-auth0-tests.ts b/types/react-native-auth0/react-native-auth0-tests.ts index 068833e349..8a10d5d2b6 100644 --- a/types/react-native-auth0/react-native-auth0-tests.ts +++ b/types/react-native-auth0/react-native-auth0-tests.ts @@ -49,6 +49,11 @@ auth0.auth.refreshToken({ scope: "openid" }); +auth0.auth.resetPassword({ + email: "me@example.com", + connection: "db-connection" +}); + auth0.auth.revoke({ refreshToken: "refresh-token" }); diff --git a/types/react-native-bluetooth-serial/tsconfig.json b/types/react-native-bluetooth-serial/tsconfig.json index 213f3fd025..80b4865dd3 100644 --- a/types/react-native-bluetooth-serial/tsconfig.json +++ b/types/react-native-bluetooth-serial/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/react-native-calendars/index.d.ts b/types/react-native-calendars/index.d.ts index 647e64c0f2..402a3fff1a 100644 --- a/types/react-native-calendars/index.d.ts +++ b/types/react-native-calendars/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/wix/react-native-calendars#readme // Definitions by: Tyler Zhang // David Noreña +// Fabian Meul // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -23,6 +24,10 @@ export interface CalendarDot { selectedDotColor?: string; } +export interface CalendarThemeIdStyle { + [themeId: string]: ViewStyle | TextStyle; +} + export interface CalendarTheme { arrowColor?: string; backgroundColor?: string; @@ -43,6 +48,17 @@ export interface CalendarTheme { textMonthFontSize?: number; textSectionTitleColor?: string; todayTextColor?: string; + + // Theme ID's to style for + "stylesheet.calendar.header"?: CalendarThemeIdStyle; + "stylesheet.calendar.main"?: CalendarThemeIdStyle; + "stylesheet.calendar-list.main"?: CalendarThemeIdStyle; + "stylesheet.agenda.main"?: CalendarThemeIdStyle; + "stylesheet.agenda.list"?: CalendarThemeIdStyle; + "stylesheet.day.basic"?: CalendarThemeIdStyle; + "stylesheet.day.single"?: CalendarThemeIdStyle; + "stylesheet.day.multiDot"?: CalendarThemeIdStyle; + "stylesheet.day.period"?: CalendarThemeIdStyle; } export type DateCallbackHandler = (date: DateObject) => void; @@ -319,6 +335,11 @@ export interface CalendarListBaseProps extends CalendarBaseProps { * Enable or disable vertical scroll indicator. Default = false */ showScrollIndicator?: boolean; + + /** + * Initially selected day + */ + selected?: string; } export class CalendarList extends React.Component { } diff --git a/types/react-native-datepicker/index.d.ts b/types/react-native-datepicker/index.d.ts index dd69061311..63d20c9a6b 100644 --- a/types/react-native-datepicker/index.d.ts +++ b/types/react-native-datepicker/index.d.ts @@ -1,13 +1,29 @@ -// Type definitions for react-native-datepicker 1.6 +// Type definitions for react-native-datepicker 1.7 // Project: https://github.com/xgfe/react-native-datepicker // Definitions by: Jacob Baskin +// Cheng Gibson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from 'react'; -import { ImageURISource } from 'react-native'; +import { StyleProp, TextStyle, ImageStyle, ViewStyle, ImageURISource } from 'react-native'; import * as moment from 'moment'; +export interface DatePickerCustomStylesProps { + placeholderText?: StyleProp; + dateText?: StyleProp; + dateIcon?: StyleProp; + dateInput?: StyleProp; + dateTouchBody?: StyleProp; + datePickerCon?: StyleProp; + datePicker?: StyleProp; + btnCancel?: StyleProp; + btnTextCancel?: StyleProp; + btnConfirm?: StyleProp; + btnTextConfirm?: StyleProp; + disabled?: StyleProp; +} + export interface DatePickerProps { mode?: 'date' | 'datetime' | 'time'; androidMode?: 'default' | 'calendar' | 'spinner'; @@ -32,11 +48,16 @@ export interface DatePickerProps { modalOnResponderTerminationRequest?(e: any): boolean; is24Hour?: boolean; getDateStr?: (date: Date) => string; - style?: any; - customStyles?: any; + style?: StyleProp; + customStyles?: DatePickerCustomStylesProps; minuteInterval?: number; TouchableComponent?: React.Component; + allowFontScaling?: boolean; locale?: string; + timeZoneOffsetInMinutes?: number; + testID?: string; + cancelBtnTestID?: string; + confirmBtnTestID?: string; } declare class DatePicker extends React.Component { diff --git a/types/react-native-datepicker/tsconfig.json b/types/react-native-datepicker/tsconfig.json index b1dd56e20d..875993fd09 100644 --- a/types/react-native-datepicker/tsconfig.json +++ b/types/react-native-datepicker/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/react-native-dialog/index.d.ts b/types/react-native-dialog/index.d.ts index 10e977f420..14d7458140 100644 --- a/types/react-native-dialog/index.d.ts +++ b/types/react-native-dialog/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for react-native-dialog 4.0 // Project: https://github.com/mmazzarolo/react-native-dialog // Definitions by: MrLuje +// Stack Builders +// Esteban Ibarra // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -32,7 +34,7 @@ interface ButtonProps { interface ContainerProps { blurComponentIOS?: ReactNode; - children: JSX.Element[]; + children: React.ReactNode[]; /** * default: false */ diff --git a/types/react-native-dialog/react-native-dialog-tests.tsx b/types/react-native-dialog/react-native-dialog-tests.tsx index 151ee14af5..544025051c 100644 --- a/types/react-native-dialog/react-native-dialog-tests.tsx +++ b/types/react-native-dialog/react-native-dialog-tests.tsx @@ -2,6 +2,24 @@ import Dialog from "react-native-dialog"; import { createRef, Component } from "react"; class Example extends Component { + dynamicButtons() { + const buttonFunc = () => console.log('click'); + const buttons = [ + { label: 'Button 1', action: buttonFunc }, + { label: 'Button 2', action: buttonFunc }, + ]; + return buttons.map(({ label , action }) => + + ); + } + + singleButton() { + return ( null} />); + } + render() { const ref = createRef(); @@ -23,6 +41,8 @@ class Example extends Component { label="Validate" onPress={() => console.log("test")} /> + {this.dynamicButtons()} + {this.singleButton()} ); } diff --git a/types/react-native-doc-viewer/react-native-doc-viewer-tests.tsx b/types/react-native-doc-viewer/react-native-doc-viewer-tests.tsx index cdc7e3980e..466900ec6e 100644 --- a/types/react-native-doc-viewer/react-native-doc-viewer-tests.tsx +++ b/types/react-native-doc-viewer/react-native-doc-viewer-tests.tsx @@ -102,17 +102,17 @@ export default class DocViewerExample extends React.Component { Doc Viewer React Native