diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6477b03f07..9d89a82028 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -49,29 +49,38 @@ /types/adal-angular/ @unindented @aciccarello /types/add-zero/ @Roaders /types/adlib/ @Esri @MikeTschudi -/types/adm-zip/ @jvilk @abner +/types/adm-zip/ @jvilk @abner @BendingBender /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/airtable/ @bvalosek /types/ajv-errors/ @afshawnlotfi +/types/ajv-merge-patch/ @littlepiggy03 /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 @keichinger +/types/algoliasearch/ @cbaptiste @haroenv @aherve @samouss @keichinger @neryortez @antoinerousseau +/types/algoliasearch-helper/ @gburgett @haroenv @samouss /types/ali-app/ @taoqf /types/ali-oss/ @ptrdu +/types/align-text/ @claasahl /types/all-keys/ @BendingBender /types/all-property-names/ @BendingBender /types/allure-js-commons/ @zaqqaz /types/almost-equal/ @cmaddalozzo /types/alt/ @Shearerbeard +/types/amap-js-api/ @breeze9527 +/types/amap-js-api-autocomplete/ @breeze9527 +/types/amap-js-api-geocoder/ @breeze9527 +/types/amap-js-api-indoor-map/ @breeze9527 +/types/amap-js-api-map3d/ @breeze9527 +/types/amap-js-api-place-search/ @breeze9527 /types/amap-js-sdk/ @agasbzj /types/amazon-cognito-auth-js/ @scottescue /types/amazon-product-api/ @MattiLehtinen @alien35 @@ -160,7 +169,7 @@ /types/angularlocalstorage/ @horiuchi /types/angulartics/ @bateast2 /types/animation-frame/ @qinfchen -/types/animejs/ @A-Babin +/types/animejs/ @A-Babin @supaiku0 /types/annyang/ @hisham @theluk /types/ansi/ @Gustavo6046 /types/ansi-colors/ @rogierschouten @BendingBender @@ -204,7 +213,7 @@ /types/archy/ @vvakame /types/are-we-there-yet/ @brianloveswords /types/argon2-browser/ @ivangabriele -/types/argparse/ @arcticwaters @tlaziuk @eps1lon +/types/argparse/ @arcticwaters @tlaziuk @eps1lon @cakoose /types/args/ @Slessi /types/argv/ @hookclaw /types/arr-diff/ @BendingBender @@ -237,7 +246,7 @@ /types/async-cache/ @BendingBender /types/async-lock/ @elisee @afharo @rhymmor /types/async-polling/ @Goldsmith42 -/types/async-retry/ @albertywu @MeLlamoPablo +/types/async-retry/ @albertywu @MeLlamoPablo @rafsawicki /types/async.nexttick/ @pyrho /types/asynciterator/ @rubensworks /types/athenajs/ @warpdesign @@ -258,14 +267,14 @@ /types/auth-header/ @ForbesLindesay /types/auth0/ @westy92 @ianhowe76 @dauledk /types/auth0-angular/ @homesar -/types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz +/types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz @bkotrys /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 @a904guy @valepu @glenroy37 +/types/autobahn/ @darkl @a904guy @valepu @glenroy37 @spcfran /types/autolinker/ @leonyu /types/autoprefixer/ @odnamrataizem @murt /types/autosize/ @kingdango @keika299 @NeekSandhu @@ -273,10 +282,11 @@ /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 @trevor-leach @jagregory @dalen +/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 @loikg @skyzenr @richardcornelissen @redlickigrzegorz +/types/aws-param-store/ @jasonthomasgray /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites -/types/axe-webdriverjs/ @JoshuaKGoldberg +/types/axe-webdriverjs/ @JoshuaKGoldberg @tylerkrupicka /types/axel/ @ruslan-molodyko /types/axios-case-converter/ @dkniffin /types/axios-token-interceptor/ @innovation-team @@ -295,7 +305,7 @@ /types/babel-types/ @yortus @baxtersa @marvinhagemeister @bcherny /types/babel-webpack-plugin/ @j-f1 /types/babel__code-frame/ @mohsen1 @ForbesLindesay -/types/babel__core/ @yortus @marvinhagemeister @mgroenhoff +/types/babel__core/ @yortus @marvinhagemeister @mgroenhoff @Jessidhia /types/babel__generator/ @yortus @johnnyestilles @mgroenhoff /types/babel__template/ @yortus @marvinhagemeister @mgroenhoff /types/babel__traverse/ @yortus @marvinhagemeister @rpetrich @mgroenhoff @@ -303,15 +313,15 @@ /types/babylon/ @yortus @marvinhagemeister /types/babylon-walk/ @czbuchi /types/babyparse/ @cdiddy77 -/types/backbone/ @borisyankov @nvivo @kenjiru @jjoekoullas +/types/backbone/ @borisyankov @nvivo @kenjiru @jjoekoullas @jgonggrijp /types/backbone-associations/ @craigbrett17 /types/backbone-fetch-cache/ @delphinus35 -/types/backbone-relational/ @eirikhm +/types/backbone-relational/ @eirikhm @jgonggrijp /types/backbone.layoutmanager/ @hejiang2000 /types/backbone.localstorage/ @lgrignon -/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs @jjoekoullas +/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs @jjoekoullas @jgonggrijp /types/backbone.paginator/ @Nyamazing -/types/backbone.radio/ @alphaleonis +/types/backbone.radio/ @alphaleonis @jgonggrijp /types/backgrid/ @jlujan /types/backlog-js/ @vvatanabe /types/backo2/ @Retsam @@ -353,7 +363,7 @@ /types/better-curry/ @pocesar /types/better-queue/ @maozedong /types/better-scroll/ @stoneChen @cnjack -/types/better-sqlite3/ @Morfent @matrumz @sant123 @loghorn @andykais +/types/better-sqlite3/ @Morfent @matrumz @sant123 @loghorn @andykais @mrkstwrt /types/bezier-easing/ @ptlis /types/bezier-js/ @danmarshall @Epskampie /types/bgiframe/ @sumegizoltan @@ -371,10 +381,11 @@ /types/bindings/ @unindented /types/bintrees/ @CjS77 /types/bip21/ @stefanhuber -/types/bip32/ @me +/types/bip32/ @eduhenke /types/bip38/ @micksatana /types/bip39/ @micksatana /types/bit-array/ @mudkipme +/types/bit-twiddle/ @adamzerella /types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton @micksatana @youssefgh @kento1218 /types/bitcore-lib/ @lautarodragan /types/bittorrent-protocol/ @feross @tlaziuk @@ -382,7 +393,7 @@ /types/bl/ @Bartvds @reconbot /types/blacklist/ @mhegazy /types/blazy/ @julienpa -/types/blessed/ @brynbellomy @skellock +/types/blessed/ @brynbellomy @skellock @mamachanko /types/blissfuljs/ @fskorzec /types/blob-stream/ @erichillah /types/blob-to-buffer/ @nrlquaker @@ -414,6 +425,7 @@ /types/bootstrap/ @denisname /types/bootstrap/v3/ @borisyankov @denisname /types/bootstrap-3-typeahead/ @AndersonFriaca +/types/bootstrap-colorpicker/ @aleksandar-manukov /types/bootstrap-datepicker/ @borisyankov /types/bootstrap-fileinput/ @CheCoxshall /types/bootstrap-growl-ifightcrime/ @AndersonFriaca @@ -434,11 +446,10 @@ /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 -/types/braft-editor/ @me +/types/braft-editor/ @petitspois /types/braintree-web/ @chlela /types/breeze/ @borisyankov /types/bricks.js/ @kondi @@ -453,11 +464,12 @@ /types/browser-resolve/ @marionebl /types/browser-sync/ @joeskeen @aznnomness /types/browserify/ @AndrewGaspar @jvilk @leonard-thieu @LinusU -/types/browserslist/ @davecardwell +/types/browserslist/ @davecardwell @AndrewLeedham /types/browserslist-useragent/ @nju33 /types/bs58/ @chrootsu @BendingBender /types/bs58/v3/ @chrootsu -/types/bson/ @horiuchi @CaselIT +/types/bser/ @claasahl +/types/bson/ @horiuchi @CaselIT @justingrant /types/btoa/ @johngeorgewright @bricka /types/buble/ @Kocal /types/bucks/ @zaneli @@ -469,8 +481,9 @@ /types/buffer-xor/ @danwbyrne /types/buffers/ @rhencke /types/bufferstream/ @Bartvds +/types/build-output-script/ @BendingBender /types/builtin-modules/ @ajafff -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana @kjellmorten @pc-jedi +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana @kjellmorten @pc-jedi @lenovouser /types/bull/v2/ @bgrieder @JProgrammer /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher @@ -480,17 +493,20 @@ /types/bunyan-config/ @cyrilschumacher /types/bunyan-format/ @dex4er /types/bunyan-prettystream/ @jasonswearingen @enlight +/types/bunyan-seq/ @raybooysen /types/bunyan-winston-adapter/ @stevehipwell +/types/burns/ @timolinn /types/busboy/ @jacobbaskin /types/business-rules-engine/ @rsamec /types/bwip-js/ @MugeSo /types/byline/ @reppners +/types/byte-range/ @BendingBender /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/cacheable-request/ @BendingBender @paulmelnikow /types/cached-path-relative/ @TeamworkGuy2 /types/cadesplugin/ @Delagen @kmvi /types/cal-heatmap/ @RetroChrisB @@ -499,8 +515,8 @@ /types/callsites/ @BendingBender /types/calq/ @eirikhm /types/camaro/ @tuananh -/types/camelcase/ @samverschueren /types/camelcase-keys/ @mhegazy +/types/camljs/ @andrei-markeev /types/camo/ @lucasmciruzzi /types/cancan/ @Vincent-Pang /types/caniuse-api/ @davecardwell @@ -511,18 +527,28 @@ /types/canvasjs/ @brutalimp /types/capitalize/ @frederickfogerty /types/capture-console/ @AustonZ +/types/carbon__colors/ @vpicone +/types/carbon__layout/ @vpicone +/types/carbon__motion/ @vpicone +/types/carbon__themes/ @vpicone +/types/carbon__type/ @vpicone /types/card-validator/ @ChanceM +/types/carlo/ @adierkens /types/case-sensitive-paths-webpack-plugin/ @r3nya -/types/caseless/ @downace @mastermatt +/types/caseless/ @downace @mastermatt @forivall /types/cash/ @akvlko /types/casperjs/ @jedmao @urielch -/types/cassandra-driver/ @Svjard @pc-jedi +/types/cassandra-driver/ @Svjard @pc-jedi @michal-b-kaminski +/types/cassanknex/ @bioball /types/catbox/ @jasonswearingen @AJamesPhillips @saboya /types/catbox/v7/ @jasonswearingen @AJamesPhillips /types/catbox-memory/ @SimonSchick /types/catbox-redis/ @SimonSchick +/types/cavy/ @tyler-hoffman /types/cbor/ @pushplay /types/ccap/ @taoqf +/types/center-align/ @claasahl +/types/centra/ @twooster /types/cesium/ @Zuzon @hnipps @szechyjs @golyalpha /types/cfn-response/ @ivoisbelongtous /types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom @@ -535,10 +561,10 @@ /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 /types/chai-jquery/ @kazimanzurrashid /types/chai-json-schema/ @ulrichheiniger +/types/chai-moment/ @chrisgodsey /types/chai-oequal/ @mizunashi-mana /types/chai-roughly/ @swist /types/chai-spies/ @kuzn-ilya @harm-less @jounisuo @@ -550,6 +576,7 @@ /types/chalk-animation/ @BendingBender /types/chance/ @cbowdon @brikou @cafesanu /types/change-emitter/ @iskandersierra +/types/changelog-parser/ @adamzerella /types/chardet/ @Gebatzens /types/charm/ @Xananax /types/charset/ @cspotcode @@ -561,11 +588,11 @@ /types/check-types/ @idchlife /types/checkstyle-formatter/ @mhegazy /types/checksum/ @rogierschouten -/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 @AzSiAz +/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 @AzSiAz @nwtgck /types/chess.js/ @JacobFischer /types/chessboardjs/ @sliverb @davidmpaz +/types/child-process-promise/ @TheDSCPL /types/chmodr/ @BendingBender -/types/chokidar/ @reppners @felixfbecker @bayssmekanique /types/chordsheetjs/ @adamsbloom /types/chosen-js/ @borisyankov @denisname /types/chownr/ @BendingBender @@ -576,7 +603,9 @@ /types/chromecast-caf-receiver/ @craigrbruce /types/chromecast-caf-sender/ @samuelmaddock /types/chromedriver/ @pe8ter +/types/cipher-base/ @adamzerella /types/circuit-breaker-js/ @DeTeam +/types/circular-dependency-plugin/ @jeremejevs /types/circular-json/ @jpevarnek /types/ckeditor/ @wittwert @stuartlong @viktorpegy /types/ckeditor/v2/ @wittwert @@ -591,7 +620,6 @@ /types/clean-css/v3/ @tkrotoff /types/clean-regexp/ @BendingBender /types/clean-stack/ @BendingBender -/types/clean-webpack-plugin/ @j-f1 /types/clear-require/ @dan-j /types/clearbladejs-client/ @ClearBlade /types/clearbladejs-node/ @ClearBlade @@ -618,6 +646,7 @@ /types/clmtrackr/ @hellochar /types/clndr/ @jasperjn /types/clockpicker/ @jfcere +/types/clone-deep/ @tanfonto /types/cloneable-readable/ @qlonik /types/cloner/ @matrumz /types/closure-compiler/ @mprobst @@ -625,8 +654,10 @@ /types/cloudflare-apps/ @MartynasZilinskas /types/clovelced-plugin-audiomanagement/ @marckassay /types/cls-hooked/ @aleung +/types/clui/ @farzadmf /types/clusterize.js/ @Pr1st0n /types/cmd-shim/ @cspotcode +/types/co/ @doniyor2109 /types/co-body/ @geoffreak /types/co-views/ @devlee @geoffreak /types/code/ @prashaantt @@ -637,6 +668,7 @@ /types/coinlist/ @BendingBender /types/coinstring/ @mhegazy /types/collections/ @scarabedore +/types/collectionsjs/ @jaymeh /types/color/ @Airlun @jameswlane /types/color/v2/ @Airlun /types/color/v1/ @LKay @@ -646,6 +678,7 @@ /types/color-name/ @Ailrun /types/color-namer/ @in19farkt /types/color-string/ @BendingBender @danmarshall +/types/color-support/ @Yavanosta /types/colorbrewer/ @mtraynham /types/colornames/ @manuth /types/colresizable/ @gilleswaeber @@ -654,7 +687,7 @@ /types/combine-source-map/ @TeamworkGuy2 /types/combined-stream/ @felixge @tlaziuk @konpikwastaken /types/combokeys/ @iclanton -/types/cometd/ @derekcicerone @unindented @alxHenry +/types/cometd/ @derekcicerone @unindented @alxHenry @hagl /types/command-exists/ @BendingBender /types/command-line-args/ @75lb /types/command-line-args/v4/ @CzBuCHi @75lb @@ -672,6 +705,7 @@ /types/compare-version/ @jpevarnek /types/compare-versions/ @LogvinovLeon /types/complex/ @AyaMorisawa @pavasich +/types/complex.js/ @adamzerella /types/component-emitter/ @psnider /types/compose-function/ @denis-sokolov /types/compressible/ @BendingBender @@ -681,27 +715,26 @@ /types/compute-stdev/ @mrmlnc /types/concat-stream/ @jmarianer /types/concaveman/ @DenisCarriere -/types/conf/ @SamVerschueren @BendingBender -/types/conf/v1/ @SamVerschueren @BendingBender -/types/conf/v0/ @SamVerschueren +/types/condense-whitespace/ @djcsdy /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez -/types/config-yaml/ @me +/types/config-yaml/ @Arylo /types/configstore/ @ArcticLight /types/configurable/ @jewbre /types/confit/ @ethanresnick /types/connect/ @SomaticIT @EvanHahn /types/connect-busboy/ @pinguet62 -/types/connect-datadog/ @moshegood +/types/connect-datadog/ @moshegood @xzyfer /types/connect-ensure-login/ @0x6368656174 /types/connect-flash/ @AndreasGassmann /types/connect-history-api-fallback/ @douglasduteil +/types/connect-history-api-fallback-exclusions/ @tonystonee /types/connect-livereload/ @SomaticIT /types/connect-modrewrite/ @tinganho /types/connect-mongo/ @Syati /types/connect-mongodb-session/ @NattapongSiri /types/connect-pg-simple/ @pasieronen -/types/connect-redis/ @xstoudi +/types/connect-redis/ @xstoudi @sbutler2901 /types/connect-slashes/ @samherrmann /types/connect-timeout/ @cyrilschumacher /types/consola/ @Jungwoo-An @@ -730,7 +763,6 @@ /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 @@ -773,9 +805,7 @@ /types/country-select-js/ @humrochagf /types/countup.js/ @shermendev /types/coverup/ @bevalorous -/types/cp-file/ @BendingBender /types/cpx/ @alan-agius4 -/types/cpy/ @mhegazy @BendingBender /types/cqrs-domain/ @blissi /types/cradle/ @panuhorsmalahti /types/crc/ @YuJianrong @@ -785,6 +815,7 @@ /types/create-html-element/ @BendingBender /types/create-react-class/ @jgoz /types/create-subscription/ @Asana @vsiao +/types/create-xpub/ @BendingBender /types/createjs/ @evilangelist @gyohk /types/createjs-lib/ @evilangelist @gyohk /types/credential/ @phuvo @@ -811,9 +842,11 @@ /types/css/ @ilich /types/css-font-loading-module/ @slikts /types/css-modules/ @NeekSandhu +/types/css-modules-loader-core/ @skovy /types/css-to-style/ @bengry /types/css-tree/ @erik-kallen /types/cssbeautify/ @rictic +/types/cssesc/ @djcsdy /types/cssnano/ @odnamrataizem /types/csso/ @screendriver @erik-kallen /types/csurf/ @horiuchi @@ -840,12 +873,13 @@ /types/d3/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3/v3/ @gustavderdrache @borisyankov @MatthiasJobst -/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek @denisname +/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek @denisname @ledragon +/types/d3-array/v1/ @gustavderdrache @borisyankov @tomwanzek @denisname @ledragon /types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-box/ @lk-chen /types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov /types/d3-chord/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-cloud/ @hansrwindhoff +/types/d3-cloud/ @hansrwindhoff @locknono /types/d3-collection/ @tomwanzek @gustavderdrache @borisyankov /types/d3-color/ @tomwanzek @gustavderdrache @borisyankov @denisname @ledragon /types/d3-contour/ @tomwanzek @Ledragon @@ -855,7 +889,7 @@ /types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-ease/ @tomwanzek @gustavderdrache @borisyankov /types/d3-fetch/ @ledragon @denisname -/types/d3-force/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-force/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-format/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-geo/ @ledragon @tomwanzek @gustavderdrache @borisyankov /types/d3-graphviz/ @DomParfitt @@ -894,6 +928,7 @@ /types/dat.gui/ @gyohk @sonic3d @rroylance @singuerinc /types/data-driven/ @mrhen /types/datadog-metrics/ @pushplay +/types/datadog-statsd-metrics-collector/ @xzyfer /types/datadog-tracer/ @dineshsaravanan /types/datatables.net/ @Silver-Connection @omidkrad @pragmatrix @CNBoland /types/datatables.net-autofill/ @andy-maca @@ -904,7 +939,9 @@ /types/datatables.net-rowreorder/ @baywet /types/datatables.net-scroller/ @RohdeK /types/datatables.net-select/ @szechyjs +/types/date-and-time/ @danplisetsky /types/date-arithmetic/ @HeeL +/types/date-now/ @adamzerella /types/date.format.js/ @balrob /types/dateformat/ @aicest @BendingBender /types/dateformat/v1/ @aicest @@ -916,24 +953,22 @@ /types/db-migrate-pg/ @nickiannone /types/db.js/ @cgwrench /types/dc/ @hansrwindhoff @mtraynham @MatthiasJobst -/types/dd-trace/ @ColinBradley @alloy /types/deasync/ @Sicilica /types/debessmann/ @vkorehov /types/debounce/ @denis-sokolov @joshuakgoldberg @wcarson /types/debounce-fn/ @BendingBender /types/debounce-promise/ @whtsky -/types/debug/ @swook @galtalmor @zamb3zi @brasten -/types/decamelize/ @samverschueren +/types/debug/ @swook @galtalmor @zamb3zi @brasten @npenin @kristianmitk /types/decay/ @enaeseth /types/decode-entities/ @waspothegreat /types/decode-uri-component/ @BendingBender /types/decompress/ @plantain-00 @jbethke -/types/decompress-response/ @DanielRosenwasser /types/decorum/ @dflor003 /types/dedent/ @douglasduteil /types/deep-assign/ @souldreamer /types/deep-diff/ @ZauberNerd /types/deep-equal/ @remojansen @janslow +/types/deep-equal-in-any-order/ @bcaudan /types/deep-extend/ @rhysd /types/deep-freeze/ @Bartvds @aluanhaddad /types/deep-freeze-es6/ @mattbishop @@ -946,8 +981,6 @@ /types/defined/ @BendingBender /types/deglob/ @saadq /types/deku/ @pocka -/types/del/ @AyaMorisawa @BendingBender @bitjson -/types/del/v2/ @AyaMorisawa /types/delaunator/ @DenisCarriere @BTOdell /types/delete-empty/ @Alorel /types/deline/ @iarroyo5 @@ -963,7 +996,6 @@ /types/derhuerst__cli-on-key/ @jacobbubu /types/destroy/ @BendingBender /types/destroy-on-hwm/ @BendingBender -/types/detect-browser/ @rogierschouten @carusology /types/detect-character-encoding/ @BendingBender /types/detect-hover/ @thomastilkema /types/detect-indent/ @Bartvds @BendingBender @@ -993,11 +1025,12 @@ /types/diffie-hellman/ @BendingBender /types/digibyte/ @lautarodragan @werewolfe /types/dinero.js/ @BendingBender +/types/dingtalk-robot-sender/ @bangbang93 /types/dir-glob/ @BendingBender /types/dir-resolve/ @andy-ms /types/dirname-regex/ @BendingBender /types/discontinuous-range/ @OiCMudkips -/types/discord-rpc/ @jasonhaxstuff +/types/discord-rpc/ @jasonhaxstuff @lolPants /types/discourse-sso/ @championswimmer /types/dispatchr/ @Ragg- /types/disposable-email-domains/ @geoffreak @@ -1018,13 +1051,15 @@ /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/domelementtype/ @johandavidson +/types/domhandler/ @johandavidson /types/domo/ @Steve-Fenton /types/dompurify/ @bazuzi @FlowCrypt /types/domready/ @dotnetnerd +/types/domutils/ @johandavidson /types/donna/ @vvakame /types/dookie/ @swanest /types/dot/ @ZombieHunter @@ -1046,11 +1081,13 @@ /types/download/ @nicojs /types/downloadjs/ @cwmoo740 @josuedevmark /types/dplayer/ @Guanyunhan -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk @claudiopro +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk @claudiopro @khawkinson /types/drag-timetable/ @chinkan /types/draggabilly/ @jaydubu +/types/dragscroll/ @spkellydev /types/dragster/ @zskovacs /types/dragula/ @pwelter34 @abruzzihraig +/types/driftless/ @dandelany /types/drivelist/ @WholeMilk /types/dropbox-chooser/ @quas94 /types/dropboxjs/ @Steve-Fenton @xperiments @@ -1064,9 +1101,10 @@ /types/duplicate-package-checker-webpack-plugin/ @mtraynham /types/durandal/ @BlueSpire /types/dustjs-linkedin/ @mdezem +/types/dv/ @taoqf /types/dvtng-jss/ @Ptival /types/dw-bxslider-4/ @namerci -/types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft +/types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft @dsueltenfuss /types/dygraphs/ @danvk /types/dymo-label-framework/ @thijskuipers /types/dynatable/ @francoismassart @@ -1082,8 +1120,9 @@ /types/easy-table/ @nikeee /types/easy-xapi/ @DeadAlready /types/easy-xapi-utils/ @DeadAlready +/types/easydate/ @satyarohith /types/ebongarde-root/ @Ebongarde -/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia @iRON5 +/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia @iRON5 @bilalucar @tmtron @dwhitney /types/ecma-proposal-math-extensions/ @ksm2 /types/ecurve/ @mhegazy /types/ed25519/ @erikma @@ -1097,7 +1136,6 @@ /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 @@ -1117,12 +1155,13 @@ /types/electron-window-state/ @rhysd /types/electron-winstaller/ @shiftkey @unindented /types/elegant-spinner/ @danwbyrne -/types/element-ready/ @BendingBender /types/element-resize-detector/ @saranshkataria @franklixuefei /types/element-resize-event/ @rogierschouten @plgregoire /types/elementtree/ @dwieeb /types/elliptic/ @danwbyrne @Gilthoniel /types/elm/ @thSoft +/types/elo-rank/ @apavlinovic +/types/elv/ @garyaparker /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 /types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north @BryanCrotaz /types/ember/v2/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north @@ -1151,7 +1190,7 @@ /types/ember__object/ @mike-north /types/ember__polyfills/ @mike-north /types/ember__routing/ @mike-north -/types/ember__runloop/ @mike-north +/types/ember__runloop/ @mike-north @scalvert /types/ember__service/ @mike-north /types/ember__string/ @mike-north /types/ember__test/ @mike-north @@ -1179,10 +1218,9 @@ /types/entities/ @aliceklipper /types/env-ci/ @BendingBender /types/env-editor/ @BendingBender -/types/env-paths/ @danwbyrne /types/env-to-object/ @MugeSo /types/envify/ @tkQubo -/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden @hotell +/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden @hotell @screendriver /types/enzyme-adapter-react-15/ @tkrotoff /types/enzyme-adapter-react-15.4/ @nali /types/enzyme-adapter-react-16/ @tkrotoff @@ -1221,12 +1259,13 @@ /types/estree/ @RReverser /types/etag/ @BendingBender /types/eth-lightwallet/ @LogvinovLeon +/types/eth-sig-util/ @quezak /types/ethereum-protocol/ @LogvinovLeon -/types/ethereumjs-abi/ @LogvinovLeon +/types/ethereumjs-abi/ @LogvinovLeon @quezak /types/ethereumjs-tx/ @LogvinovLeon @dmihal /types/ethereumjs-util/ @cortopy /types/ethjs-signer/ @doppio -/types/eureka-js-client/ @Schnillz @karl-run @tombarton +/types/eureka-js-client/ @Schnillz @karl-run @tombarton @jpsullivan /types/evaporate/ @kookster @chrisrhoden @ailrun /types/event-emitter/ @LKay /types/event-emitter-es6/ @ahstro @@ -1253,16 +1292,19 @@ /types/expect-puppeteer/ @JoshuaKGoldberg @tkrotoff /types/expect.js/ @teppeis /types/expectations/ @vvakame +/types/expired/ @BendingBender /types/expired-storage/ @intolerance /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/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @levansuper @ihmpavel @burtek @jkillian @satya164 @vinitsood @mattiassamskar @jaulz +/types/expo/v31/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @levansuper @ihmpavel @burtek @jkillian @satya164 @mattiassamskar +/types/expo/v30/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @mattiassamskar /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/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-mixpanel-analytics/ @martintreurnicht /types/expo__status-bar-height/ @dawnmist /types/expo__vector-icons/ @incleaf @robertying /types/express/ @borisyankov @@ -1270,7 +1312,7 @@ /types/express-brute-memcached/ @cyrilschumacher /types/express-brute-mongo/ @cyrilschumacher /types/express-brute-redis/ @scottharwell -/types/express-bunyan-logger/ @shreyjain1994 +/types/express-bunyan-logger/ @shreyjain1994 @mastermatt /types/express-busboy/ @pinguet62 /types/express-cluster/ @nenadalm /types/express-correlation-id/ @natemara @@ -1285,7 +1327,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-http-proxy/ @ulrichb @Danscho @carboneater /types/express-jsonschema/ @atd-schubert /types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra /types/express-less/ @xieyubo @@ -1313,7 +1355,8 @@ /types/express-slow-down/ @jdforsythe /types/express-socket.io-session/ @AylaJK /types/express-to-koa/ @xiaohanzhang -/types/express-unless/ @wokim +/types/express-unless/ @wokim @joaovieira @michal-b-kaminski +/types/express-urlrewrite/ @mgroenhoff /types/express-version-request/ @weffe /types/express-version-route/ @weffe /types/express-wechat-access/ @simmons8616 @@ -1332,13 +1375,15 @@ /types/eyes/ @brynbellomy /types/ez-plus/ @AndersonFriaca /types/f1/ @neolwc -/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira @BradleyHill +/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira @BradleyHill @bmkrol823 @glenngartner @codertx /types/facebook-instant-games/ @menushka @oyvindjam /types/facebook-js-sdk/ @amritk @mahmoudzohdi @fluidsonic /types/facebook-pixel/ @noctishsu +/types/facepaint/ @DogPawHat @antonsamper /types/factory-girl/ @stackbuilders @sestrella @elcuy /types/faker/ @bensw @basp @Kuniwak @mattbishop /types/faker/v3/ @Kuniwak +/types/falafel/ @delprzemo /types/falcor/ @Quramy /types/falcor-express/ @Quramy /types/falcor-http-datasource/ @Quramy @@ -1346,21 +1391,18 @@ /types/falcor-router/ @Quramy @cdhgee /types/famous/ @borisvasilenko /types/fancy-log/ @pine -/types/fancybox/ @borisyankov +/types/fancybox/ @borisyankov @SPWizard01 /types/farbtastic/ @EnableSoftware /types/fast-json-stable-stringify/ @BendingBender /types/fast-levenshtein/ @mizunashi-mana /types/fast-list/ @BendingBender +/types/fast-ratelimit/ @JorgenVatle /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 @metsawyr /types/fb/ @JoshStrobl @@ -1375,7 +1417,7 @@ /types/feathersjs__authentication-oauth1/ @j2L4e /types/feathersjs__authentication-oauth2/ @j2L4e @NickBolles /types/feathersjs__configuration/ @j2L4e -/types/feathersjs__errors/ @j2L4e +/types/feathersjs__errors/ @j2L4e @RazzM13 /types/feathersjs__express/ @j2L4e @DadUndead /types/feathersjs__feathers/ @j2L4e @AbraaoAlves @TimMensch /types/feathersjs__primus/ @j2L4e @@ -1401,11 +1443,8 @@ /types/figures/ @BendingBender /types/file-exists/ @BendingBender /types/file-saver/ @cyrilschumacher @DaIgeb @chrismbarr -/types/file-type/ @tcaesvk @BendingBender /types/file-url/ @coderslagoon -/types/filenamify/ @rokt33r -/types/filenamify-url/ @cprecioso -/types/filesize/ @GiedriusGrabauskas @renchap @Ky6uk +/types/filesize/ @GiedriusGrabauskas @renchap @Ky6uk @ffxsam /types/fill-pdf/ @westy92 /types/filter-console/ @BendingBender /types/filter-invalid-dom-props/ @icopp @@ -1413,6 +1452,7 @@ /types/finch/ @DavidSichau /types/find/ @andypyrope /types/find-cache-dir/ @BendingBender +/types/find-down/ @ffflorian /types/find-java-home/ @sjx233 /types/find-package-json/ @BendingBender /types/find-parent-dir/ @ikatyang @@ -1437,13 +1477,12 @@ /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/flickity/ @clmcgrath @wagich @aheber /types/flight/ @jonathanhedren /types/flightplan/ @borislavjivkov /types/flipsnap/ @kubosho @gsino @mayuki @@ -1451,7 +1490,7 @@ /types/flot/ @burlandm @Anticom @admiralsmaster /types/flowdoc/ @animify /types/flowjs/ @ryan10132 -/types/fluent/ @huy-nguyen +/types/fluent/ @huy-nguyen @jamesnimlos /types/fluent-ffmpeg/ @tcaesvk @DingWeizhe @mabidina /types/fluent-langneg/ @huy-nguyen /types/fluent-react/ @huy-nguyen @@ -1465,19 +1504,22 @@ /types/fm-websync/ @markusmauch /types/fnv-lite/ @marcind /types/focus-within/ @eramdam +/types/follow-redirects/ @forivall /types/fontfaceobserver/ @RandScullard /types/fontoxml/ @rolandzwaga +/types/force-graph/ @p-kimberley /types/forever-agent/ @yavanosta /types/forever-monitor/ @shuntksh @wrboyce /types/forge-apis/ @Autodesk-Forge /types/forge-di/ @adamcarr -/types/forge-viewer/ @Autodesk-Forge +/types/forge-viewer/ @Autodesk-Forge @alansmithnbs /types/form-data/ @soywiz @leonyu @BendingBender /types/form-serialize/ @tyler-johnson /types/form-serializer/ @flqw /types/form-urlencoded/ @alepee /types/format-duration/ @Roaders /types/format-io/ @amitbeck +/types/format-number/ @codelovesme /types/format-unicorn/ @kruncher /types/formidable/ @Nemo157 /types/forms/ @suXinjke @@ -1685,7 +1727,7 @@ /types/geolite2/ @ffflorian /types/geometry-dom/ @nakakura /types/geopattern/ @Gaelan -/types/gestalt/ @serranoarevalo +/types/gestalt/ @serranoarevalo @joshgachnang /types/get-caller-file/ @ajafff /types/get-certain/ @BendingBender /types/get-emails/ @BendingBender @@ -1693,12 +1735,11 @@ /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-res/ @satyarohith /types/get-stdin/ @DanielRosenwasser -/types/get-stream/ @douglasduteil @BendingBender /types/get-urls/ @BendingBender -/types/get-value/ @DanielRosenwasser +/types/get-value/ @DanielRosenwasser @TheMallen /types/getenv/ @impankratov /types/getopts/ @azasypkin /types/getos/ @BendingBender @@ -1708,7 +1749,8 @@ /types/ghauth/ @Leko /types/gifffer/ @gatimus /types/gijgo/ @atatanasov -/types/giraffe/ @darthapo +/types/giphy-api/ @screendriver +/types/giraffe/ @darthapo @jgonggrijp /types/git/ @vvakame /types/git-add-remote/ @BendingBender /types/git-branch/ @rynclark @@ -1735,6 +1777,9 @@ /types/gl-react-native/ @jussikinnula /types/gl-shader/ @MathiasPaumgarten /types/gl-texture2d/ @MathiasPaumgarten +/types/gl-vec2/ @adamzerella +/types/gl-vec3/ @adamzerella +/types/gl-vec4/ @adamzerella /types/gldatepicker/ @qcz /types/glidejs/ @milanjaros /types/glob/ @vvakame @voy @ajafff @@ -1751,7 +1796,6 @@ /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/glue/v4/ @gjednaszewski @@ -1764,6 +1808,7 @@ /types/google-cloud__kms/ @ben-tbotlabs /types/google-cloud__pubsub/ @pheromonez @LunaPg @msiviero /types/google-cloud__tasks/ @ifiokjr +/types/google-cloud__text-to-speech/ @benhjames /types/google-earth/ @icholy /types/google-images/ @dolanmiu /types/google-libphonenumber/ @leonyu @winfinit @@ -1780,7 +1825,7 @@ /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/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar @gauthierm @captain-igloo /types/googlemaps.infobubble/ @Dashue /types/googlepay/ @Fluccioni @Radu-Raicea @fstanis /types/got/ @BendingBender @LinusU @ikokostya @stijnvn @@ -1792,7 +1837,8 @@ /types/gramps__rest-helpers/ @claude /types/graphite-udp/ @EricByers /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/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 @JCMais @langpavel @mc0 @martijnwalraven +/types/graphql-api-koa/ @mike-marcacci /types/graphql-date/ @enaeseth /types/graphql-deduplicator/ @lfades /types/graphql-depth-limit/ @eritikass @@ -1801,6 +1847,7 @@ /types/graphql-iso-date/ @jwaldrip /types/graphql-list-fields/ @filipows /types/graphql-query-complexity/ @abhikmitra +/types/graphql-react/ @mike-marcacci /types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo /types/graphql-resolve-batch/ @nayni /types/graphql-resolvers/ @mike-engel @@ -1809,7 +1856,8 @@ /types/grasp/ @agnoster /types/gravatar/ @denis-sokolov /types/gravatar-url/ @ivangabriele -/types/greasemonkey/ @kotas +/types/greasemonkey/ @kotas @nikolay-borzov +/types/greasemonkey/v3/ @kotas /types/grecaptcha/ @DethAriel @rafaeltavares /types/grecaptcha/v0/ @brentj73 /types/gregorian-calendar/ @cwalv @@ -1817,7 +1865,8 @@ /types/gridstack/ @PascalSenn @ZoolWay @Sl1MBoy /types/grpc-error/ @danwbyrne /types/grunt/ @jeffmay @basarat -/types/gsap/ @codebelt @ProbablePrime @philipbulley @leomeloxp +/types/gsap/ @codebelt @ProbablePrime @philipbulley @leomeloxp @AdemHodzic +/types/gtag.js/ @rokt33r /types/gtin/ @RafaelKr /types/guardian__prosemirror-invisibles/ @dddotsev /types/guid/ @maroy1986 @@ -1845,6 +1894,7 @@ /types/gulp-file-include/ @DanielRosenwasser /types/gulp-filter/ @tkrotoff /types/gulp-flatten/ @k-kagurazaka +/types/gulp-gh-pages/ @ntnyq /types/gulp-gzip/ @tkQubo /types/gulp-help/ @tkQubo /types/gulp-help-doc/ @Mikhus @@ -1857,6 +1907,7 @@ /types/gulp-inject/ @k-kagurazaka /types/gulp-insert/ @shantmarouti /types/gulp-install/ @peterjuras +/types/gulp-intercept/ @TokugawaTakesi /types/gulp-jade/ @berwyn /types/gulp-jasmine/ @andypyrope /types/gulp-jasmine-browser/ @tkrotoff @@ -1890,6 +1941,7 @@ /types/gulp-strip-debug/ @peterjuras /types/gulp-svg-sprite/ @tkqubo /types/gulp-svgmin/ @Aankhen +/types/gulp-tap/ @TokugawaTakesi /types/gulp-task-listing/ @joeskeen /types/gulp-template/ @pe8ter /types/gulp-tsd/ @k-kagurazaka @@ -1898,6 +1950,8 @@ /types/gulp-util/ @jedmao /types/gulp-watch/ @tkrotoff /types/gulp-zip/ @dudeofawesome +/types/gun/ @Jack-Works +/types/gyronorm/ @evanshortiss /types/gzip-js/ @rhysd /types/gzip-size/ @plantain-00 @jimivdw @andrewiggins /types/gzip-size/v3/ @plantain-00 @@ -1905,7 +1959,6 @@ /types/halfred/ @dherges /types/halogen/ @steller /types/hammerjs/ @milkisevil @codler -/types/handlebars/ @borisyankov @evil-shrike /types/handlebars-helpers/ @Toilal /types/hapi/ @rafaelsouzaf @jhsimms @SimonSchick @saboya /types/hapi/v17/ @rafaelsouzaf @jhsimms @SimonSchick @saboya @@ -1927,11 +1980,9 @@ /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 -/types/hasha/ @BendgingBender /types/hasher/ @flyfishMT /types/hashids/ @pocesar /types/hashmap/ @outring @@ -1948,17 +1999,18 @@ /types/hedron/ @dborysov /types/hellojs/ @PavelPZ @vuorinem @baywet /types/hellosign-embedded/ @xt0rted -/types/helmet/ @cyrilschumacher @EvanHahn @bluehatbrit +/types/helmet/ @cyrilschumacher @EvanHahn @bluehatbrit @chdanielmueller /types/heredatalens/ @denyo /types/heremaps/ @Josh-ES @denyo @fx88 /types/heroku-logger/ @kylevogt /types/hex-rgb/ @BendingBender /types/hex-rgba/ @r3nya +/types/hexo/ @kentarouTakeda /types/hexo-bunyan/ @segayuu /types/hexo-fs/ @segayuu /types/hexo-log/ @segayuu /types/hexo-util/ @segayuu -/types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens +/types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens @jgresham @Arunkeshavareddy /types/highcharts-ng/ @scatcher /types/highland/ @Bartvds @hgwood @iwllyu @alvis @notbobthebuilder /types/highlight.js/ @nikeee @sourrust @joshuakgoldberg @@ -1969,15 +2021,16 @@ /types/history.js/ @borisyankov @gjunge /types/historykana/ @h-shiratsuki /types/hjson/ @crunchie84 -/types/hls.js/ @jgainfort @brookback @adripanico +/types/hls.js/ @jgainfort @brookback @adripanico @beraliv /types/hoek/ @prashaantt -/types/hoist-non-react-statics/ @JounQin +/types/hogan.js/ @AndrewLeedham +/types/hoist-non-react-statics/ @JounQin @jamesreggio /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/howler/ @xperiments @alien35 @nicholashza @cjurango /types/hpp/ @kryops /types/html-entities/ @xstoudi /types/html-minifier/ @tkrotoff @rikuayanokozy @@ -1986,12 +2039,16 @@ /types/html-tag-names/ @sandersn /types/html-tags/ @BendingBender /types/html-to-text/ @erykwarren +/types/html-truncate/ @adamzerella /types/html-void-elements/ @rhysd /types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk /types/html-webpack-template/ @bumbleblym /types/html2canvas/ @rwhepburn @tan9 @sschocke @Ristaaf +/types/html5-history/ @akashishu777 +/types/html5-to-pdf/ @samalexander +/types/html5plus/ @dcloudio /types/htmlbars-inline-precompile/ @chriskrycho -/types/htmlparser2/ @staticfunction @LinusU +/types/htmlparser2/ @staticfunction @LinusU @johandavidson /types/htmltojsx/ @basarat /types/http-assert/ @jkeylu @stripedpajamas /types/http-aws-es/ @marcogrcr @@ -2001,7 +2058,7 @@ /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/ @SomaticIT @Raigen @DanielMSchmidt @jabreu610 /types/http-proxy-agent/ @mrmlnc @steprescott /types/http-proxy-middleware/ @zebMcCorkle @BendingBender /types/http-rx/ @L2jLiga @@ -2009,13 +2066,14 @@ /types/http-status/ @misak113 /types/http-string-parser/ @pine613 /types/httperr/ @yortus -/types/hubot/ @dirk @KeesCBakker +/types/hubot/ @dirk @KeesCBakker @eeemil /types/hubspot-pace/ @borislavjivkov /types/humane/ @jmvrbanac +/types/humanize-ms/ @adamzerella /types/humanize-plus/ @DenisCarriere -/types/humanize-string/ @ragnarok56 /types/humanize-url/ @BendingBender /types/humanparser/ @MichalPodeszwa +/types/hummus-recipe/ @erikberressem /types/humps/ @nikeee /types/hyco-ws/ @mrcabellom /types/hyper-aws4/ @bambutz @@ -2028,13 +2086,10 @@ /types/i18next/ @mxl @deerawan @GiedriusGrabauskas @lenovouser @qqilihq @butchyyyy /types/i18next/v8/ @mxl @deerawan @GiedriusGrabauskas /types/i18next/v2/ @mxl @deerawan @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 /types/i18next-sprintf-postprocessor/ @cyrilschumacher -/types/i18next-xhr-backend/ @jamuhl @GiedriusGrabauskas /types/i2c-bus/ @101100 /types/iarna__toml/ @ajafff /types/iban/ @cyrilschumacher @@ -2044,6 +2099,7 @@ /types/icheck/ @qcz /types/icon-gen/ @ffflorian /types/iconv/ @delphinus35 +/types/identicon.js/ @D0miH /types/idyll/ @iocat /types/idyll-ast/ @iocat /types/idyll-compiler/ @iocat @@ -2054,7 +2110,6 @@ /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 @@ -2071,10 +2126,12 @@ /types/immediate/ @BendingBender /types/imperium/ @gaetansenn /types/impress/ @borisyankov +/types/imul/ @djcsdy /types/in-app-purchase/ @l-jonas @IchordeDionysos /types/in-range/ @DanielRosenwasser /types/inboxsdk/ @rdoursenaud @amiram /types/incremental-dom/ @basarat @lanthaler @vvakame +/types/indefinite/ @omaishr /types/indent-string/ @mhegazy @BendingBender /types/inert/ @nycdotnet @AJamesPhillips @lenovouser /types/inert/v4/ @nycdotnet @AJamesPhillips @@ -2085,9 +2142,15 @@ /types/iniparser/ @chrootsu /types/init-package-json/ @kfarnung /types/ink/ @cprecioso +/types/ink-select-input/ @lukostry @shatodj +/types/ink-spinner/ @lukostry +/types/ink-table/ @lukostry +/types/ink-testing-library/ @MancunianSam +/types/ink-text-input/ @lukostry /types/inline-css/ @philipisapain /types/inline-style-prefixer/ @ahz @dpetrezselyova @franklixuefei -/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun +/types/inputmask/ @dmester +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun @chigix /types/inquirer-npm-name/ @manuth /types/insert-css/ @hvoecking /types/insert-module-globals/ @leonard-thieu @@ -2097,16 +2160,14 @@ /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/intersects/ @voxylu /types/intl/ @RagibHasin /types/intl-locales-supported/ @Slessi /types/intl-messageformat/ @mhegazy /types/intl-relativeformat/ @mohsen1 /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 @@ -2135,12 +2196,14 @@ /types/is-array/ @pine /types/is-array-sorted/ @BendingBender /types/is-binary-path/ @DanielRosenwasser +/types/is-blank/ @heygambo /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-date-object/ @adamzerella /types/is-docker/ @YashdalfTheGray /types/is-dotdir/ @BendingBender /types/is-dotfile/ @BendingBender @@ -2152,15 +2215,18 @@ /types/is-git-url/ @BendingBender /types/is-glob/ @mrmlnc /types/is-hotkey/ @petester42 @kalley +/types/is-image/ @DenisFrezzato /types/is-installed-globally/ @BendingBender +/types/is-integer/ @djcsdy /types/is-ip/ @coderslagoon /types/is-mobile/ @LogvinovLeon /types/is-my-json-valid/ @kruncher +/types/is-natural-number/ @adamzerella /types/is-negated-glob/ @ajafff /types/is-number/ @harryshipton /types/is-obj/ @forivall /types/is-object/ @wbhob -/types/is-online/ @BendingBender +/types/is-odd/ @adamzerella /types/is-path-cwd/ @DanielRosenwasser /types/is-path-in-cwd/ @mhegazy /types/is-plain-obj/ @BendingBender @@ -2174,9 +2240,7 @@ /types/is-root/ @mhegazy /types/is-root-path/ @mhegazy /types/is-running/ @danwbyrne -/types/is-scoped/ @postcrafter /types/is-stream/ @me -/types/is-svg/ @BendingBender /types/is-text-path/ @mhegazy /types/is-touch-device/ @screendriver /types/is-trademarked/ @BendingBender @@ -2196,11 +2260,11 @@ /types/iso-3166-2/ @sicilica /types/iso8601-localizer/ @avielfedida /types/isomorphic-fetch/ @toddlucas -/types/isotope-layout/ @avidenic @malinushj +/types/isotope-layout/ @avidenic @malinushj @SPWizard01 /types/issue-parser/ @Leko /types/issue-regex/ @BendingBender /types/istanbul/ @tkrotoff -/types/istanbul-lib-coverage/ @jason0x43 +/types/istanbul-lib-coverage/ @jason0x43 @loryman /types/istanbul-lib-hook/ @jason0x43 /types/istanbul-lib-instrument/ @jason0x43 /types/istanbul-lib-report/ @jason0x43 @@ -2240,14 +2304,14 @@ /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/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell @sebald @andys8 @antoinebrault /types/jest/v16/ @NoHomey @jwbay /types/jest-axe/ @JoshuaKGoldberg /types/jest-cli/ @lifeiscontent /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang /types/jest-each/ @theutz @nickmccurdy -/types/jest-environment-puppeteer/ @joshuakgoldberg +/types/jest-environment-puppeteer/ @joshuakgoldberg @ifiokjr /types/jest-get-type/ @myabc /types/jest-image-snapshot/ @dawnmist /types/jest-in-case/ @geovanisouza92 @@ -2267,7 +2331,7 @@ /types/jjve/ @Nemo157 /types/jmespath/ @pushplay /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/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd @thewillg @SimonSchick @afharo /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 @@ -2403,7 +2467,7 @@ /types/js-beautify/ @JoshuaKGoldberg @hansrwindhoff /types/js-clipper/ @omni360 /types/js-combinatorics/ @outring -/types/js-cookie/ @theodorejb @BendingBender @alepee +/types/js-cookie/ @theodorejb @BendingBender @alepee @yutod /types/js-data-angular/ @reppners /types/js-fixtures/ @kazimanzurrashid /types/js-git/ @Bartvds @@ -2423,8 +2487,10 @@ /types/js.spec/ @mattbishop /types/jsbn/ @Evgenus @al2xed /types/jschannel/ @yitzchok @McFlat +/types/jscodeshift/ @brieb /types/jscrollpane/ @qcz /types/jsdeferred/ @minodisk +/types/jsdoc-to-markdown/ @adamzerella /types/jsdom/ @leonard-thieu @palmfjord /types/jsen/ @vladeck /types/jsend/ @CaselIT @@ -2452,13 +2518,14 @@ /types/json-stringify-safe/ @BendingBender /types/json2csv/ @juanjoDiaz /types/json2md/ @MartynasZilinskas +/types/json2mq/ @ZhangYiJiang /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/ @alejo90 @errietta @adamvig /types/jsoneditor-for-react/ @joshuakgoldberg /types/jsoneditoronline/ @vbortone /types/jsonfile/ @dbowring @BendingBender @@ -2472,7 +2539,7 @@ /types/jsonrpc-serializer/ @Akim95 @many20 /types/jsonstream/ @Bartvds /types/jsontoxml/ @benstevens48 -/types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk @rlgod +/types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk @rlgod @kettil /types/jsonwebtoken-promisified/ @SomaticIT @danielheim @brikou @aneilbaboo /types/jspath/ @dex4er /types/jspdf/ @amberjs @lleios @jemerald @@ -2480,8 +2547,8 @@ /types/jsrender/ @zakki /types/jsreport-core/ @taoqf /types/jsreport-html-embedded-in-docx/ @taoqf -/types/jsreport-html-to-xlsx/ @me -/types/jsreport-html-to-xlsx/v1/ @me +/types/jsreport-html-to-xlsx/ @taoqf +/types/jsreport-html-to-xlsx/v1/ @taoqf /types/jsreport-jsrender/ @taoqf /types/jsreport-phantom-pdf/ @taoqf /types/jsreport-xlsx/ @taoqf @@ -2515,7 +2582,9 @@ /types/jwt-simple/ @kenfdev @GaelMagnan /types/jwt-then/ @phenomax /types/k6/ @MajorBreakfast -/types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram +/types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram @insanehong +/types/kafkajs/ @michal-b-kaminski +/types/kamailio-kemi/ @bonan /types/karma/ @tkrotoff @43081j @devoto13 /types/karma/v1/ @tkrotoff @43081j /types/karma-chai/ @JayAndCatchFire @@ -2525,7 +2594,7 @@ /types/karma-jasmine/ @michelsalib /types/karma-viewport/ @karak /types/karma-webpack/ @mtraynham -/types/katex/ @mrand01 @knguyen0125 +/types/katex/ @mrand01 @knguyen0125 @dreamerblue /types/kcors/ @Xstoudi @izayoiko /types/kdbush/ @DenisCarriere @chrfrasco /types/kdbxweb/ @Roang-zero1 @@ -2540,7 +2609,7 @@ /types/keymirror/ @jfahrenkrug /types/keypress.js/ @rcchen /types/keysym/ @harryshipton -/types/keytar/ @miniak @shiftkey @juturu +/types/keytar/ @miniak @shiftkey @juturu @queeniema /types/keyv/ @Arylo @BendingBender /types/keyv__mongo/ @BendingBender /types/keyv__mysql/ @BendingBender @@ -2548,11 +2617,11 @@ /types/keyv__redis/ @BendingBender /types/keyv__sqlite/ @BendingBender /types/kik-browser/ @joelday -/types/klaw/ @mceachen +/types/kissfft-js/ @racerhere +/types/klaw/ @mceachen @p4sca1 /types/klaw/v1/ @mceachen /types/klaw-sync/ @shiftkey /types/kms-json/ @sunnyone -/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 @joelshepherd /types/knex-postgis/ @vesse /types/knockback/ @borisyankov /types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @ltlombardi @Retsam @@ -2579,7 +2648,7 @@ /types/koa-better-body/ @danwbyrne /types/koa-bodyparser/ @hellopao @anup-2s @hirochachacha /types/koa-bouncer/ @maruware -/types/koa-bunyan-logger/ @sjmcdowall +/types/koa-bunyan-logger/ @sjmcdowall @jankdc /types/koa-cache-control/ @pe8ter /types/koa-compose/ @jkeylu /types/koa-compress/ @hellopao @@ -2593,10 +2662,11 @@ /types/koa-hbs/ @jcbmln @mudkipme /types/koa-helmet/ @me /types/koa-html-minifier/ @romain-faust -/types/koa-joi-router/ @wingsbob @move-zig @hirochachacha +/types/koa-joi-router/ @wingsbob @move-zig @hirochachacha @NotWoods /types/koa-json/ @brooklyndev /types/koa-json-error/ @mudkipme /types/koa-log/ @havenchyk +/types/koa-log4/ @a631807682 /types/koa-logger/ @geoffreak @tlaziuk /types/koa-logger-winston/ @stevehipwell /types/koa-morgan/ @vesse @@ -2618,7 +2688,7 @@ /types/koa-send/ @pe8ter @tlaziuk /types/koa-session/ @kerol2r20 @tlaziuk @hirochachacha /types/koa-session-minimal/ @longztian -/types/koa-sslify/ @wingsbob +/types/koa-sslify/ @wingsbob @msokk /types/koa-static/ @hellopao @tlaziuk /types/koa-static-cache/ @JounQin /types/koa-static-server/ @wulunyi @@ -2646,7 +2716,6 @@ /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 @@ -2657,7 +2726,7 @@ /types/ldap-filters/ @pluma /types/ldapjs/ @cvillemure @peterkooijmans /types/leadfoot/ @theintern -/types/leaflet/ @alejo90 @atd-schubert @mcauer +/types/leaflet/ @alejo90 @atd-schubert @mcauer @ronikar /types/leaflet/v0/ @rgripper /types/leaflet-areaselect/ @awallat /types/leaflet-curve/ @onikiienko @@ -2702,15 +2771,16 @@ /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/license-checker/ @rogierschouten @unindented @alechemy +/types/license-checker-webpack-plugin/ @ChaosinaCan /types/liftoff/ @BendingBender +/types/lil-uri/ @wcarson /types/lil-uuid/ @Pr1st0n /types/lime-js/ @arthur-xavier /types/line-by-line/ @etomsen @@ -2721,11 +2791,12 @@ /types/lingui__macro/ @huan086 /types/lingui__react/ @huan086 /types/linkify-issues/ @BendingBender -/types/linkify-it/ @praxxis +/types/linkify-it/ @praxxis @alexplumb /types/linkify-urls/ @BendingBender /types/linkifyjs/ @szhu @ovidiubute /types/list-git-remotes/ @BendingBender /types/list-stream/ @IanStorm +/types/list.js/ @jeffreymeng /types/listr/ @durad /types/lls/ @borislavjivkov /types/load-google-maps-api/ @oBusk @@ -3037,7 +3108,6 @@ /types/lodash.zipobjectdeep/ @bczengel @chrootsu @stepancar /types/lodash.zipwith/ @bczengel @chrootsu @stepancar /types/log-symbols/ @BendingBender -/types/log-update/ @BendingBender /types/logat/ @krvikash35 /types/logform/ @DABH /types/logg/ @blittle @@ -3045,7 +3115,7 @@ /types/loglevel/ @Pro @szmeti @screendriver /types/logrotate-stream/ @rogierschouten /types/lokijs/ @TeamworkGuy2 @thomasconner -/types/lolex/ @Nemo157 @joshuakgoldberg @rogierschouten +/types/lolex/ @Nemo157 @joshuakgoldberg @rogierschouten @zyishai /types/long/ @peterkooijmans /types/looks-same/ @xcatliu /types/loopback/ @kattsushi @enko @sequoia @drmikecrowe @karimsa @@ -3059,6 +3129,7 @@ /types/lowlight/ @NoHomey /types/lozad/ @plantain-00 /types/lru-cache/ @Bartvds @BendingBender +/types/lru-cache/v4/ @Bartvds @BendingBender /types/lscache/ @Chris-Martinezz /types/ltx/ @PJakcson @BendingBender /types/luaparse/ @stpettersens @@ -3067,6 +3138,7 @@ /types/lusca/ @crutchcorn /types/luxon/ @colbydehart @FourwingsY @jsiebern @mastermatt @pietrovismara @dawnmist /types/lwip/ @AyaMorisawa +/types/lyricist/ @DadUndead /types/lz-string/ @M0ns1gn0r /types/lzma-native/ @leshow /types/macrotask/ @BendingBender @@ -3077,9 +3149,8 @@ /types/maildev/ @cyrilschumacher @zbarbuto /types/mailgen/ @vothanhkiet @jordanfarrer /types/mailgun-js/ @sampsonjoliver @andipaetzold -/types/mailparser/ @psnider +/types/mailparser/ @psnider @Avol-V /types/main-bower-files/ @k-kagurazaka -/types/make-dir/ @ikatyang @BendingBender /types/maker.js/ @danmarshall /types/makeup-expander/ @darkwebdev /types/makeup-floating-label/ @darkwebdev @@ -3092,13 +3163,14 @@ /types/mangopay2-nodejs-sdk/ @ifiokjr /types/map-obj/ @BendingBender /types/mapbox/ @anahkiasen @Fluccioni -/types/mapbox-gl/ @dobrud @patrickr +/types/mapbox-gl/ @dobrud @patrickr @macobo /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/mapbox__sphericalmercator/ @nhusher /types/mapnik/ @ipv4sec /types/mapsjs/ @davismj /types/mariasql/ @bennett000 @@ -3108,8 +3180,9 @@ /types/markdown-it-container/ @hronex /types/markdown-it-lazy-headers/ @knom /types/markdown-pdf/ @MonsieurMan +/types/markdown-to-jsx/ @ecraig12345 /types/markdownlint/ @ark120202 -/types/marked/ @worr @BendingBender @CrossR @mwickett +/types/marked/ @worr @BendingBender @CrossR @mwickett @htkzhtm /types/marked-terminal/ @bkendall /types/marker-animate-unobtrusive/ @viskin /types/markerclustererplus/ @enanox @mxl @@ -3157,6 +3230,8 @@ /types/material__top-app-bar/ @BrentDouglas @ckosti /types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy /types/materialize-css/v0/ @eriklieben @leonyu @SinghSukhdeep @jfcere @scote @LiadIdan +/types/math-sign/ @djcsdy +/types/math-trunc/ @djcsdy /types/math3d/ @laszlojakab @jimsmart /types/mathjax/ @rolandzwaga /types/mathjs/ @siavol @andnp @bradbesserman @pawkrol @@ -3171,13 +3246,12 @@ /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/memjs/ @leizongmin @BendingBender /types/memoize-one/ @karol-majewski @franklixuefei /types/memoize-one/v3/ @karol-majewski @franklixuefei /types/memoizee/ @juanpicado @@ -3217,6 +3291,7 @@ /types/micro-events/ @AlexanderSychev /types/micromatch/ @glen-84 @vemoo /types/micromatch/v2/ @glen-84 +/types/micromodal/ @wcarson /types/microrouter/ @mathieudutour /types/microservice-utilities/ @runebaas /types/microsoft-ajax/ @pjmagee @@ -3248,6 +3323,7 @@ /types/mixto/ @vvakame /types/mjml/ @aahoughton @marpstar /types/mjml-react/ @henrinormak +/types/mkcert/ @asachin96 /types/mkdirp/ @Bartvds @mrmlnc /types/mkdirp-promise/ @pluma /types/mkpath/ @optical @@ -3279,19 +3355,20 @@ /types/moment-duration-format/ @SwintDC @TwoStone @leonard-thieu @bendykowski /types/moment-holiday/ @rwdalpe /types/moment-jalaali/ @alitaheri +/types/moment-precise-range-plugin/ @gricey432 /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 @asermax +/types/moment-timezone/ @michelsalib @alanblins @asermax @borys-kupar /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/mongo-sanitize/ @CedricCazin @penumbra1 +/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 @Manc /types/mongodb/v2/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi /types/mongodb-memory-server/ @dmitryrogozhny /types/mongodb-uri/ @mernxl -/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/ @horiuchi @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 @Fazendaaa @NormanPerrin @danmana @stablio @emmanuelgautier @frontendmonster @mingchen @penumbra1 @orblazer +/types/mongoose/v4/ @simonxca @horiuchi @lukasz-zak @murbanowicz /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz @@ -3313,10 +3390,9 @@ /types/morris.js/ @mareek @sindilevich /types/mosca/ @GabrielGouv @jerray /types/motor-hat/ @muntyan -/types/mousetrap/ @qcz @alanhchoi +/types/mousetrap/ @qcz @alanhchoi @nicbarker /types/move-concurrently/ @mgroenhoff -/types/move-file/ @BendingBender -/types/moveto/ @shermendev +/types/moveto/ @shermendev @pea3nut /types/moviedb/ @basarat @0x6368656174 /types/moxios/ @itoasuka /types/mozilla-readability/ @charlesvdv @@ -3328,9 +3404,9 @@ /types/msgpack5/ @wokim @heycalmdown /types/msnodesql/ @borisyankov @SomaticIT /types/msportalfx-test/ @julioct -/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado +/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado @woodenconsulting /types/mu2/ @jedigo -/types/mui-datatables/ @favna +/types/mui-datatables/ @favna @ankithkonda /types/muicss/ @samuelneff /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob /types/multer-gridfs-storage/ @devconcept @@ -3344,6 +3420,7 @@ /types/multiplexjs/ @KamyarNazeri /types/multisort/ @CzBuCHi /types/multistream/ @mrmlnc @kenzierocks +/types/mumath/ @adamzerella /types/muri/ @jloveridge /types/murmurhash/ @atd-schubert /types/murmurhash-js/ @cvle @@ -3369,7 +3446,10 @@ /types/nats-hemera/ @vforv /types/natsort/ @mgroenhoff /types/natural/ @dmoonfire +/types/natural-compare/ @doniyor2109 +/types/natural-compare-lite/ @doniyor2109 /types/natural-sort/ @a-morales @fluggo +/types/naver-whale/ @tbvjaos510 /types/navermaps/ @ckboyjiy /types/navigation/ @grahammendick /types/navigation-react/ @grahammendick @@ -3379,6 +3459,7 @@ /types/nconf/ @jedigo @jmthibault @ew73 /types/ncp/ @bartvds /types/ndarray/ @pawsong @taoqf +/types/ndn-js/ @yoursunny /types/nearley/ @deltaidea @BendingBender /types/neat-csv/ @calamitizer /types/nedb/ @reppners @anthonynichols @afharo @@ -3437,14 +3518,16 @@ /types/nightwatch/ @rkavalap @schlesiger @ClaytonAstrom /types/nise/ @a-tarasyuk /types/nivo-slider/ @AndersonFriaca -/types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko +/types/no-scroll/ @ZhangYiJiang +/types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko @claytonkucera /types/noble-mac/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko /types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour @paambaati /types/nodal/ @charrondev -/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/ @Microsoft @DefinitelyTyped @jkomyno @a-tarasyuk @alvis @r3nya @btoueg @brunoscheufler @smac89 @tellnes @touffy @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 @j-oliveras @bhongy +/types/node/v10/ @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 @j-oliveras @bhongy +/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 @j-oliveras @bhongy +/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 @j-oliveras @bhongy +/types/node/v7/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry @j-oliveras /types/node/v6/ @Microsoft @DefinitelyTyped @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry /types/node/v4/ @Microsoft @DefinitelyTyped @eps1lon @Archcry /types/node/v0/ @Microsoft @DefinitelyTyped @@ -3457,11 +3540,12 @@ /types/node-cron/ @maximelkin @burtek /types/node-dijkstra/ @nokutu /types/node-dir/ @panuhorsmalahti -/types/node-dogstatsd/ @chrisbobo +/types/node-dogstatsd/ @chrisbobo @xzyfer +/types/node-downloader-helper/ @RemyJeancolas /types/node-emoji/ @jonestristand @styu @rimiti -/types/node-fetch/ @torstenwerner @nikcorg @vinaybedre +/types/node-fetch/ @torstenwerner @nikcorg @vinaybedre @kyranet @AndrewLeedham @JasonLi914 /types/node-fibers/ @caryhaynie -/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung @joeflateau @Apologiz @timhwang21 @supaiku0 @andersk +/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung @joeflateau @Apologiz @timhwang21 @supaiku0 @andersk @saschazar21 /types/node-gcm/ @horiuchi /types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy @@ -3471,12 +3555,13 @@ /types/node-hue-api/ @fjmorel /types/node-int64/ @x3cion @kevin-greene-ck /types/node-ipc/ @arvitaly @gjurgens +/types/node-jose/ @nadunindunil /types/node-jsfl-runner/ @mrand01 /types/node-json-db/ @kuzn-ilya /types/node-localstorage/ @intolerance /types/node-memwatch/ @Kroisse /types/node-mysql-wrapper/ @kataras -/types/node-notifier/ @tkQubo +/types/node-notifier/ @tkQubo @loryman /types/node-polyglot/ @timjk @liamross /types/node-powershell/ @rodrigoff /types/node-pushnotifications/ @menushka @@ -3485,6 +3570,7 @@ /types/node-redis-pubsub/ @renekeijzer /types/node-resque/ @gordey4doronin /types/node-rsa/ @alitaheri @xm @ffflorian +/types/node-sass/ @pspeter3 @chriseppstein /types/node-schedule/ @cyrilschumacher @flowpl /types/node-slack/ @tkQubo /types/node-snap7/ @heilingbrunner @@ -3506,7 +3592,8 @@ /types/node-zopfli-es/ @Alorel /types/node_redis/ @borisyankov /types/nodecredstash/ @migstopheles -/types/nodegit/ @dolanmiu @tniessen +/types/nodegit/ @dolanmiu @tniessen @pvigier +/types/nodejs-license-file/ @trodi /types/nodemailer/ @rogierschouten @dex4er @bioball /types/nodemailer/v3/ @rogierschouten /types/nodemailer-direct-transport/ @rogierschouten @@ -3519,11 +3606,11 @@ /types/nodeunit/ @jedigo /types/noisejs/ @izmhr /types/nomnom/ @panopticoncentral +/types/nonogram-solver/ @ffflorian /types/nookies/ @andreasbergqvist /types/nopt/ @jbondc /types/normalize-package-data/ @jdxcode /types/normalize-path/ @BendingBender -/types/normalize-url/ @odin3 @BendingBender @mathieumg /types/notie/ @mateusdemboski /types/notify/ @hellochar /types/notifyjs/ @soundTricker @NateScarlet @@ -3534,20 +3621,18 @@ /types/nouislider/v7/ @acoreyj /types/novnc-core/ @smithkl42 @BendingBender /types/npm/ @SomaticIT -/types/npm-email/ @BendingBender -/types/npm-keyword/ @BendingBender /types/npm-license-crawler/ @ffflorian -/types/npm-name/ @BendingBender +/types/npm-list-author-packages/ @ffflorian /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-registry-package-info/ @ffflorian /types/npm-user-packages/ @BendingBender /types/npmlog/ @DanielMSchmidt @littlepiggy03 /types/ns-api/ @Archcry /types/nslog/ @unindented /types/nsqjs/ @cezaryrk +/types/nssm/ @hongaar /types/number-is-nan/ @mhegazy /types/number-to-words/ @frederickfogerty /types/numeral/ @vbortone @BehindTheMath @klujanrosas @@ -3560,6 +3645,7 @@ /types/nw.js/ @alirdn /types/nwmatcher/ @woutervh- /types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte +/types/oakdex-pokedex/ @jalyna /types/oauth/ @nonAlgebraic @EduardoAC /types/oauth-shim/ @BendingBender /types/oauth.js/ @nobuoka @@ -3590,13 +3676,14 @@ /types/office-js-preview/ @OfficeDev @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT /types/office-runtime/ @Zlatkovsky @mscharlock /types/offline-js/ @cgwrench +/types/offscreencanvas/ @kayahr /types/oibackoff/ @geoffreak /types/oidc-token-manager/ @rosieks /types/oja/ @buffcode /types/okta__okta-vue/ @innovation-team /types/ol/ @yairtawil /types/omggif/ @ffflorian -/types/on-change/ @BendingBender +/types/omit-empty/ @pastelsky /types/on-finished/ @czechboy0 @BendingBender /types/on-headers/ @jjeffery @BendingBender /types/on-wake-up/ @ajafff @@ -3604,14 +3691,18 @@ /types/one-time/ @BendingBender /types/onesignal-cordova-plugin/ @broder /types/onetime/ @BendingBender +/types/onetime/v2/ @BendingBender /types/oniguruma/ @smhxx +/types/onionoo/ @BendingBender /types/onoff/ @marcel-ernst @Kallu609 /types/ontime/ @Hirse -/types/open/ @Bartvds +/types/open/ @shinnn @SomaticIT @tlent @ffflorian /types/open-editor/ @BendingBender +/types/open-graph/ @ffflorian /types/openapi-factory/ @runebaas /types/opener/ @tikurahul /types/openfin/ @chrisbarker @rdepena @whyn07m3 @licui3936 +/types/openfin/v37/ @chrisbarker @rdepena @whyn07m3 @licui3936 /types/openfin/v34/ @chrisbarker @rdepena @whyn07m3 /types/openfin/v29/ @chrisbarker @rdepena /types/openfin/v17/ @chrisbarker @@ -3619,18 +3710,14 @@ /types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 @gberaudo /types/openlayers/v3/ @osechet @matthiasdailey-ccri /types/openlayers/v2/ @bolhovsky -/types/openpgp/ @errietta @damonpam @po5i @ecamellini +/types/openpgp/ @errietta @damonpam @po5i @ecamellini @SardineFish /types/openstack-wrapper/ @sanjaymadane -/types/opentok/ @westy92 @CatGuardian +/types/opentok/ @westy92 @CatGuardian @pronebird /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/ @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 @@ -3652,63 +3739,36 @@ /types/owl.carousel/ @igorissen @KennethanCeyer /types/owlcarousel/ @dpiatkowski /types/p-all/ @BendingBender -/types/p-any/ @BendingBender -/types/p-cancelable/ @BendingBender -/types/p-catch-if/ @LinusU -/types/p-debounce/ @BendingBender /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 -/types/p-locate/ @BendingBender -/types/p-log/ @BendingBender -/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 -/types/p-series/ @BendingBender /types/p-settle/ @natesilva -/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/p2/ @clark-stevenson @jramstedt /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/pako/ @cappellin @calebegg @hlthi /types/palx/ @mikefowler /types/pangu/ @plantain-00 /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-bundler/ @pinage404 @nick-woodward /types/parcel-env/ @fathyb /types/parent-package-json/ @sgmccli /types/parents/ @TeamworkGuy2 @@ -3716,7 +3776,7 @@ /types/parity-pmr/ @leovujanic /types/parity-poe/ @leovujanic /types/park-miller/ @BendingBender -/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas @agoldis +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas @agoldis @AlexandreHetu @dplewis @yomybaby /types/parse/v1/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas /types/parse-columns/ @BendingBender /types/parse-filepath/ @BendingBender @@ -3724,6 +3784,7 @@ /types/parse-git-config/v2/ @leonard-thieu @deltaidea /types/parse-github-url/ @ajafff /types/parse-glob/ @glen-84 +/types/parse-human-date-range/ @forivall /types/parse-json/ @mrmlnc /types/parse-link-header/ @zelein /types/parse-mockdb/ @dpoetzsch @@ -3769,7 +3830,7 @@ /types/passport-oauth2/ @pasieronen @WangZishi @EduardoAC @ivan94 /types/passport-oauth2-client-password/ @akaNightmare /types/passport-remember-me-extended/ @AylaJK -/types/passport-saml/ @cjbarth @dassennato @ksamborski +/types/passport-saml/ @cjbarth @dassennato @ksamborski @josecolella /types/passport-steam/ @kzay /types/passport-strategy/ @liorm /types/passport-twitter/ @staticfunction @@ -3782,9 +3843,7 @@ /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 @@ -3795,7 +3854,7 @@ /types/pbf/ @cschwarz /types/pbkdf2/ @timonegk /types/pdf2image/ @taoqf -/types/pdfjs-dist/ @jbaldwin +/types/pdfjs-dist/ @jbaldwin @1999 /types/pdfkit/ @erichillah /types/pdfmake/ @m1llen1um @radziksh @evolkmann /types/pdfobject/ @nielsboogaard @@ -3805,12 +3864,14 @@ /types/pegjs/ @vvakame @SrTobi @siegebell /types/pem/ @tony19 @DethAriel /types/pem-jwk/ @alessiopcc +/types/pendo-io-browser/ @aaronbeall /types/permit/ @jannikkeye /types/persona/ @Nycto -/types/pet-finder-api/ @me +/types/pet-finder-api/ @ncipollina /types/petit-dom/ @JamesMessinger /types/pg/ @pspeter3 /types/pg/v6/ @pspeter3 +/types/pg-copy-streams/ @fluggo /types/pg-ears/ @bradleyayers /types/pg-escape/ @khell /types/pg-format/ @zopf @@ -3822,7 +3883,8 @@ /types/phantom/ @horiuchi @llRandom /types/phantomcss/ @abauzac /types/phantomjs/ @jedhunsaker @keesey -/types/phoenix/ @mciastek +/types/phin/ @twooster +/types/phoenix/ @mciastek @John-Goff @princemaple /types/phone/ @DxCx /types/phone-formatter/ @westy92 /types/phonegap/ @borisyankov @DickvdBrink @@ -3839,7 +3901,7 @@ /types/pid-from-port/ @BendingBender /types/pidusage/ @cyrilschumacher @mx601595686 /types/pify/ @samverschueren @mad-mike @c7hm4r -/types/pigpio/ @manerfan @erikma +/types/pigpio/ @manerfan @erikma @park012241 /types/pigpio-dht/ @erikma /types/pikaday/ @MidnightDesign @wake42 @mezoistvan /types/pikaday-time/ @Sayan751 @@ -3853,10 +3915,8 @@ /types/piwik-tracker/ @lbguilherme /types/pixelmatch/ @iamolegga /types/pixi.js/ @clark-stevenson -/types/pkg-conf/ @jorgegonzalez -/types/pkg-dir/ @NK-WEB-Git /types/pkg-up/ @forivall -/types/pkg-versions/ @BendingBender +/types/pkgcloud/ @dantman /types/pkijs/ @microshine /types/platform/ @JakeH /types/playcanvas/ @Neoflash1979 @@ -3864,13 +3924,13 @@ /types/playmusic/ @nickp10 /types/pleasejs/ @nakakura /types/plist/ @higuri -/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @MercifulCode @soorajpudiyadath @jonfreedman @meganrm +/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @MercifulCode @soorajpudiyadath @jonfreedman @meganrm @zeroyoichihachi /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten /types/plupload/ @patrickbussmann /types/plur/ @iRoachie /types/pluralize/ @ukyo @karol-majewski -/types/png-async/ @kanreisa +/types/plurals-cldr/ @ChaosinaCan /types/png.js/ @ffflorian /types/pngjs/ @jason0x43 /types/pngquant-bin/ @hikoma @@ -3885,6 +3945,8 @@ /types/pollyjs__persister-fs/ @feinoujc /types/pollyjs__utils/ @feinoujc /types/polyfill-service/ @Alorel +/types/polygon/ @Nielio +/types/polygons-intersect/ @Nielio /types/polylabel/ @DenisCarriere /types/polyline/ @Kern0 /types/polymer/ @lgrignon @laco0416 @@ -3899,9 +3961,11 @@ /types/postcss-modules-local-by-default/ @huan086 /types/postcss-modules-resolve-imports/ @huan086 /types/postcss-modules-scope/ @huan086 +/types/postcss-nested/ @VorontsovMaxim /types/postcss-url/ @lenovouser /types/postman-collection/ @kbuzby /types/postmark/ @benbayard @jineshshah36 +/types/postmate/ @wcarson /types/pouch-redux-middleware/ @charrondev /types/pouchdb/ @AGBrown @geppy @fredgalvao /types/pouchdb-adapter-fruitdown/ @spaulg @geppy @fredgalvao @@ -3922,26 +3986,32 @@ /types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 @zamb3zi /types/power-assert/ @vvakame /types/power-assert-formatter/ @vvakame +/types/powerapps-component-framework/ @jopursle /types/powerbi-visuals-tools/ @zBritva @Microsoft +/types/preact-i18n/ @ltetzlaff /types/precise/ @codeanimal /types/precond/ @olsio +/types/prefixfree/ @ExE-Boss /types/preloadjs/ @endel /types/prelude-ls/ @AyaMorisawa /types/prettier/ @ikatyang +/types/pretty/ @adamzerella /types/pretty-bytes/ @plantain-00 @danielasy /types/pretty-bytes/v4/ @plantain-00 /types/pretty-format/ @ikatyang /types/pretty-hrtime/ @BendingBender /types/pretty-ms/ @BendingBender @ocboogie @silh /types/pretty-ms/v3/ @BendingBender @ocboogie +/types/pretty-time/ @adamzerella /types/preval.macro/ @huan086 /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak -/types/prismic-dom/ @nickw444 @sbilstein -/types/prismjs/ @eriklieben @andrewiggins @mmiszy +/types/prismic-dom/ @nickw444 @sbilstein @douglasnomizo +/types/prismjs/ @RunDevelopment @ExE-Boss @eriklieben @andrewiggins @mmiszy /types/private-ip/ @coderslagoon /types/procfs-stats/ @cyrilschumacher /types/progress/ @sebastian-lenz +/types/progress-stream/ @mickdekkers /types/progressbar/ @atd-schubert /types/progressjs/ @zaneli /types/proj4/ @DenisCarriere @BendingBender @@ -3969,8 +4039,8 @@ /types/prompt-sync-history/ @MugeSo /types/promptly/ @danrspencer /types/prompts/ @Berkays @danielpa9708 @kamontat -/types/prop-types/ @DovydasNavickas @ferdaber -/types/proper-lockfile/ @qlonik +/types/prop-types/ @DovydasNavickas @ferdaber @eps1lon +/types/proper-lockfile/ @qlonik @LinusU /types/properties-reader/ @Goldsmith42 /types/prosemirror-collab/ @bradleyayers @davidka @timjb @patsimm /types/prosemirror-commands/ @bradleyayers @davidka @timjb @patsimm @@ -3986,8 +4056,11 @@ /types/prosemirror-schema-list/ @bradleyayers @davidka @timjb @patsimm /types/prosemirror-state/ @bradleyayers @davidka @timjb @patsimm /types/prosemirror-tables/ @superchu @eshvedai @patsimm +/types/prosemirror-test-builder/ @ifiokjr /types/prosemirror-transform/ @bradleyayers @davidka @timjb @patsimm /types/prosemirror-view/ @bradleyayers @davidka @timjb @patsimm +/types/protoc-plugin/ @jonnyreeves +/types/protocol-buffers-schema/ @claasahl /types/proton-native/ @khanhas @ltetzlaff /types/protractor-browser-logs/ @rokadias /types/protractor-helpers/ @johncant @@ -3997,14 +4070,13 @@ /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 @FlorianDr @danduh +/types/pubnub/ @bitbankinc @rollymaduk @vitosamson @FlorianDr @danduh @ChristianBoehlke /types/pubsub-js/ @borisyankov /types/pug/ @TonyPythoneer @19majkel94 /types/pulltorefreshjs/ @DanielRosenwasser @humpedli @@ -4012,7 +4084,7 @@ /types/pumpify/ @JustinBeckwith @aoberoi /types/punycode/ @yavanosta /types/pupa/ @nju33 -/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 @SimonSchick +/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 @SimonSchick @SerbanGhita /types/puppeteer/v0/ @marvinhagemeister @cdeutsch /types/puppeteer-core/ @mtsmfm /types/pure-render-decorator/ @seansfkelley @@ -4031,14 +4103,12 @@ /types/qlik-visualizationextensions/ @konne /types/qr-image/ @taoqf /types/qrcode/ @plantain-00 +/types/qrcode-svg/ @ericbf /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 @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/ @waratuman @mike-north @@ -4053,7 +4123,7 @@ /types/radius/ @codeanimal /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/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 @krantisinh @pirix-gh /types/random-boolean/ @BendingBender /types/random-float/ @BendingBender /types/random-int/ @BendingBender @@ -4071,6 +4141,7 @@ /types/rangyinputs/ @ersimont /types/raphael/ @CheCoxshall /types/rappid/ @DenEwout +/types/rasha/ @Just1B /types/raspi/ @nebrius /types/raspi-board/ @nebrius /types/raspi-gpio/ @nebrius @@ -4091,7 +4162,7 @@ /types/rc/ @DanielRosenwasser @BendingBender /types/rc-progress/ @jussikinnula /types/rc-select/ @DenisTirilis -/types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @Deanna2 +/types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @Deanna2 @nicholasmaddren @nulladdict /types/rc-switch/ @karol-majewski /types/rc-time-picker/ @Hoff97 /types/rc-tooltip/ @rhysd @ahstro @vsaarinen @@ -4102,7 +4173,7 @@ /types/rdflib/ @cenotelie /types/re-base/ @jordandrako /types/reach__router/ @kingdaro -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei @Jessidhia @pshrmn @threepointone +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei @Jessidhia @pshrmn @saranshkataria @lukyth @eps1lon /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz /types/react-adal/ @dkorolev1 /types/react-albus/ @sseppola @conradreuter @kuirak @@ -4116,44 +4187,46 @@ /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 @enricoboccadifuoco @lonyele +/types/react-avatar-editor/ @diogocorrea @gabsprates @lsenta @davidspiess +/types/react-axe/ @akshaykarthik +/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen @enricoboccadifuoco @lonyele @lukyth /types/react-better-password/ @mhuynh1 -/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly @janb87 -/types/react-blessed/ @me +/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly @janb87 @ldthorne @siavelis +/types/react-blessed/ @guoshencheng /types/react-body-classname/ @mhegazy /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/ @flaub @alelode @UJosue10 @dawnmist @Ogglas /types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 -/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson @arichter83 @dalevfenton +/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson @arichter83 @dalevfenton @KngHawkon /types/react-breadcrumbs/ @guoyunhe /types/react-breadcrumbs-dynamic/ @mitsuruog /types/react-broadcast/ @kandros -/types/react-burger-menu/ @radziksh +/types/react-burger-menu/ @radziksh @dacevedo12 @germanp173 /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-click-outside/ @screendriver @Ky6uk /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 @nkgrnkgr +/types/react-color/ @LKay @markspolakovs @mntdn @nkgrnkgr @0815Strohhut @dnlfrst /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-credit-cards/ @vstrimaitis @olefrank @zzanol /types/react-cropper/ @stepancar /types/react-css-collapse/ @dford07 /types/react-css-modules/ @KostyaEsmukov @skirsdeda /types/react-css-transition-replace/ @LKay +/types/react-csv/ @vincentjames501 /types/react-currency-formatter/ @pastushenkoy @Jeka-Vasiliev /types/react-custom-scrollbars/ @David-LeBlanc-git @kittimiyo /types/react-custom-scrollbars/v3/ @David-LeBlanc-git @@ -4162,25 +4235,27 @@ /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 @justingrant @jakeboone02 +/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley @justingrant @jakeboone02 @Ky6uk @aviklai /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-dev-utils/ @ark120202 +/types/react-dnd-multi-backend/ @dawnmist @beeequeue @robcodemonkey /types/react-dnd-touch-backend/ @mleko @dawnmist @beeequeue /types/react-document-meta/ @ulrichb /types/react-document-title/ @cleverguy25 -/types/react-dom/ @MartynasZilinskas @theruther4d +/types/react-dom/ @MartynasZilinskas @theruther4d @Jessidhia /types/react-dom/v15/ @MartynasZilinskas /types/react-dom-factories/ @jgoz /types/react-dotdotdot/ @jczyzewski -/types/react-draft-wysiwyg/ @imechZhangLY @brunoMaurice +/types/react-draft-wysiwyg/ @imechZhangLY @brunoMaurice @ldanet /types/react-dragtastic/ @nscarcella /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-editext/ @alioguzhan /types/react-event-listener/ @asvetliakov /types/react-fa/ @flaub @patsissons @LKay /types/react-facebook-login/ @apare @jankarres @@ -4205,7 +4280,8 @@ /types/react-google-login-component/ @koss-lebedev /types/react-google-maps-loader/ @vasilysn /types/react-google-places-suggest/ @vasilysn -/types/react-google-recaptcha/ @KoalaHuman @tomsturge +/types/react-google-recaptcha/ @KoalaHuman @tomsturge @MaxwellBo +/types/react-google-recaptcha/v0/ @KoalaHuman @tomsturge /types/react-gravatar/ @invliD /types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway @manav-m /types/react-hamburger-menu/ @grzesie2k @@ -4214,7 +4290,7 @@ /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-helmet-async/ @forabi @unindented /types/react-highcharts/ @j1r1k /types/react-highlight/ @joshuakgoldberg /types/react-highlight-words/ @mhegazy @diogodca @kellyrmilligan @@ -4224,7 +4300,6 @@ /types/react-howler/ @maksimovicdanijel /types/react-hyperscript/ @tock203 /types/react-icon-base/ @apare @LKay -/types/react-icons/ @apare @johnnyreilly @LKay /types/react-image-crop/ @danielasy @chaaya /types/react-image-fallback/ @8enSmith /types/react-image-gallery/ @adamwpc @@ -4240,11 +4315,11 @@ /types/react-input-calendar/ @stepancar /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-instantsearch/ @gburgett @jpowell @haroenv @samouss +/types/react-instantsearch-core/ @gburgett @jpowell @davidfurlong @haroenv @samouss +/types/react-instantsearch-dom/ @gburgett @jpowell @haroenv @samouss +/types/react-instantsearch-native/ @gburgett @jpowell @haroenv @samouss +/types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari @formatlos @lukyth @obedm503 @anion155 /types/react-intl/v1/ @bgrieder /types/react-intl-redux/ @LKay /types/react-is/ @AviVahl @christianchown @eps1lon @@ -4254,37 +4329,44 @@ /types/react-json/ @spielc /types/react-json-pretty/ @LKay /types/react-json-tree/ @gnestor @zainafzal08 -/types/react-jsonschema-form/ @iamdanfox @iplus26 @phbou72 @LucianBuzzo @sthenault @sbusch +/types/react-jsonschema-form/ @iamdanfox @iplus26 @phbou72 @LucianBuzzo @sthenault @sbusch @medfreeman @saadtazi /types/react-jss/ @eps1lon @jlaw90 +/types/react-kawaii/ @ZhangYiJiang /types/react-lazyload/ @m0a /types/react-lazylog/ @benjaminRomano /types/react-leaflet/ @danzel @davschne @yuit +/types/react-leaflet/v1/ @danzel @davschne @yuit /types/react-leaflet-markercluster/ @Kimahriman /types/react-lifecycle-component/ @pixelshaded /types/react-lifecycles-compat/ @bySabi +/types/react-linkify/ @majames @jackywang529 /types/react-list/ @buptyyf @tomshen /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-map-gl/ @rimig @fnberta @sandersiim /types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti +/types/react-material-ui-form-validator/ @FrankBrullo /types/react-mce/ @morphologue /types/react-mdl/ @bradzacher /types/react-measure/ @asvetliakov @marcfallows +/types/react-medium-image-zoom/ @james-ff /types/react-mentions/ @activescott @efedorenko /types/react-mixin/ @tkqubo /types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz @jpowell /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov +/types/react-motion-loop/ @j-em /types/react-motion-slider/ @asvetliakov /types/react-motion-ui-pack/ @jsonunger -/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/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel @souvik-ghosh @nossbigg @saranshkataria @franzmoro /types/react-native-android-taskdescription/ @christianchown /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 @FabianMeul +/types/react-native-canvas/ @hmajid2301 /types/react-native-communications/ @huhuanming @PaitoAnderson /types/react-native-custom-tabs/ @philnova /types/react-native-datepicker/ @jacobbaskin @nossbigg @@ -4318,10 +4400,12 @@ /types/react-native-mauron85-background-geolocation/ @djereg /types/react-native-mixpanel/ @r3nya /types/react-native-modal-dropdown/ @echoulen +/types/react-native-modal-filter-picker/ @ywchang @nossbigg /types/react-native-modalbox/ @iRoachie /types/react-native-multi-slider/ @Slessi /types/react-native-navbar/ @ryokik /types/react-native-orientation/ @MoLow +/types/react-native-percentage-circle/ @hmajid2301 /types/react-native-permissions/ @vincentlanglet /types/react-native-photo-view/ @christianchown /types/react-native-platform-touchable/ @tngranados @@ -4338,6 +4422,7 @@ /types/react-native-sensor-manager/ @SahinVardar /types/react-native-settings-list/ @MrLuje /types/react-native-share/ @marknelissen +/types/react-native-snackbar-component/ @hmajid2301 /types/react-native-snap-carousel/ @jnbt @j-fro @gazaret @GuillaumeAmat @VitorLuizC /types/react-native-sortable-grid/ @j-fro /types/react-native-sortable-list/ @sivolobov @RookY2K @@ -4348,16 +4433,18 @@ /types/react-native-svg-uri/ @iRoachie /types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq /types/react-native-tab-navigator/ @iRoachie -/types/react-native-tab-view/ @kaoDev @iRoachie @timwangdev +/types/react-native-tab-view/ @kaoDev @iRoachie @timwangdev @geriux @kazyk /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/ @hmajid2301 /types/react-native-uuid-generator/ @burtek -/types/react-native-vector-icons/ @iRoachie @timwangdev +/types/react-native-vector-icons/ @iRoachie @timwangdev @robertying /types/react-native-version-number/ @VincentLanglet /types/react-native-video/ @huhuanming +/types/react-native-view-pdf/ @thesergiomiguel /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/ @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 @azrosen92 @hmajid2301 /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-material-bottom-tabs/ @iRoachie @@ -4366,14 +4453,14 @@ /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/ @LKay @surgeboris @NilSet /types/react-onclickoutside/v5/ @LKay /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/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke @sugarshin @SPWizard01 @kevinrambaud +/types/react-paginate/v5/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke @kevinrambaud /types/react-paginate/v4/ @deevus @wouterhardeman @pegel03 @archy-bold /types/react-panelgroup/ @qgolsteyn /types/react-places-autocomplete/ @guilhermehubner @r3nya @ApeNox @azizhk @@ -4391,20 +4478,21 @@ /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/ @tkqubo @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @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-epic/ @forabi /types/react-redux-i18n/ @clementdevos /types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba /types/react-relay/ @graphcool @voxmatt @alloy @npirotte @ckknight @kastermester @mattkrick -/types/react-request/ @dannycochran +/types/react-request/ @dannycochran @angusfretwell @jonathanly +/types/react-resizable/ @airhorns /types/react-resize-detector/ @matthew-matvei @aMoniker @rdrgn /types/react-resolver/ @forabi /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/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter @t49tran @8enSmith @wezleytsai @eps1lon /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-bootstrap/ @vlesierse @LKay @olmobrutall @@ -4421,7 +4509,10 @@ /types/react-rte/ @jclyons52 /types/react-s-alert/ @mitsuruog /types/react-scroll/ @sudoplz @GiedriusGrabauskas +/types/react-scroll-into-view-if-needed/ @angusfretwell @allanpope @jonathanly +/types/react-scrollable-anchor/ @AntoineDoubovetzky /types/react-scrollbar/ @stephenjelfs +/types/react-scrollspy/ @ZhangYiJiang /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 @@ -4441,6 +4532,7 @@ /types/react-sparklines/ @henrinormak /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol /types/react-spinkit/v1/ @tkqubo @mleko @pelotom +/types/react-spinner/ @jakeboone02 /types/react-splitter-layout/ @snaptags /types/react-star-rating-component/ @marpstar /types/react-sticky/ @curtisw0 @ajhyndman @@ -4451,22 +4543,24 @@ /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-swipe/ @DeividasBakanas @AAlakkad +/types/react-swipeable/ @GiedriusGrabauskas @mctep @horiuchi @adambowles /types/react-swipeable-views/ @mxl @DeividasBakanas /types/react-syntax-highlighter/ @NoHomey @ajgamble-milner /types/react-table/ @royxue @psakalo @Havret @andys8 @Gelio /types/react-table-filter/ @gjsln -/types/react-tabs/ @danez @Equationist -/types/react-tag-autocomplete/ @jlismore +/types/react-tabs/ @yu-i9 @danez @Equationist +/types/react-tabs-redux/ @ntnbrtnkv +/types/react-tag-autocomplete/ @jlismore @Rahul-Sagore /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/ @arvitaly @lochbrunner @johnnyreilly @jgoz +/types/react-test-renderer/ @arvitaly @lochbrunner @johnnyreilly @jgoz @Jessidhia /types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly /types/react-tether/ @ryprice /types/react-text-mask/ @guilhermehubner @cavarzan @needpower +/types/react-text-truncate/ @adriantoine /types/react-textarea-autosize/ @asvetliakov @zry656565 /types/react-timeago/ @koss-lebedev /types/react-timeout/ @kerwynrg @@ -4487,25 +4581,25 @@ /types/react-vertical-timeline-component/ @stephane-monnot /types/react-virtual-keyboard/ @bsurai /types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @Stevearzh @mgoszcz2 @brandonhall @sbusch +/types/react-virtualized-auto-sizer/ @otofu-square /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 @georg94 @tzarger +/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz @georg94 @tzarger @vegtelenseg /types/react-widgets-moment/ @dawnmist -/types/react-window/ @martynaskadisa +/types/react-window/ @martynaskadisa @heyimalex @jgoz /types/react-window-size/ @jakejrichards /types/react-wow/ @mikepthomas /types/react-youtube/ @kgtkr @salguerooo /types/react-youtube-embed/ @charles-salmon -/types/reactable/ @spielc +/types/reactable/ @spielc @priscila-moneo /types/reactcss/ @chrisgervang @LKay /types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @timc13 @patrickrgaffney @prabodht @georg94 /types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva /types/read/ @timjk -/types/read-chunk/ @crispybee /types/read-package-tree/ @mgroenhoff -/types/read-pkg/ @jdxcode +/types/read-pkg/ @jdxcode @arichardsmith /types/read-pkg-up/ @dudeofawesome @jdxcode /types/readable-stream/ @TeamworkGuy2 /types/readdir-enhanced/ @mrmlnc @@ -4513,11 +4607,11 @@ /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/rebass/ @rhysd @ryee-dev @jamesmckenzie @gretzky @angusfretwell +/types/rebass__grid/ @antonvasin @vittorio @lhache @lavoaster @autoric @akameco /types/recaptcha2/ @l-jonas /types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow @crusectrl @apalugniok @RobertStigsson @kousaku-maron +/types/recharts/ @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @crusectrl @apalugniok @RobertStigsson @kousaku-maron @iflp /types/recharts-scale/ @johnnyreilly /types/rechoir/ @BendingBender /types/recluster/ @dex4er @@ -4528,7 +4622,7 @@ /types/recursive-readdir/ @elisee @MicahZoltu /types/recursive-readdir/v1/ @elisee /types/redent/ @BendingBender -/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete @blablapolicja @ferrantejake +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete @blablapolicja @ferrantejake @OpesanyaAdebayo /types/redis-errors/ @43081j /types/redis-mock/ @BendingBender /types/redis-rate-limiter/ @westy92 @nodify-at @@ -4539,11 +4633,11 @@ /types/reduce-reducers/ @huy-nguyen @daliusd /types/redux-action/ @newraina /types/redux-action-utils/ @tkqubo -/types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh @7hi4g0 +/types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh @7hi4g0 @oddui /types/redux-async-queue/ @andreiho /types/redux-auth-wrapper/ @LKay /types/redux-auth-wrapper/v1/ @LKay -/types/redux-batched-subscribe/ @mDibyo +/types/redux-batched-subscribe/ @mDibyo @azizhk /types/redux-debounced/ @seansfkelley /types/redux-devtools/ @mc-petry /types/redux-devtools-dock-monitor/ @mc-petry @@ -4553,7 +4647,8 @@ /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/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun @mshaaban088 @esetnik @bwlt @mrsekut +/types/redux-form/v7/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun @mshaaban088 @esetnik /types/redux-form/v6/ @carsonf @aikoven @LKay @bancek @mshaaban088 /types/redux-form/v4/ @aikoven /types/redux-immutable/ @oizie @sebald @gavingregory @lukyth @@ -4577,6 +4672,7 @@ /types/redux-recycle/ @LKay /types/redux-router/ @stepancar /types/redux-saga-tester/ @BenLorantfy @lawsumisu +/types/redux-seamless-immutable/ @SoaresMG /types/redux-sentry-middleware/ @dolezel /types/redux-shortcuts/ @tstirrat /types/redux-socket.io/ @snakeego @@ -4606,8 +4702,12 @@ /types/remarkable/ @makepost @chigix /types/remote-origin-url/ @BendingBender /types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker +/types/remotedev-serialize/ @jaulz /types/remove-markdown/ @RagibHasin /types/rename/ @Aankhen +/types/repeat-element/ @adamzerella +/types/repeat-string/ @adamzerella +/types/repeating/ @claasahl /types/replace-ext/ @DeividasBakanas /types/replace-string/ @BendingBender /types/replacestream/ @dex4er @@ -4628,13 +4728,16 @@ /types/requirejs-domready/ @lefb766 /types/requires-port/ @BendingBender /types/resemblejs/ @pimterry +/types/reserved-words/ @skovy /types/reservoir/ @danvk /types/resize-img/ @higuri +/types/resize-observer-browser/ @chivesrs /types/resolve/ @marionebl @ajafff /types/resolve-cwd/ @BendingBender /types/resolve-from/ @unional @BendingBender /types/resolve-from/v2/ @unional /types/resolve-global/ @BendingBender +/types/resolve-options/ @delprzemo /types/resolve-pkg/ @mabels @BendingBender /types/resourcejs/ @shaunluttin /types/response-time/ @urossmolnik @TonyPythoneer @danmana @@ -4652,8 +4755,9 @@ /types/restler/ @cyrilschumacher /types/restling/ @loghorn /types/restore-cursor/ @BendingBender -/types/resumablejs/ @DanielMcAssey +/types/resumablejs/ @DanielMcAssey @Johns3n /types/rethinkdb/ @alexgorbatchev @AdrianFarmadin @kondi @hoishin +/types/retinajs/ @senjyouhara /types/retry/ @krenor @BendingBender /types/retry-as-promised/ @Raigen /types/rev-hash/ @ikatyang @@ -4666,6 +4770,7 @@ /types/rgrove__parse-xml/ @petejohanson /types/rheostat/ @SashaBayan @kourge @StefanWerW /types/rickshaw/ @niemyjski +/types/right-align/ @claasahl /types/rimraf/ @soywiz @e-cloud @bash /types/riot/ @Stubb0rn /types/riot-api-nodejs/ @zafixlrp @@ -4681,9 +4786,11 @@ /types/rn-fetch-blob/ @pengcao1 /types/roads/ @dancespiele /types/roads-server/ @dancespiele +/types/roarr/ @psaxton /types/rocksdb/ @MeirionHughes @danwbyrne /types/roll/ @icopp /types/rolling-rate-limiter/ @l-jonas +/types/rollup-plugin-buble/ @Kocal /types/rollup-plugin-commonjs/ @eoin-obrien /types/rollup-plugin-delete/ @vladshcherbin /types/rollup-plugin-json/ @asmockler @hotell @@ -4699,6 +4806,7 @@ /types/round-to/ @seangenabe /types/route-parser/ @ianks @bobbuehler /types/routie/ @Adilson +/types/rox-react-native/ @ahanriat /types/royalslider/ @csrakowski @sKopheK /types/rpio/ @DominikPalo @Pencl /types/rrc/ @DeividasBakanas @@ -4707,6 +4815,8 @@ /types/rss/ @secondwtq /types/rsvp/ @chriskrycho /types/rsync/ @philippstucki +/types/rtl-detect/ @imprevo +/types/rtlcss/ @adamzerella /types/rtree/ @oefirouz /types/run-parallel/ @mrmlnc /types/run-parallel-limit/ @mrmlnc @@ -4747,7 +4857,7 @@ /types/sane/ @BendingBender /types/sane-email-validation/ @ForbesLindesay /types/sanitize-filename/ @Nemo157 -/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester @WillGibson @sirMerr +/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester @WillGibson @sirMerr @johandavidson /types/sap__xsenv/ @mad-mike /types/sarif/ @rscrivens /types/sasl-anonymous/ @BendingBender @@ -4763,6 +4873,7 @@ /types/sat/ @omni360 /types/satnav/ @DotNetNerd /types/saywhen/ @SeanSobey +/types/sbd/ @thatcort /types/sc-auth/ @DanielRose /types/sc-broker/ @DanielRose /types/sc-broker-cluster/ @DanielRose @@ -4776,13 +4887,14 @@ /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 @dmarcuse /types/screeps-profiler/ @ramblurr /types/script-ext-html-webpack-plugin/ @davecardwell /types/scriptjs/ @ssttevee /types/scroll-into-view/ @zivni +/types/scroll-to-element/ @kirillurgant /types/scroller/ @haskellcamargo +/types/scrollparent/ @Sintifo /types/scrollreveal/ @Davidblkx /types/scrolltofixed/ @bmdixon /types/scrypt/ @WhiteAbeLincoln @@ -4797,7 +4909,8 @@ /types/secp256k1/ @anler /types/seed-random/ @l-jonas /types/seededshuffle/ @urish -/types/seedrandom/ @kernhanda +/types/seedrandom/ @kernhanda @EugeneZ +/types/seen/ @admvx /types/segment-analytics/ @fongandrew /types/select2/ @borisyankov @denisname /types/select2/v3/ @borisyankov @@ -4805,6 +4918,7 @@ /types/selectize/ @adidahiya @naBausch /types/selenium-standalone/ @SanderDeWaal1992 /types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn @oddui +/types/selenium-webdriver/v3/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn @oddui /types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina /types/semantic-release/ @lgaticaq /types/semantic-ui/ @leonard-thieu @@ -4829,7 +4943,7 @@ /types/semantic-ui-transition/ @leonard-thieu /types/semantic-ui-visibility/ @leonard-thieu /types/semaphore/ @mhfrantz @Alorel -/types/semver/ @Bartvds @BendingBender @LucianBuzzo +/types/semver/ @Bartvds @BendingBender @LucianBuzzo @ajafff /types/semver-compare/ @vincekovacs /types/semver-diff/ @chrismbarr /types/semver-regex/ @BendingBender @@ -4837,6 +4951,7 @@ /types/semver-truncate/ @BendingBender /types/sencha_touch/ @brian428 /types/send/ @MikeJerred +/types/sendmail/ @saostad /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 @@ -4846,7 +4961,7 @@ /types/sequester/ @Strate /types/serialize-error/ @thomasthiebaud /types/serialize-javascript/ @lith-light-g @Pochodaydayup -/types/serialport/ @codefoster @apearson +/types/serialport/ @codefoster @apearson @cinderblock /types/serialport/v6/ @codefoster @apearson /types/serialport/v4/ @codefoster /types/serve-favicon/ @urossmolnik @@ -4854,7 +4969,7 @@ /types/serve-static/ @urossmolnik @LinusU /types/server/ @sant123 @iddan /types/server-destroy/ @gyszalai -/types/serverless/ @hassankhan +/types/serverless/ @hassankhan @JonathanWilbur /types/servicenow/ @bryceg /types/session-file-store/ @blendsdk @rokt33r /types/set-cookie-parser/ @nickp10 @ilyaztsv @@ -4866,10 +4981,10 @@ /types/sha1/ @arcdev1 /types/sha256/ @nhardy /types/shallow-equals/ @rsolomon -/types/shallowequal/ @seansfkelley @BendingBender +/types/shallowequal/ @seansfkelley @BendingBender @arndissler /types/shallowequal/v0/ @seansfkelley /types/shapefile/ @DenisCarriere @Thw0rted -/types/sharedb/ @soney +/types/sharedb/ @soney @ericyhwang /types/sharedworker/ @nakakura /types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg /types/sharp/ @lith-light-g @wooseopkim @BTOdell @JamieWoodbury @@ -4879,10 +4994,10 @@ /types/sheetify/ @toddself /types/shell-escape/ @nenadalm /types/shell-quote/ @jason0x43 @CameronDiver -/types/shelljs/ @nikeee @voy @gkalpak @pheromonez @aldafu +/types/shelljs/ @nikeee @voy @gkalpak @pheromonez @aldafu @ExE-Boss /types/shelljs-exec-proxy/ @qlonik /types/shimmer/ @kjin -/types/shipit/ @cyrilschumacher +/types/shipit-cli/ @cyrilschumacher /types/shipit-utils/ @cyrilschumacher /types/shopify-buy/ @openminder @straiforos @totemika /types/shorten-repo-url/ @BendingBender @@ -4921,15 +5036,13 @@ /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 @chrisdopuch -/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski @johnjesse @alecf @SimonSchick +/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski @johnjesse @alecf @SimonSchick @bergundy /types/sinon-as-promised/ @igrayson /types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt /types/sinon-chai/v2/ @kazimanzurrashid @jedmao @@ -4944,7 +5057,7 @@ /types/sizzle/ @leonard-thieu /types/sjcl/ @Evgenus /types/skatejs/ @Hotell -/types/sketchapp/ @manekinekko +/types/sketchapp/ @manekinekko @shikanime /types/ski/ @AyaMorisawa /types/skin-tone/ @BendingBender /types/skyway/ @nakakura @izmhr @@ -4954,18 +5067,20 @@ /types/slackdown/ @nju33 /types/slackify-html/ @hypexr /types/slash/ @BendingBender -/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil @isubasti @sgreav +/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil @isubasti @sgreav @jackall3n @benjiro /types/slate-base64-serializer/ @YangusKhan /types/slate-html-serializer/ @YangusKhan /types/slate-irc/ @elisee /types/slate-plain-serializer/ @YangusKhan @mkiefel -/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav @Kornil +/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav @Kornil @jackall3n @benjiro /types/sleep/ @rajarz /types/slice-ansi/ @dwieeb +/types/slick-carousel/ @Kocal /types/slickgrid/ @jbaldwin /types/slideout/ @ToastHawaii /types/slimerjs/ @alexwall /types/slocket/ @BendingBender +/types/slonik/ @sebald /types/slug/ @mhegazy /types/smart-fox-server/ @ChanceM /types/smart-truncate/ @oyalhi @@ -4982,6 +5097,8 @@ /types/snoowrap/ @vitosamson @TheAppleFreak @willwull /types/snowball-stemmers/ @ryanvolum /types/snowboy/ @dolanmiu +/types/sns-validator/ @kevin68 +/types/sntp/ @adamzerella /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 @@ -4998,7 +5115,7 @@ /types/socketty/ @Nax /types/sockjs/ @pmccloghrylaing /types/sockjs-client/ @vladev @arusakov @BendingBender @renjfk -/types/solidity-parser-antlr/ @LogvinovLeon @albrow +/types/solidity-parser-antlr/ @LogvinovLeon @albrow @yxliang01 /types/solr-client/ @liul85 /types/solution-center-communicator/ @dami-gg /types/sonic-boom/ @alferpal @@ -5008,7 +5125,7 @@ /types/soundmanager2/ @elton2048 /types/soupbintcp/ @jewbre /types/source-list-map/ @e-cloud -/types/source-map-support/ @Bartvds @jason0x43 +/types/source-map-support/ @Bartvds @jason0x43 @natealcedo /types/space-pen/ @vvakame /types/spark-md5/ @bastienmoulia /types/sparkly/ @BendingBender @@ -5024,13 +5141,14 @@ /types/speakingurl/ @Goldsmith42 /types/spected/ @benneq /types/spectrum/ @M-Zuber @Ailrun +/types/spellchecker/ @dalevfenton /types/split/ @marcinporebski /types/split.js/ @icholy /types/split2/ @mugeso /types/splunk-bunyan-logger/ @bricka /types/splunk-logging/ @bricka /types/spotify-api/ @skovmand -/types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends +/types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends @deini /types/sprintf/ @soywiz @BendingBender /types/sprintf-js/ @jasonswearingen @BendingBender @cdagli /types/sql-bricks/ @adn05 @paleo @@ -5047,6 +5165,7 @@ /types/ssh2-sftp-client/ @igrayson @ascariandrea @kartik2406 @viamuli /types/ssh2-streams/ @rbuckton /types/sshpk/ @mabels +/types/ssri/ @huan086 /types/stack-mapper/ @rogierschouten /types/stack-trace/ @exceptionless /types/stack-utils/ @BendingBender @@ -5084,17 +5203,19 @@ /types/storybook__addon-actions/ @joscha @jicjjang /types/storybook__addon-backgrounds/ @hyunseob @adhrinae /types/storybook__addon-centered/ @kiyopikko -/types/storybook__addon-info/ @mkornblum @fyrkant +/types/storybook__addon-info/ @mkornblum @fyrkant @RunningCoderLee /types/storybook__addon-jest/ @halfmatthalfcat -/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay @MLoughry +/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay @MLoughry @alanhchoi /types/storybook__addon-links/ @joscha @jessepinho -/types/storybook__addon-notes/ @joscha @amacleay @MLoughry /types/storybook__addon-options/ @joscha @simonhn @amacleay @gaetanmaisse @adam187 /types/storybook__addon-storyshots/ @bradleyayers /types/storybook__addon-viewport/ @Vinnl +/types/storybook__addons/ @bmatcuk +/types/storybook__channels/ @bmatcuk +/types/storybook__preact/ @9renpoto /types/storybook__react/ @joscha @wapgear @dandean /types/storybook__react-native/ @joscha @wapgear @alechill @iRoachie @ceyhuno -/types/storybook__vue/ @pntgupta +/types/storybook__vue/ @pntgupta @jurgisrudaks @yoyoys /types/strange/ @wanganjun /types/stream-array/ @Tyler-Murphy /types/stream-buffers/ @Jason3S @@ -5103,6 +5224,7 @@ /types/stream-each/ @djcsdy /types/stream-json/ @uhop /types/stream-meter/ @mugeso +/types/stream-mock/ @ivank /types/stream-series/ @k-kagurazaka /types/stream-shift/ @djcsdy /types/stream-throttle/ @danwbyrne @@ -5133,24 +5255,25 @@ /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 @ifiokjr @SimonSchick @yultyyev @cpsoinos +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger @ifiokjr @SimonSchick @yultyyev @cpsoinos @adamduren @saranshkataria @0xJoKe @delianides /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @slangeder +/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @slangeder @marlosin /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/strophejs-plugin-roster/ @LeartS /types/structured-source/ @azu -/types/styled-components/ @Igorbek @Igmat @lavoaster @Jessidhia +/types/styled-components/ @Igorbek @Igmat @lavoaster @Jessidhia @jkillian @eps1lon @flavordaaave /types/styled-components/v3/ @Igorbek @Igmat /types/styled-jsx/ @R1ZZU /types/styled-react-modal/ @Lavoaster -/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster @jschuler @adam187 @gretzky +/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster @jschuler @adam187 @gretzky @chrislopresto /types/styled-theming/ @ArjanJ -/types/stylelint/ @alan-agius4 @filipsalpe +/types/stylelint/ @alan-agius4 @filipsalpe @43081j /types/stylelint/v7/ @alan-agius4 /types/stylelint-webpack-plugin/ @bahlo /types/stylenames/ @bengry @@ -5165,12 +5288,13 @@ /types/summernote/ @wstaelens @nusantara-cloud /types/sumo-logger/ @forabi @clementallen /types/suncalc/ @horiuchi -/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @beeequeue @lukaselmer +/types/sunrise-sunset-js/ @hmajid2301 +/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @beeequeue @lukaselmer @theQuazz /types/superagent/v2/ @varju @NicoZelaya @mxl /types/superagent-bunyan/ @bricka /types/superagent-no-cache/ @mxl /types/superagent-prefix/ @mxl -/types/supercluster/ @DenisCarriere +/types/supercluster/ @DenisCarriere @Manc /types/superstruct/ @edwardsnare /types/supertest/ @varju @pietu /types/supertest-as-promised/ @tkrotoff @@ -5183,7 +5307,7 @@ /types/svg-sprite/ @tkqubo /types/svg-sprite-loader/ @rynclark /types/svg2png/ @hansrwindhoff @sccgithub -/types/svg4everybody/ @BendingBender +/types/svg4everybody/ @BendingBender @bryceosterhaus /types/svgjs.draggable/ @LiFeleSs /types/svgjs.resize/ @jkevingutierrez /types/svgo/ @bradleyayers @giladgray @Aankhen @@ -5225,22 +5349,25 @@ /types/table/ @evanshortiss @mrmlnc /types/tableau/ @protip /types/tableify/ @forivall -/types/tabris-plugin-firebase/ @eclipsesource /types/tabtab/ @vojtechhabarta @kamontat /types/tabulator/ @euginio +/types/tabulator-tables/ @jojoshua /types/tail/ @spacejack +/types/tampermonkey/ @silverwzw @nikolay-borzov /types/tapable/ @e-cloud @johnnyreilly /types/tapable/v0/ @e-cloud /types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty @rostrowski +/types/tape-async/ @ExE-Boss /types/tar/ @SomaticIT @connor4312 /types/tar-fs/ @Umoxfo /types/tar-stream/ @glicht +/types/tarantool-driver/ @zharkov-eu /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/ @rogierschouten @cjthompson @v-suhame @guiampm /types/tedious-connection-pool/ @sandorfr /types/telebot/ @mariotsi /types/temp/ @DanielRosenwasser @@ -5254,7 +5381,6 @@ /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 @@ -5274,14 +5400,15 @@ /types/texzilla/ @m93a /types/tgfancy/ @Dabolus /types/theming/ @eps1lon -/types/theo/ @petekp +/types/then-eos/ @seangenabe +/types/theo/ @petekp @laitine /types/thepiratebay/ @jsorrell -/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/ @gyohk @florentpoujol @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @Pro @efokschaner @PsychoSTS @apurvaojas @NotWoods @Methuselah96 @Dukuo @JulianSSS @devilsparta @KonstantinLukaschenko @danyim @saranshkataria @psuter /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/throttle-debounce/ @czbuchi @franklixuefei @oddsund /types/through/ @AndrewGaspar /types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 @Alorel /types/through2/v0/ @Bartvds @jedmao @@ -5290,7 +5417,6 @@ /types/tildify/ @BendingBender /types/tile-reduce/ @DenisCarriere /types/tilebelt/ @DenisCarriere -/types/time-span/ @BendingBender @mdvorscak /types/timelinejs/ @rolandzwaga /types/timelinejs3/ @MikeMatusz /types/timer-machine/ @dolanmiu @@ -5305,14 +5431,15 @@ /types/tiny-secp256k1/ @eduhenke /types/tiny-slider-react/ @screendriver /types/tinycolor2/ @M-Zuber @geertjansen @nvh @Ailrun -/types/tinycon/ @dwaxweiler +/types/tinycon/ @dwaxweiler @jaulz /types/tinycopy/ @vvatanabe /types/tinymce/ @martinduparc @ipoul @nicohartto /types/titanium/ @appcelerator @janvennemann /types/title/ @fa7ad /types/tldjs/ @geoffreak /types/tlds/ @ajshres -/types/tmp/ @optical @Perlmint +/types/tmi.js/ @wpapsco +/types/tmp/ @optical @Perlmint @pluma /types/to-absolute-glob/ @ajafff /types/to-camel-case/ @j-f1 /types/to-markdown/ @SuperPaintman @@ -5321,12 +5448,14 @@ /types/to-title-case-gouch/ @stpettersens /types/toastr/ @borisyankov /types/tocktimer/ @evanshortiss +/types/tokenizr/ @aNickzz /types/tokgen/ @l-jonas /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-server/ @ricardo-mello @chenzhutian @denisname @russellporter /types/topojson-simplify/ @denisname @ricardo-mello /types/topojson-specification/ @denisname /types/toposort/ @danwbyrne @@ -5335,13 +5464,13 @@ /types/touch/ @mizunashi-mana @BendingBender /types/touch-events/ @kevinb7 /types/tough-cookie/ @leonard-thieu @LiJinyao @no2chem +/types/tough-cookie-file-store/ @forivall /types/tough-cookie-filestore/ @friedow /types/traceback/ @misak113 /types/tracking/ @pimterry @bratter /types/transducers-js/ @colinkahn @dphilipson @NaridaL /types/transducers.js/ @dphilipson /types/transliteration/ @tony19 -/types/trash/ @matthew-matvei @hoishin @BendingBender /types/traverse/ @newclear /types/traverson/ @marcinporebski /types/travis-fold/ @andy-ms @@ -5352,15 +5481,19 @@ /types/trianglify/ @unindented /types/trie-prefix-tree/ @jlismore /types/trim/ @skysteve +/types/trim-newlines/ @djcsdy /types/triple-beam/ @danwbyrne /types/triplesec/ @threesquared +/types/trouter/ @stahlstift /types/trunk8/ @niemyjski -/types/trusted-types/ @vrana +/types/trusted-types/ @vrana @engelsdamien /types/tryer/ @bengry /types/ts-nameof/ @dsherret /types/tspromise/ @soywiz /types/ttf2woff2/ @ThomasdenH /types/tunnel/ @BendingBender +/types/turbolinks/ @evankim390 +/types/turndown/ @sergey-zhidkov /types/tus-js-client/ @kevhiggins @Acconut /types/tv4/ @Bartvds @psnider /types/tween.js/ @Amos47 @sunetos @jzarnikov @alexburner @@ -5369,9 +5502,9 @@ /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/twilio-video/ @minddocdev @darioblanco @ktsn +/types/twit/ @Volox @sapphiredev @abraham @siwalikm @plhery @justgoscha +/types/twitch-ext/ @beheh @FedeDR /types/twitter/ @BendingBender /types/twitter-for-web/ @chitoku-k /types/twitter-stream-channels/ @adrianbardan @@ -5390,6 +5523,7 @@ /types/typography/ @boyeborg @krzysztofzuraw @dominicfallows /types/typpy/ @BendingBender /types/tz-format/ @samverschueren +/types/tz-offset/ @RMHonor /types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo /types/ua-string/ @BendingBender /types/uglify-es/ @alan-agius4 @@ -5414,10 +5548,13 @@ /types/underscore.string/ @rygine /types/undertaker/ @tkqubo @GiedriusGrabauskas /types/undertaker-registry/ @GiedriusGrabauskas +/types/ungap__url-search-params/ @nick121212 @nrathi +/types/uni-app/ @dcloudio /types/unidecode/ @vfernandestoptal /types/uniq/ @hansrwindhoff /types/uniqid/ @idchlife /types/unique-hash-stream/ @BendingBender +/types/unique-push-id/ @namick /types/unique-random/ @Kuniwak /types/unique-random-array/ @BendingBender /types/unique-string/ @BendingBender @@ -5427,8 +5564,8 @@ /types/universal-analytics/ @Bartvds @DarkerTV /types/universal-cookie/ @tomi /types/unorm/ @chbrown +/types/unsplash-js/ @markupcode /types/untildify/ @BendingBender -/types/unused-filename/ @BendingBender /types/unzip/ @coding2012 /types/unzipper/ @s73obrien @natemara @bartje321 /types/update-notifier/ @vvakame @nchen63 @bitjson @grinich @@ -5458,14 +5595,20 @@ /types/urlsafe-base64/ @tkrotoff /types/usage/ @pvomhoff /types/usb/ @underscorebrody @thegecko +/types/use-persisted-state/ @karol-majewski +/types/use-set-interval/ @screendriver +/types/use-set-timeout/ @screendriver /types/user-event/ @whtsky /types/user-home/ @mhegazy /types/useragent/ @geoffreak /types/username/ @kayahr @krivachy +/types/uslug/ @rokt33r /types/utf8/ @zelein +/types/utif/ @smajl @nkprince007 @massic80 /types/util-deprecate/ @BendingBender /types/util.promisify/ @adamvoss /types/utils-merge/ @chrootsu +/types/utm/ @civilizeddev /types/uuid/ @iamolivinius @felipeochoa @cjbarth /types/uuid-1345/ @mugeso /types/uuid-js/ @mhegazy @@ -5481,13 +5624,15 @@ /types/vali-date/ @SamVerschueren /types/valiant/ @whatasoda /types/valid-url/ @stevehipwell -/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya @qqilihq +/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya @qqilihq @keatz55 /types/validatorjs/ @LKay @danmana @MatiasOlivera /types/vanilla-modal/ @samnau /types/vanilla-tilt/ @BrunnerLivio +/types/vara/ @Chnapy /types/varint/ @dbrockman /types/vary/ @BendingBender /types/vast-client/ @jgainfort @kobawan +/types/vec2/ @Nielio /types/vec3/ @xstoudi /types/vectorious/ @erikgerrits /types/velocity-animate/ @smrq @@ -5496,14 +5641,15 @@ /types/vertx3-eventbus-client/ @oddeirik /types/vex-js/ @gdcohan /types/vexdb/ @MayorMonty -/types/vexflow/ @rquiring @sebastianhaas @bohoffi @sschmidTU +/types/vexflow/ @rquiring @sebastianhaas @bohoffi @sschmidTU @bneumann /types/vfile/ @bizen241 @rokt33r /types/vfile-location/ @ikatyang @rokt33r /types/vfile-message/ @rokt33r -/types/victory/ @asvetliakov @snerks @Havret @alredyExist @jlismore +/types/victory/ @asvetliakov @snerks @Havret @allreadyExisted @jlismore @stackbuilders @ibarrae /types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray @AkxeOne @meikidd /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 +/types/viewport-list/ @satyarohith /types/viewport-mercator-project/ @fnberta /types/viewporter/ @borisyankov /types/vimeo/ @DazWilkin @@ -5529,8 +5675,11 @@ /types/voronoi-diagram/ @michaelneu /types/vorpal/ @danwbyrne /types/vortex-web-client/ @Pro +/types/voucher-code-generator/ @JWebCoder /types/voximplant-websdk/ @aylarov -/types/vue-color/ @me +/types/vscode/ @Microsoft +/types/vue-chartkick/ @cnsmedia +/types/vue-color/ @mildful /types/vue-markdown/ @neodon /types/vue-resource/ @kaorun343 /types/vue-scrollto/ @vincekovacs @@ -5544,14 +5693,13 @@ /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/w3c-web-usb/ @larsgk @thegecko +/types/wait-on/ @ifiokjr /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 /types/watch/ @soywiz @Perlmint @@ -5572,7 +5720,7 @@ /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/webappsec-credential-management/ @iainmcgin @Hartimer /types/webassembly-js-api/ @periklis @chicoxyzzy /types/webassembly-web-api/ @jhenninger /types/webcl/ @NCARalph @@ -5583,7 +5731,7 @@ /types/webgl2/ @nkemnitz @karhu /types/webidl2/ @saschanaz /types/webmidi/ @lostfictions -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein @grgur +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein @grgur @rubenspgcavalcante /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 @@ -5593,7 +5741,7 @@ /types/webpack-config-utils/ @hotell /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-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 @arturovt @davecardwell /types/webpack-dotenv-plugin/ @kryops /types/webpack-env/ @use-strict @rhonsby /types/webpack-fail-plugin/ @deevus @@ -5604,12 +5752,14 @@ /types/webpack-merge/v0/ @deevus /types/webpack-node-externals/ @mtraynham /types/webpack-notifier/ @bumbleblym +/types/webpack-plugin-serve/ @PlayMa256 /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/webpack-watched-glob-entries-plugin/ @ChaosinaCan /types/webpackbar/ @rynclark /types/webpagetest/ @ksm2 /types/webprogbase-console-view/ @veetaha @@ -5660,12 +5810,17 @@ /types/wiring-pi/ @NoHomey /types/wnumb/ @acoreyj /types/wonder.js/ @yyc-git +/types/word-extractor/ @saboya /types/word-list-json/ @dovidm +/types/word-wrap/ @claasahl /types/word2vector/ @renekeijzer /types/wordcloud/ @joeskeen +/types/wordpress__jest-console/ @mistic100 /types/words-to-numbers/ @James-Frowen +/types/wordwrap/ @ark120202 /types/workbox-sw/ @wessberg /types/workbox-webpack-plugin/ @kgroat +/types/workbox-webpack-plugin/v3/ @kgroat /types/worker-threads-pool/ @BendingBender /types/workerpool/ @Alorel /types/wpapi/ @guoyunhe @@ -5689,9 +5844,9 @@ /types/xdg-basedir/ @tlaziuk /types/xml/ @YuJianrong /types/xml-parser/ @mhfrantz -/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl +/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl @redlickigrzegorz /types/xml2json/ @dolanmiu -/types/xmlbuilder/ @wallymathieu +/types/xmlbuilder/ @wallymathieu @GaikwadPratik /types/xmldoc/ @Xstoudi @ajsheehan @notlaforge /types/xmldom/ @tkqubo /types/xmlpoke/ @garthk @@ -5711,7 +5866,7 @@ /types/yandex-maps/ @Delagen @gastwork13 /types/yandex-money-sdk/ @chrootsu /types/yar/ @SimonSchick -/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC @steffenvv +/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC @steffenvv @forivall /types/yargs/v11/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC /types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC /types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney @@ -5724,7 +5879,7 @@ /types/ydn-db/ @yathit @gabrielmaldi /types/year-days/ @BendingBender /types/yeoman-assert/ @Toilal -/types/yeoman-generator/ @armorik83 @janslow @ikatyang @tasadar2 +/types/yeoman-generator/ @armorik83 @janslow @ikatyang @tasadar2 @haggen @chigix /types/yeoman-test/ @ikatyang /types/yesql/ @Sumolari /types/yn/ @BendingBender @@ -5736,10 +5891,11 @@ /types/yosay/ @armorik83 /types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 @terrymun @paulhobbel /types/youtube-dl/ @bsurai @moshfeu +/types/youtube-player/ @jurca /types/yui/ @giabao /types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola @YashdalfTheGray @vincentjames501 @robertbullen @sat0yu @dancrumb /types/z-schema/ @pgonzal -/types/zapier-platform-core/ @bradleyayers +/types/zeit__next-source-maps/ @ldthorne /types/zeit__next-typescript/ @icopp /types/zen-observable/ @aicest @JounQin @itomtom /types/zen-push/ @daprahamian diff --git a/.travis.yml b/.travis.yml index 9bd31bda14..6ea69355da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,9 @@ language: node_js node_js: - 8 -sudo: false - notifications: email: false + +script: + - npm run test + - if [[ $TRAVIS_EVENT_TYPE == "cron" ]]; then npm run update-codeowners || travis_terminate 1; fi \ No newline at end of file diff --git a/README.es.md b/README.es.md index df675cbe41..4ba1be28fc 100644 --- a/README.es.md +++ b/README.es.md @@ -332,5 +332,3 @@ Es más apropiado importar este módulo utilizando la sintaxis `import foo = req Este proyecto es licenciado bajo la licencia MIT. Los derechos de autor de cada archivo de definición son respectivos de cada contribuidor listado al comienzo de cada archivo de definición. - -[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) diff --git a/README.ko.md b/README.ko.md index 224967a9dc..4314ccdc71 100644 --- a/README.ko.md +++ b/README.ko.md @@ -334,5 +334,3 @@ NPM 패키지의 경우, `node -p 'require("foo")'` 가 원하는 값이라면 ` 이 프로젝트는 MIT license 가 적용되어 있습니다. 각 자료형 정의(Type definition) 파일들의 저작권은 각 기여자들에게 있으며, 기여자들은 해당 자료형 정의(Type definition) 파일들의 맨 위에 나열되어 있습니다. - -[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) diff --git a/README.md b/README.md index 746d9d9f3e..27dbbd1638 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ You may need to add manual [references](http://www.typescriptlang.org/docs/handb ## How can I contribute? -DefinitelyTyped only works because of contributions by users like you! +Definitely Typed only works because of contributions by users like you! ### Test @@ -89,7 +89,7 @@ then follow the instructions to [edit an existing package](#edit-an-existing-pac ### Make a pull request -Once you've tested your package, you can share it on DefinitelyTyped. +Once you've tested your package, you can share it on Definitely Typed. First, [fork](https://guides.github.com/activities/forking/) this repository, install [node](https://nodejs.org/), and run `npm install`. @@ -117,7 +117,7 @@ If it doesn't, you can do so yourself in the comment associated with the PR. #### Create a new package -If you are the library author and your package is written in TypeScript, [bundle the autogenerated declaration files](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) in your package instead of publishing to DefinitelyTyped. +If you are the library author and your package is written in TypeScript, [bundle the autogenerated declaration files](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) in your package instead of publishing to Definitely Typed. If you are adding typings for an NPM package, create a directory with the same name. If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM. @@ -137,7 +137,7 @@ See all options at [dts-gen](https://github.com/Microsoft/dts-gen). You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option. -DefinitelyTyped members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down. +Definitely Typed members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down. For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). @@ -165,18 +165,31 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D #### Removing a package -When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own types, types should be removed from DefinitelyTyped to avoid confusion. +When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own types, types should be removed from Definitely Typed to avoid confusion. You can remove it by running `npm run not-needed -- typingsPackageName asOfVersion sourceRepoURL [libraryName]`. - `typingsPackageName`: This is the name of the directory to delete. -- `asOfVersion`: A stub will be published to `@types/foo` with this version. Should be higher than any currently published version. +- `asOfVersion`: A stub will be published to `@types/foo` with this version. Should be higher than any currently published version, and should be a version of `foo` on npm. - `sourceRepoURL`: This should point to the repository that contains the typings. -- `libraryName`: Descriptive name of the library, e.g. "Angular 2" instead of "angular2". (If ommitted, will be identical to "typingsPackageName".) +- `libraryName`: Name of npm package that replaces the Definitely Typed types. Usually this is identical to "typingsPackageName", in which case you can omit it. -Any other packages in DefinitelyTyped that referenced the deleted package should be updated to reference the bundled types. To do this, add a `package.json` with `"dependencies": { "foo": "x.y.z" }`. +Any other packages in Definitely Typed that referenced the deleted package should be updated to reference the bundled types. +You can get this list by looking at the errors from `npm run test`. +To fix the errors, add a `package.json` with `"dependencies": { "foo": "x.y.z" }`. +For example: -If a package was never on DefinitelyTyped, it does not need to be added to `notNeededPackages.json`. +```json +{ + "private": true, + "dependencies": { + "foo": "^2.6.0" + } +} +``` +When you add a `package.json` to dependents of `foo`, you will also need to open a PR to add `foo` [to dependenciesWhitelist.txt in types-publisher](https://github.com/Microsoft/types-publisher/blob/master/dependenciesWhitelist.txt). + +If a package was never on Definitely Typed, it does not need to be added to `notNeededPackages.json`. #### Lint @@ -225,11 +238,11 @@ The `master` branch is automatically published to the `@types` scope on NPM than #### I've submitted a pull request. How long until it is merged? -It depends, but most pull requests will be merged within a week. PRs that have been approved by an author listed in the definition's header are usually merged more quickly; PRs for new definitions will take more time as they require more review from maintainers. Each PR is reviewed by a TypeScript or DefinitelyTyped team member before being merged, so please be patient as human factors may cause delays. Check the [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) to see progress as maintainers work through the open PRs. +It depends, but most pull requests will be merged within a week. PRs that have been approved by an author listed in the definition's header are usually merged more quickly; PRs for new definitions will take more time as they require more review from maintainers. Each PR is reviewed by a TypeScript or Definitely Typed team member before being merged, so please be patient as human factors may cause delays. Check the [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) to see progress as maintainers work through the open PRs. #### My PR is merged; when will the `@types` NPM package be updated? -NPM packages should update within a few minutes. If it's been more than an hour, mention the PR number on [the DefinitelyTyped Gitter channel](https://gitter.im/DefinitelyTyped/DefinitelyTyped) and the current maintainer will get the correct team member to investigate. +NPM packages should update within a few minutes. If it's been more than an hour, mention the PR number on [the Definitely Typed Gitter channel](https://gitter.im/DefinitelyTyped/DefinitelyTyped) and the current maintainer will get the correct team member to investigate. #### I'm writing a definition that depends on another definition. Should I use `` or an import? @@ -325,13 +338,13 @@ You can look [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast This may belong in [TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme). See the guidelines there. If the standard is still a draft, it belongs here. Use a name beginning with `dom-` and include a link to the standard as the "Project" link in the header. -When it graduates draft mode, we may remove it from DefinitelyTyped and deprecate the associated `@types` package. +When it graduates draft mode, we may remove it from Definitely Typed and deprecate the associated `@types` package. -#### How do DefinitelyTyped package versions relate to versions of the corresponding library? +#### How do Definitely Typed package versions relate to versions of the corresponding library? _NOTE: The discussion in this section assumes familiarity with [Semantic versioning](https://semver.org/)_ -Each DefinitelyTyped package is versioned when published to NPM. +Each Definitely Typed package is versioned when published to NPM. The [types-publisher](https://github.com/Microsoft/types-publisher) (the tool that publishes `@types` packages to npm) will set the declaration package's version by using the `major.minor` version number listed in the first line of its `index.d.ts` file. For example, here are the first few lines of [Node's type declarations](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1253faabf5e0d2c5470db6ea87795d7f96fef7e2/types/node/index.d.ts) for version `10.12.x` at the time of writing: @@ -339,24 +352,24 @@ For example, here are the first few lines of [Node's type declarations](https:// // Type definitions for Node.js 10.12 // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript -// DefinitelyTyped +// Definitely Typed // Alberto Schiabel ``` Because `10.12` is at the end the first line, the npm version of the `@types/node` package will also be `10.12.x`. Note that the first-line comment in the `index.d.ts` file should only contain the `major.minor` version (e.g. `10.12`) and should not contain a patch version (e.g. `10.12.4`). This is because only the major and minor release numbers are aligned between library packages and type declaration packages. -The patch release number of the type declaration package (e.g. `.0` in `10.12.0`) is initialized to zero by DefinitelyTyped and is incremented each time a new `@types/node` package is published to NPM for the same major/minor version of the corresponding library. +The patch release number of the type declaration package (e.g. `.0` in `10.12.0`) is initialized to zero by Definitely Typed and is incremented each time a new `@types/node` package is published to NPM for the same major/minor version of the corresponding library. Sometimes type declaration package versions and library package versions can get out of sync. Below are a few common reasons why, in order of how much they inconvenience users of a library. Only the last case is typically problematic. * As noted above, the patch version of the type declaration package is unrelated to the library patch version. - This allows DefinitelyTyped to safely update type declarations for the same major/minor version of a library. + This allows Definitely Typed to safely update type declarations for the same major/minor version of a library. * If updating a package for new functionality, don't forget to update the version number to line up with that version of the library. If users make sure versions correspond between JavaScript packages and their respective `@types` packages, then `npm update` should typically just work. -* It's common for type declaration package updates to lag behind library updates because it's often library users, not maintainers, who update DefinitelyTyped when new library features are released. +* It's common for type declaration package updates to lag behind library updates because it's often library users, not maintainers, who update Definitely Typed when new library features are released. So there may be a lag of days, weeks, or even months before a helpful community member sends a PR to update the type declaration package for a new library release. If you're impacted by this, you can be the change you want to see in the world and you can be that helpful community member! @@ -366,7 +379,7 @@ Only the last case is typically problematic. [Semantic versioning](https://semver.org/) requires that versions with breaking changes must increment the major version number. For example, a library that removes a publicly exported function after its `3.5.8` release must bump its version to `4.0.0` in its next release. -Furthermore, when the library's `4.0.0` release is out, its DefinitelyTyped type declaration package should also be updated to `4.0.0`, including any breaking changes to the library's API. +Furthermore, when the library's `4.0.0` release is out, its Definitely Typed type declaration package should also be updated to `4.0.0`, including any breaking changes to the library's API. Many libraries have a large installed base of developers (including maintainers of other packages using that library as a dependency) who won't move right away to a new version that has breaking changes, because it might be months until a maintainer has time to rewrite code to adapt to the new version. In the meantime, users of old library versions still may want to update type declarations for older versions. @@ -398,7 +411,7 @@ At the time of writing, the [history v2 `tsconfig.json`](https://github.com/Defi } ``` -If there are other packages in DefinitelyTyped that are incompatible with the new version, you will need to add path mappings to the old version. +If there are other packages in Definitely Typed that are incompatible with the new version, you will need to add path mappings to the old version. You will also need to do this recursively for packages depending on packages depending on the old version. For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/v2/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`. @@ -439,5 +452,3 @@ GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make- This project is licensed under the MIT license. Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file. - -[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) diff --git a/README.ru.md b/README.ru.md index 9186c2ddd5..fc2eb49c47 100644 --- a/README.ru.md +++ b/README.ru.md @@ -346,8 +346,6 @@ GitHub не [поддерживает](http://stackoverflow.com/questions/564617 Авторские права на файлы определений принадлежат каждому участнику, указанному в начале каждого файла определения. -[![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/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..3356ae6704 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,24 @@ +# Learn more at: https://aka.ms/yaml +jobs: +- job: npmRunTest + pool: + vmImage: 'Ubuntu 16.04' + demands: npm + + timeoutInMinutes: 360 + + steps: + - task: Npm@1 + displayName: 'npm install' + inputs: + verbose: false + + - script: | + git checkout -- . && npm run test + if [[ $BUILD_REASON == "Schedule" ]]; then git config --global user.email "types@microsoft.com" && git config --global user.name "TypeScript Bot" && npm run update-codeowners; fi + + displayName: 'npm run test' + +trigger: +- master + \ No newline at end of file diff --git a/notNeededPackages.json b/notNeededPackages.json index a91bf4f1e5..4df3f8e095 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -18,6 +18,12 @@ "sourceRepoURL": "https://github.com/ceolter/ag-grid", "asOfVersion": "3.2.0" }, + { + "libraryName": "aggregate-error", + "typingsPackageName": "aggregate-error", + "sourceRepoURL": "https://github.com/sindresorhus/aggregate-error", + "asOfVersion": "2.2.0" + }, { "libraryName": "ajv", "typingsPackageName": "ajv", @@ -198,6 +204,12 @@ "sourceRepoURL": "https://github.com/ded/bowser", "asOfVersion": "1.1.1" }, + { + "libraryName": "boxen", + "typingsPackageName": "boxen", + "sourceRepoURL": "https://github.com/sindresorhus/boxen", + "asOfVersion": "3.0.1" + }, { "libraryName": "Bugsnag Browser", "typingsPackageName": "bugsnag-js", @@ -216,12 +228,24 @@ "sourceRepoURL": "https://github.com/blakeembrey/camel-case", "asOfVersion": "1.2.1" }, + { + "libraryName": "camelcase", + "typingsPackageName": "camelcase", + "sourceRepoURL": "https://github.com/sindresorhus/camelcase", + "asOfVersion": "5.2.0" + }, { "libraryName": "catalog", "typingsPackageName": "catalog", "sourceRepoURL": "https://github.com/interactivethings/catalog", "asOfVersion": "3.5.0" }, + { + "libraryName": "chai-http", + "typingsPackageName": "chai-http", + "sourceRepoURL": "https://github.com/chaijs/chai-http", + "asOfVersion": "4.2.0" + }, { "libraryName": "chalk", "typingsPackageName": "chalk", @@ -240,12 +264,24 @@ "sourceRepoURL": "https://github.com/mapbox/cheap-ruler", "asOfVersion": "2.5.0" }, + { + "libraryName": "chokidar", + "typingsPackageName": "chokidar", + "sourceRepoURL": "https://github.com/paulmillr/chokidar", + "asOfVersion": "2.1.3" + }, { "libraryName": "chunked-dc", "typingsPackageName": "chunked-dc", "sourceRepoURL": "https://github.com/saltyrtc/chunked-dc-js", "asOfVersion": "0.2.2" }, + { + "libraryName": "clean-webpack-plugin", + "typingsPackageName": "clean-webpack-plugin", + "sourceRepoURL": "https://github.com/johnagan/clean-webpack-plugin", + "asOfVersion": "2.0.0" + }, { "libraryName": "colors.js (colors)", "typingsPackageName": "colors", @@ -258,6 +294,12 @@ "sourceRepoURL": "https://github.com/tj/commander.js", "asOfVersion": "2.12.2" }, + { + "libraryName": "conf", + "typingsPackageName": "conf", + "sourceRepoURL": "https://github.com/sindresorhus/conf", + "asOfVersion": "3.0.0" + }, { "libraryName": "confirmdialog", "typingsPackageName": "confirmdialog", @@ -270,6 +312,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/constant-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "copy-text-to-clipboard", + "typingsPackageName": "copy-text-to-clipboard", + "sourceRepoURL": "https://github.com/sindresorhus/copy-text-to-clipboard", + "asOfVersion": "2.0.1" + }, { "libraryName": "cordova-plugin-battery-status", "typingsPackageName": "cordova-plugin-battery-status", @@ -384,6 +432,18 @@ "sourceRepoURL": "https://github.com/jayphelps/core-decorators.js", "asOfVersion": "0.20.0" }, + { + "libraryName": "cp-file", + "typingsPackageName": "cp-file", + "sourceRepoURL": "https://github.com/sindresorhus/cp-file", + "asOfVersion": "6.1.1" + }, + { + "libraryName": "cpy", + "typingsPackageName": "cpy", + "sourceRepoURL": "https://github.com/sindresorhus/cpy", + "asOfVersion": "7.1.1" + }, { "libraryName": "cypress", "typingsPackageName": "cypress", @@ -402,18 +462,36 @@ "sourceRepoURL": "https://github.com/DataDog/dd-trace-js", "asOfVersion": "0.9.0" }, + { + "libraryName": "decamelize", + "typingsPackageName": "decamelize", + "sourceRepoURL": "https://github.com/sindresorhus/decamelize", + "asOfVersion": "3.0.1" + }, { "libraryName": "decimal.js", "typingsPackageName": "decimal.js", "sourceRepoURL": "https://github.com/MikeMcl/decimal.js", "asOfVersion": "7.4.0" }, + { + "libraryName": "decompress-response", + "typingsPackageName": "decompress-response", + "sourceRepoURL": "https://github.com/sindresorhus/decompress-response", + "asOfVersion": "4.1.0" + }, { "libraryName": "deepmerge", "typingsPackageName": "deepmerge", "sourceRepoURL": "git@github.com:KyleAMathews/deepmerge.git", "asOfVersion": "2.2.0" }, + { + "libraryName": "del", + "typingsPackageName": "del", + "sourceRepoURL": "https://github.com/sindresorhus/del", + "asOfVersion": "4.0.0" + }, { "libraryName": "delay", "typingsPackageName": "delay", @@ -444,6 +522,12 @@ "sourceRepoURL": "https://github.com/joyent/docker-file-parser", "asOfVersion": "1.0.3" }, + { + "libraryName": "dom-loaded", + "typingsPackageName": "dom-loaded", + "sourceRepoURL": "https://github.com/sindresorhus/dom-loaded", + "asOfVersion": "1.1.0" + }, { "libraryName": "dot-case", "typingsPackageName": "dot-case", @@ -486,6 +570,12 @@ "sourceRepoURL": "https://github.com/eggjs/egg", "asOfVersion": "1.5.0" }, + { + "libraryName": "elastic-apm-node", + "typingsPackageName": "elastic-apm-node", + "sourceRepoURL": "https://github.com/elastic/apm-agent-nodejs", + "asOfVersion": "2.7.0" + }, { "libraryName": "electron", "typingsPackageName": "electron", @@ -498,6 +588,12 @@ "sourceRepoURL": "https://github.com/loopline-systems/electron-builder", "asOfVersion": "2.8.0" }, + { + "libraryName": "element-ready", + "typingsPackageName": "element-ready", + "sourceRepoURL": "https://github.com/sindresorhus/element-ready", + "asOfVersion": "3.1.0" + }, { "libraryName": "email-addresses", "typingsPackageName": "email-addresses", @@ -510,6 +606,12 @@ "sourceRepoURL": "https://github.com/Sembiance/email-validator", "asOfVersion": "1.0.6" }, + { + "libraryName": "env-paths", + "typingsPackageName": "env-paths", + "sourceRepoURL": "https://github.com/sindresorhus/env-paths", + "asOfVersion": "2.1.0" + }, { "libraryName": "error-stack-parser", "typingsPackageName": "error-stack-parser", @@ -606,6 +708,24 @@ "sourceRepoURL": "https://github.com/taylorhakes/fecha", "asOfVersion": "2.3.1" }, + { + "libraryName": "file-type", + "typingsPackageName": "file-type", + "sourceRepoURL": "https://github.com/sindresorhus/file-type", + "asOfVersion": "10.9.1" + }, + { + "libraryName": "filenamify", + "typingsPackageName": "filenamify", + "sourceRepoURL": "https://github.com/sindresorhus/filenamify", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "filenamify-url", + "typingsPackageName": "filenamify-url", + "sourceRepoURL": "https://github.com/sindresorhus/filenamify-url", + "asOfVersion": "2.0.0" + }, { "libraryName": "FineUploader", "typingsPackageName": "fine-uploader", @@ -618,6 +738,12 @@ "sourceRepoURL": "https://www.firebase.com/docs/javascript/firebase", "asOfVersion": "3.2.1" }, + { + "libraryName": "fkill", + "typingsPackageName": "fkill", + "sourceRepoURL": "https://github.com/sindresorhus/fkill", + "asOfVersion": "6.0.0" + }, { "libraryName": "flatpickr", "typingsPackageName": "flatpickr", @@ -666,6 +792,18 @@ "sourceRepoURL": "https://github.com/manuelbieh/Geolib", "asOfVersion": "2.0.23" }, + { + "libraryName": "get-port", + "typingsPackageName": "get-port", + "sourceRepoURL": "https://github.com/sindresorhus/get-port", + "asOfVersion": "4.2.0" + }, + { + "libraryName": "get-stream", + "typingsPackageName": "get-stream", + "sourceRepoURL": "https://github.com/sindresorhus/get-stream", + "asOfVersion": "5.0.0" + }, { "libraryName": "github", "typingsPackageName": "github", @@ -678,6 +816,12 @@ "sourceRepoURL": "https://github.com/jdalrymple/node-gitlab", "asOfVersion": "2.0.0" }, + { + "libraryName": "globby", + "typingsPackageName": "globby", + "sourceRepoURL": "https://github.com/sindresorhus/globby", + "asOfVersion": "9.1.0" + }, { "libraryName": "Google Cloud Storage", "typingsPackageName": "google-cloud__storage", @@ -714,12 +858,30 @@ "sourceRepoURL": "https://github.com/ivogabe/gulp-typescript", "asOfVersion": "2.13.0" }, + { + "libraryName": "handlebars", + "typingsPackageName": "handlebars", + "sourceRepoURL": "https://github.com/wycats/handlebars.js", + "asOfVersion": "4.1.0" + }, { "libraryName": "handsontable", "typingsPackageName": "handsontable", "sourceRepoURL": "https://handsontable.com/", "asOfVersion": "0.35.0" }, + { + "libraryName": "has-yarn", + "typingsPackageName": "has-yarn", + "sourceRepoURL": "https://github.com/sindresorhus/has-yarn", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "hasha", + "typingsPackageName": "hasha", + "sourceRepoURL": "https://github.com/sindresorhus/hasha", + "asOfVersion": "4.0.0" + }, { "libraryName": "hibp", "typingsPackageName": "hibp", @@ -738,6 +900,12 @@ "sourceRepoURL": "https://github.com/prettymuchbryce/node-http-status", "asOfVersion": "1.2.0" }, + { + "libraryName": "humanize-string", + "typingsPackageName": "humanize-string", + "sourceRepoURL": "https://github.com/sindresorhus/humanize-string", + "asOfVersion": "2.0.1" + }, { "libraryName": "i18next-browser-languagedetector", "typingsPackageName": "i18next-browser-languagedetector", @@ -762,6 +930,12 @@ "sourceRepoURL": "https://github.com/bpmn-io/ids", "asOfVersion": "0.2.2" }, + { + "libraryName": "image-type", + "typingsPackageName": "image-type", + "sourceRepoURL": "https://github.com/sindresorhus/image-type", + "asOfVersion": "4.0.1" + }, { "libraryName": "immutability-helper", "typingsPackageName": "immutability-helper", @@ -786,6 +960,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/internal-ip", "asOfVersion": "4.1.0" }, + { + "libraryName": "into-stream", + "typingsPackageName": "into-stream", + "sourceRepoURL": "https://github.com/sindresorhus/into-stream", + "asOfVersion": "5.0.0" + }, { "libraryName": "inversify", "typingsPackageName": "inversify", @@ -834,12 +1014,30 @@ "sourceRepoURL": "https://github.com/blakeembrey/is-lower-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "is-online", + "typingsPackageName": "is-online", + "sourceRepoURL": "https://github.com/sindresorhus/is-online", + "asOfVersion": "8.1.0" + }, { "libraryName": "is-plain-object", "typingsPackageName": "is-plain-object", "sourceRepoURL": "https://github.com/jonschlinkert/is-plain-object", "asOfVersion": "2.0.4" }, + { + "libraryName": "is-scoped", + "typingsPackageName": "is-scoped", + "sourceRepoURL": "https://github.com/sindresorhus/is-scoped", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "is-svg", + "typingsPackageName": "is-svg", + "sourceRepoURL": "https://github.com/sindresorhus/is-svg", + "asOfVersion": "4.0.1" + }, { "libraryName": "is-upper-case", "typingsPackageName": "is-upper-case", @@ -918,6 +1116,12 @@ "sourceRepoURL": "https://github.com/keycloak/keycloak", "asOfVersion": "3.4.1" }, + { + "libraryName": "knex", + "typingsPackageName": "knex", + "sourceRepoURL": "https://github.com/tgriesser/knex", + "asOfVersion": "0.16.1" + }, { "libraryName": "knockout-paging", "typingsPackageName": "knockout-paging", @@ -942,6 +1146,12 @@ "sourceRepoURL": "https://github.com/elitechance/lambda-phi", "asOfVersion": "1.0.1" }, + { + "libraryName": "latest-version", + "typingsPackageName": "latest-version", + "sourceRepoURL": "https://github.com/sindresorhus/latest-version", + "asOfVersion": "5.0.0" + }, { "libraryName": "ldclient-js", "typingsPackageName": "ldclient-js", @@ -954,6 +1164,12 @@ "sourceRepoURL": "https://github.com/stevemao/left-pad", "asOfVersion": "1.2.0" }, + { + "libraryName": "leven", + "typingsPackageName": "leven", + "sourceRepoURL": "https://github.com/sindresorhus/leven", + "asOfVersion": "3.0.0" + }, { "libraryName": "Linq.JS", "typingsPackageName": "linq", @@ -990,6 +1206,12 @@ "sourceRepoURL": "https://github.com/steelsojka/lodash-decorators", "asOfVersion": "4.0.0" }, + { + "libraryName": "log-update", + "typingsPackageName": "log-update", + "sourceRepoURL": "https://github.com/sindresorhus/log-update", + "asOfVersion": "3.1.0" + }, { "libraryName": "log4javascript", "typingsPackageName": "log4javascript", @@ -1014,6 +1236,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/lower-case-first", "asOfVersion": "1.0.1" }, + { + "libraryName": "make-dir", + "typingsPackageName": "make-dir", + "sourceRepoURL": "https://github.com/sindresorhus/make-dir", + "asOfVersion": "2.1.0" + }, { "libraryName": "mali", "typingsPackageName": "mali", @@ -1032,6 +1260,12 @@ "sourceRepoURL": "https://github.com/runk/node-maxmind", "asOfVersion": "2.0.5" }, + { + "libraryName": "mem", + "typingsPackageName": "mem", + "sourceRepoURL": "https://github.com/sindresorhus/mem", + "asOfVersion": "4.2.0" + }, { "libraryName": "mendixmodelsdk", "typingsPackageName": "mendixmodelsdk", @@ -1086,6 +1320,12 @@ "sourceRepoURL": "https://github.com/LearnBoost/monk.git", "asOfVersion": "6.0.0" }, + { + "libraryName": "move-file", + "typingsPackageName": "move-file", + "sourceRepoURL": "https://github.com/sindresorhus/move-file", + "asOfVersion": "1.1.0" + }, { "libraryName": "MQTT", "typingsPackageName": "mqtt", @@ -1116,12 +1356,48 @@ "sourceRepoURL": "http://fian.my.id/Waves", "asOfVersion": "0.7.6" }, + { + "libraryName": "normalize-url", + "typingsPackageName": "normalize-url", + "sourceRepoURL": "https://github.com/sindresorhus/normalize-url", + "asOfVersion": "4.2.0" + }, { "libraryName": "Normalizr", "typingsPackageName": "normalizr", "sourceRepoURL": "https://github.com/paularmstrong/normalizr", "asOfVersion": "2.0.18" }, + { + "libraryName": "npm-email", + "typingsPackageName": "npm-email", + "sourceRepoURL": "https://github.com/sindresorhus/npm-email", + "asOfVersion": "3.1.0" + }, + { + "libraryName": "npm-keyword", + "typingsPackageName": "npm-keyword", + "sourceRepoURL": "https://github.com/sindresorhus/npm-keyword", + "asOfVersion": "6.0.0" + }, + { + "libraryName": "npm-name", + "typingsPackageName": "npm-name", + "sourceRepoURL": "https://github.com/sindresorhus/npm-name", + "asOfVersion": "5.2.1" + }, + { + "libraryName": "npm-run-path", + "typingsPackageName": "npm-run-path", + "sourceRepoURL": "https://github.com/sindresorhus/npm-run-path", + "asOfVersion": "3.0.1" + }, + { + "libraryName": "npm-user", + "typingsPackageName": "npm-user", + "sourceRepoURL": "https://github.com/sindresorhus/npm-user", + "asOfVersion": "4.0.0" + }, { "libraryName": "Nuka Carousel", "typingsPackageName": "nuka-carousel", @@ -1134,24 +1410,186 @@ "sourceRepoURL": "https://github.com/foretagsplatsen/numbro/", "asOfVersion": "1.9.3" }, + { + "libraryName": "on-change", + "typingsPackageName": "on-change", + "sourceRepoURL": "https://github.com/sindresorhus/on-change", + "asOfVersion": "1.1.0" + }, { "libraryName": "Onsen UI", "typingsPackageName": "onsenui", "sourceRepoURL": "http://onsen.io", "asOfVersion": "2.0.0" }, + { + "libraryName": "opn", + "typingsPackageName": "opn", + "sourceRepoURL": "https://github.com/sindresorhus/opn", + "asOfVersion": "5.5.0" + }, + { + "libraryName": "ora", + "typingsPackageName": "ora", + "sourceRepoURL": "https://github.com/sindresorhus/ora", + "asOfVersion": "3.2.0" + }, + { + "libraryName": "p-any", + "typingsPackageName": "p-any", + "sourceRepoURL": "https://github.com/sindresorhus/p-any", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-cancelable", + "typingsPackageName": "p-cancelable", + "sourceRepoURL": "https://github.com/sindresorhus/p-cancelable", + "asOfVersion": "1.1.0" + }, + { + "libraryName": "p-catch-if", + "typingsPackageName": "p-catch-if", + "sourceRepoURL": "https://github.com/sindresorhus/p-catch-if", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-debounce", + "typingsPackageName": "p-debounce", + "sourceRepoURL": "https://github.com/sindresorhus/p-debounce", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-each-series", + "typingsPackageName": "p-each-series", + "sourceRepoURL": "https://github.com/sindresorhus/p-each-series", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-event", + "typingsPackageName": "p-event", + "sourceRepoURL": "https://github.com/sindresorhus/p-event", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "p-every", + "typingsPackageName": "p-every", + "sourceRepoURL": "https://github.com/kevva/p-every", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-limit", + "typingsPackageName": "p-limit", + "sourceRepoURL": "https://github.com/sindresorhus/p-limit", + "asOfVersion": "2.2.0" + }, + { + "libraryName": "p-locate", + "typingsPackageName": "p-locate", + "sourceRepoURL": "https://github.com/sindresorhus/p-locate", + "asOfVersion": "4.0.0" + }, + { + "libraryName": "p-log", + "typingsPackageName": "p-log", + "sourceRepoURL": "https://github.com/sindresorhus/p-log", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-map", "typingsPackageName": "p-map", "sourceRepoURL": "https://github.com/sindresorhus/p-map", "asOfVersion": "2.0.0" }, + { + "libraryName": "p-map-series", + "typingsPackageName": "p-map-series", + "sourceRepoURL": "https://github.com/sindresorhus/p-map-series", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-memoize", + "typingsPackageName": "p-memoize", + "sourceRepoURL": "https://github.com/sindresorhus/p-memoize", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "p-one", + "typingsPackageName": "p-one", + "sourceRepoURL": "https://github.com/kevva/p-one", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-pipe", + "typingsPackageName": "p-pipe", + "sourceRepoURL": "https://github.com/sindresorhus/p-pipe", + "asOfVersion": "2.0.1" + }, + { + "libraryName": "p-progress", + "typingsPackageName": "p-progress", + "sourceRepoURL": "https://github.com/sindresorhus/p-progress", + "asOfVersion": "0.3.0" + }, + { + "libraryName": "p-props", + "typingsPackageName": "p-props", + "sourceRepoURL": "https://github.com/sindresorhus/p-props", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-queue", + "typingsPackageName": "p-queue", + "sourceRepoURL": "https://github.com/sindresorhus/p-queue", + "asOfVersion": "3.2.1" + }, + { + "libraryName": "p-reduce", + "typingsPackageName": "p-reduce", + "sourceRepoURL": "https://github.com/sindresorhus/p-reduce", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-retry", + "typingsPackageName": "p-retry", + "sourceRepoURL": "https://github.com/sindresorhus/p-retry", + "asOfVersion": "4.0.0" + }, + { + "libraryName": "p-series", + "typingsPackageName": "p-series", + "sourceRepoURL": "https://github.com/sindresorhus/p-series", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "p-some", + "typingsPackageName": "p-some", + "sourceRepoURL": "https://github.com/sindresorhus/p-some", + "asOfVersion": "4.0.1" + }, + { + "libraryName": "p-tap", + "typingsPackageName": "p-tap", + "sourceRepoURL": "https://github.com/sindresorhus/p-tap", + "asOfVersion": "2.0.0" + }, { "libraryName": "p-throttle", "typingsPackageName": "p-throttle", "sourceRepoURL": "https://github.com/sindresorhus/p-throttle", "asOfVersion": "2.1.0" }, + { + "libraryName": "p-timeout", + "typingsPackageName": "p-timeout", + "sourceRepoURL": "https://github.com/sindresorhus/p-timeout", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "package-json", + "typingsPackageName": "package-json", + "sourceRepoURL": "https://github.com/sindresorhus/package-json", + "asOfVersion": "6.1.0" + }, { "libraryName": "param-case", "typingsPackageName": "param-case", @@ -1176,12 +1614,24 @@ "sourceRepoURL": "https://github.com/blakeembrey/path-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "path-key", + "typingsPackageName": "path-key", + "sourceRepoURL": "https://github.com/sindresorhus/path-key", + "asOfVersion": "3.0.1" + }, { "libraryName": "path-to-regexp", "typingsPackageName": "path-to-regexp", "sourceRepoURL": "https://github.com/pillarjs/path-to-regexp", "asOfVersion": "1.7.0" }, + { + "libraryName": "path-type", + "typingsPackageName": "path-type", + "sourceRepoURL": "https://github.com/sindresorhus/path-type", + "asOfVersion": "4.0.0" + }, { "libraryName": "perfect-scrollbar", "typingsPackageName": "perfect-scrollbar", @@ -1218,12 +1668,36 @@ "sourceRepoURL": "https://github.com/PeculiarVentures/pkcs11js", "asOfVersion": "1.0.4" }, + { + "libraryName": "pkg-conf", + "typingsPackageName": "pkg-conf", + "sourceRepoURL": "https://github.com/sindresorhus/pkg-conf", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "pkg-dir", + "typingsPackageName": "pkg-dir", + "sourceRepoURL": "https://github.com/sindresorhus/pkg-dir", + "asOfVersion": "4.0.0" + }, + { + "libraryName": "pkg-versions", + "typingsPackageName": "pkg-versions", + "sourceRepoURL": "https://github.com/sindresorhus/pkg-versions", + "asOfVersion": "2.0.0" + }, { "libraryName": "plottable", "typingsPackageName": "plottable", "sourceRepoURL": "http://plottablejs.org/", "asOfVersion": "3.7.0" }, + { + "libraryName": "png-async", + "typingsPackageName": "png-async", + "sourceRepoURL": "https://github.com/kanreisa/node-png-async", + "asOfVersion": "0.9.4" + }, { "libraryName": "poly2tri.js", "typingsPackageName": "poly2tri", @@ -1254,6 +1728,12 @@ "sourceRepoURL": "https://github.com/angular/protractor", "asOfVersion": "4.0.0" }, + { + "libraryName": "ps-list", + "typingsPackageName": "ps-list", + "sourceRepoURL": "https://github.com/sindresorhus/ps-list", + "asOfVersion": "6.2.1" + }, { "libraryName": "qiniu", "typingsPackageName": "qiniu", @@ -1266,6 +1746,18 @@ "sourceRepoURL": "https://github.com/kazuhikoarase/qrcode-generator", "asOfVersion": "1.0.6" }, + { + "libraryName": "query-string", + "typingsPackageName": "query-string", + "sourceRepoURL": "https://github.com/sindresorhus/query-string", + "asOfVersion": "6.3.0" + }, + { + "libraryName": "quick-lru", + "typingsPackageName": "quick-lru", + "sourceRepoURL": "https://github.com/sindresorhus/quick-lru", + "asOfVersion": "3.0.0" + }, { "libraryName": "Raven JS", "typingsPackageName": "raven-js", @@ -1392,6 +1884,12 @@ "sourceRepoURL": "https://github.com/tanem/react-svg", "asOfVersion": "5.0.0" }, + { + "libraryName": "read-chunk", + "typingsPackageName": "read-chunk", + "sourceRepoURL": "https://github.com/sindresorhus/read-chunk", + "asOfVersion": "3.1.0" + }, { "libraryName": "realm", "typingsPackageName": "realm", @@ -1530,6 +2028,12 @@ "sourceRepoURL": "https://github.com/Lellansin/node-scanf", "asOfVersion": "0.7.3" }, + { + "libraryName": "screenfull", + "typingsPackageName": "screenfull", + "sourceRepoURL": "https://github.com/sindresorhus/screenfull.js", + "asOfVersion": "4.1.0" + }, { "libraryName": "sendgrid", "typingsPackageName": "sendgrid", @@ -1566,6 +2070,18 @@ "sourceRepoURL": "https://github.com/zeh/simplesignal", "asOfVersion": "1.0.0" }, + { + "libraryName": "@sindresorhus/df", + "typingsPackageName": "sindresorhus__df", + "sourceRepoURL": "https://github.com/sindresorhus/df", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "@sindresorhus/slugify", + "typingsPackageName": "sindresorhus__slugify", + "sourceRepoURL": "https://github.com/sindresorhus/slugify", + "asOfVersion": "0.9.1" + }, { "libraryName": "sip.js", "typingsPackageName": "sip.js", @@ -1626,6 +2142,12 @@ "sourceRepoURL": "https://servicestack.net/", "asOfVersion": "0.1.5" }, + { + "libraryName": "@storybook/addon-notes", + "typingsPackageName": "storybook__addon-notes", + "sourceRepoURL": "https://github.com/storybooks/storybook", + "asOfVersion": "5.0.0" + }, { "libraryName": "striptags", "typingsPackageName": "striptags", @@ -1674,6 +2196,12 @@ "sourceRepoURL": "http://tabrisjs.com", "asOfVersion": "1.8.0" }, + { + "libraryName": "tabris-plugin-firebase", + "typingsPackageName": "tabris-plugin-firebase", + "sourceRepoURL": "https://github.com/eclipsesource/tabris-plugin-firebase", + "asOfVersion": "2.1.0" + }, { "libraryName": "tcomb", "typingsPackageName": "tcomb", @@ -1686,6 +2214,12 @@ "sourceRepoURL": "https://github.com/terser-js/terser", "asOfVersion": "3.12.0" }, + { + "libraryName": "time-span", + "typingsPackageName": "time-span", + "sourceRepoURL": "https://github.com/sindresorhus/time-span", + "asOfVersion": "3.0.1" + }, { "libraryName": "timezonecomplete", "typingsPackageName": "timezonecomplete", @@ -1698,6 +2232,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/title-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "trash", + "typingsPackageName": "trash", + "sourceRepoURL": "https://github.com/sindresorhus/trash", + "asOfVersion": "5.0.1" + }, { "libraryName": "TsMonad", "typingsPackageName": "tsmonad", @@ -1746,6 +2286,12 @@ "sourceRepoURL": "https://github.com/kriasoft/universal-router", "asOfVersion": "8.0.0" }, + { + "libraryName": "unused-filename", + "typingsPackageName": "unused-filename", + "sourceRepoURL": "https://github.com/sindresorhus/unused-filename", + "asOfVersion": "2.0.0" + }, { "libraryName": "upper-case", "typingsPackageName": "upper-case", @@ -1800,6 +2346,18 @@ "sourceRepoURL": "https://github.com/vuejs/vue-router", "asOfVersion": "2.0.0" }, + { + "libraryName": "wait-for-localhost", + "typingsPackageName": "wait-for-localhost", + "sourceRepoURL": "https://github.com/sindresorhus/wait-for-localhost", + "asOfVersion": "3.1.0" + }, + { + "libraryName": "wallpaper", + "typingsPackageName": "wallpaper", + "sourceRepoURL": "https://github.com/sindresorhus/wallpaper", + "asOfVersion": "4.3.0" + }, { "libraryName": "webcola", "typingsPackageName": "webcola", @@ -1880,9 +2438,9 @@ }, { "libraryName": "@xmpp/jid", - "typingsPackageName": "xmpp-jid", + "typingsPackageName": "xmpp__jid", "sourceRepoURL": "github.com/node-xmpp/node-xmpp/", - "asOfVersion": "1.2.0" + "asOfVersion": "1.2.1" }, { "libraryName": "xterm.js", @@ -1896,6 +2454,12 @@ "sourceRepoURL": "none", "asOfVersion": "2.1.0" }, + { + "libraryName": "zapier-platform-core", + "typingsPackageName": "zapier-platform-core", + "sourceRepoURL": "https://github.com/zapier/zapier-platform-core", + "asOfVersion": "6.1.1" + }, { "libraryName": "zetapush-js", "typingsPackageName": "zetapush-js", diff --git a/package.json b/package.json index 1a5124c035..f4c48b1b32 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "scripts": { "compile-scripts": "tsc -p scripts", "not-needed": "node scripts/not-needed.js", + "update-codeowners": "node scripts/update-codeowners.js", "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed", "lint": "dtslint types" }, diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 899f96af64..6e0fd5a58c 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -1,13 +1,10 @@ { "compilerOptions": { + "allowJs": true, + "checkJs": true, "module": "commonjs", "target": "es6", - "noImplicitAny": true, - "strictNullChecks": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "noUnusedParameters": true, + "strict": true, "baseUrl": "../types", "typeRoots": [ "../types" @@ -15,4 +12,4 @@ "types": [], "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/scripts/update-codeowners.js b/scripts/update-codeowners.js new file mode 100644 index 0000000000..56eda138c6 --- /dev/null +++ b/scripts/update-codeowners.js @@ -0,0 +1,126 @@ +/// +// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally +const cp = require("child_process"); +const Octokit = require("@octokit/rest"); +const { AllPackages, getDefinitelyTyped, loggerWithErrors, + parseDefinitions, parseNProcesses, clean } = require("types-publisher"); +const { writeFile } = require("fs-extra"); + +async function main() { + const options = { definitelyTypedPath: ".", progress: false, parseInParallel: true }; + const log = loggerWithErrors()[0]; + + clean(); + const dt = await getDefinitelyTyped(options, log); + await parseDefinitions(dt, { nProcesses: parseNProcesses(), definitelyTypedPath: "." }, log); + const allPackages = await AllPackages.read(dt); + const typings = allPackages.allTypings(); + const maxPathLen = Math.max(...typings.map(t => t.subDirectoryPath.length)); + const entries = mapDefined(typings, t => getEntry(t, maxPathLen)); + await writeFile([options.definitelyTypedPath, ".github", "CODEOWNERS"].join("/"), `${header}\n\n${entries.join("\n")}\n`, { encoding: "utf-8" }); +} + +const token = /** @type {string} */(process.env.GH_TOKEN); +const gh = new Octokit(); +const reviewers = ["weswigham", "sandersn", "RyanCavanaugh"] +const now = new Date(); +const branchName = `codeowner-update-${now.getFullYear()}${padNum(now.getMonth())}${padNum(now.getDay())}`; +const remoteUrl = `https://${token}@github.com/DefinitelyTyped/DefinitelyTyped.git`; +runSequence([ + ["git", ["checkout", "."]], // reset any changes +]); + +main().then(() => { + runSequence([ + ["git", ["checkout", "-b", branchName]], // create a branch + ["git", ["add", ".github/CODEOWNERS"]], // Add CODEOWNERS + ["git", ["commit", "-m", `"Update CODEOWNERS"`]], // Commit all changes + ["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork + ["git", ["push", "--set-upstream", "fork", branchName, "-f"]] // push the branch + ]); + + gh.authenticate({ + type: "token", + token, + }); + return gh.pulls.create({ + owner: "DefinitelyTyped", + repo: "DefinitelyTyped", + maintainer_can_modify: true, + title: `🤖 CODEOWNERS has changed`, + head: `DefinitelyTyped:${branchName}`, + base: "master", + body: + `Please review the diff and merge if no changes are unexpected. + +cc ${reviewers.map(r => "@" + r).join(" ")}`, + }) +}).then(r => { + const num = r.data.number; + console.log(`Pull request ${num} created.`); + return gh.pulls.createReviewRequest({ + owner: "DefinitelyTyped", + repo: "DefinitelyTyped", + number: num, + reviewers, + }); +}).then(() => { + console.log(`Reviewers requested, done.`); +}).catch(e => { + console.error(e); + process.exit(1); +}); + +/** @param {[string, string[]][]} tasks */ +function runSequence(tasks) { + for (const task of tasks) { + console.log(`${task[0]} ${task[1].join(" ")}`); + const result = cp.spawnSync(task[0], task[1], { timeout: 100000, shell: true, stdio: "inherit" }); + if (result.status !== 0) throw new Error(`${task[0]} ${task[1].join(" ")} failed: ${result.stderr && result.stderr.toString()}`); + } +} + +/** @param {number} number */ +function padNum(number) { + const str = "" + number; + return str.length >= 2 ? str : "0" + str; +} + + +const header = +`# This file is generated. +# Add yourself to the "Definitions by:" list instead. +# See https://github.com/DefinitelyTyped/DefinitelyTyped#edit-an-existing-package`; + +/** + * @param { { contributors: ReadonlyArray<{githubUsername?: string }>, subDirectoryPath: string} } pkg + * @param {number} maxPathLen + * @return {string | undefined} + */ +function getEntry(pkg, maxPathLen) { + const users = mapDefined(pkg.contributors, c => c.githubUsername); + if (!users.length) { + return undefined; + } + + const path = `${pkg.subDirectoryPath}/`.padEnd(maxPathLen); + return `/types/${path} ${users.map(u => `@${u}`).join(" ")}`; +} + +/** + * @template T,U + * @param {ReadonlyArray} arr + * @param {(t: T) => U | undefined} mapper + * @return U[] + */ +function mapDefined(arr, mapper) { + const out = []; + for (const a of arr) { + const res = mapper(a); + if (res !== undefined) { + out.push(res); + } + } + return out; +} + diff --git a/types/absolute/tslint.json b/types/absolute/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/absolute/tslint.json +++ b/types/absolute/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/acc-wizard/tslint.json b/types/acc-wizard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/acc-wizard/tslint.json +++ b/types/acc-wizard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ace/tslint.json b/types/ace/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ace/tslint.json +++ b/types/ace/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/actioncable/tslint.json b/types/actioncable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/actioncable/tslint.json +++ b/types/actioncable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/activestorage/index.d.ts b/types/activestorage/index.d.ts index e8214d2d8e..544c9bca60 100644 --- a/types/activestorage/index.d.ts +++ b/types/activestorage/index.d.ts @@ -13,7 +13,7 @@ export class DirectUpload { file: File; url: string; - constructor(file: File, url: string, delegate: DirectUploadDelegate) + constructor(file: File, url: string, delegate?: DirectUploadDelegate) create(callback: (error: Error, blob: Blob) => void): void; } diff --git a/types/add-zero/add-zero-tests.ts b/types/add-zero/add-zero-tests.ts index ac0509d26d..852f1eddb9 100644 --- a/types/add-zero/add-zero-tests.ts +++ b/types/add-zero/add-zero-tests.ts @@ -1,3 +1,3 @@ -import addZero from "add-zero"; +import addZero = require("add-zero"); addZero(5, 2); diff --git a/types/add-zero/index.d.ts b/types/add-zero/index.d.ts index 907364a62d..15c21d4d11 100644 --- a/types/add-zero/index.d.ts +++ b/types/add-zero/index.d.ts @@ -3,4 +3,5 @@ // Definitions by: Giles Roadnight // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export default function addZero(value: string | number, digits?: number): string; +export = addZero; +declare function addZero(value: string | number, digits?: number): string; diff --git a/types/add2home/tslint.json b/types/add2home/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/add2home/tslint.json +++ b/types/add2home/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/adone/glosses/collections/buffer_list.d.ts b/types/adone/glosses/collections/buffer_list.d.ts index b2a4157385..482055fecc 100644 --- a/types/adone/glosses/collections/buffer_list.d.ts +++ b/types/adone/glosses/collections/buffer_list.d.ts @@ -30,7 +30,7 @@ declare namespace adone.collection { /** * Ends the stream */ - end(chunk?: Buffer): void; + end(chunk?: Buffer | string): void; end(chunk?: () => void): void; /** diff --git a/types/adone/index.d.ts b/types/adone/index.d.ts index 521bdf6e03..f7249c00b4 100644 --- a/types/adone/index.d.ts +++ b/types/adone/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/ciferox/adone // Definitions by: am , Maximus // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// /// diff --git a/types/adone/test/glosses/system/process.ts b/types/adone/test/glosses/system/process.ts index 9ffd3c33a5..9aed20b696 100644 --- a/types/adone/test/glosses/system/process.ts +++ b/types/adone/test/glosses/system/process.ts @@ -223,7 +223,7 @@ namespace adoneTests.system.process { }); ret.on("message", () => {}); - ret.stdout.pipe(adone.fs.createWriteStream(__filename)); + ret.stdout!.pipe(adone.fs.createWriteStream(__filename)); } } @@ -811,7 +811,7 @@ namespace adoneTests.system.process { }); ret.on("message", () => {}); - ret.stdout.pipe(adone.fs.createWriteStream(__filename)); + ret.stdout!.pipe(adone.fs.createWriteStream(__filename)); } } diff --git a/types/adone/tslint.json b/types/adone/tslint.json index 8c265eebb4..177bd33372 100644 --- a/types/adone/tslint.json +++ b/types/adone/tslint.json @@ -13,6 +13,7 @@ "no-unnecessary-qualifier": false, "unified-signatures": false, "space-before-function-paren": false, - "await-promise": false + "await-promise": false, + "no-restricted-globals": false } -} \ No newline at end of file +} diff --git a/types/agenda/tslint.json b/types/agenda/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/agenda/tslint.json +++ b/types/agenda/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aggregate-error/aggregate-error-tests.ts b/types/aggregate-error/aggregate-error-tests.ts deleted file mode 100644 index 69e544f9ee..0000000000 --- a/types/aggregate-error/aggregate-error-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -import AggregateError = require('aggregate-error'); - -const err = new AggregateError([new Error('foo'), 'bar']); - -for (const el of Array.from(err)) { - const err: Error = el; -} - -throw err; diff --git a/types/aggregate-error/index.d.ts b/types/aggregate-error/index.d.ts deleted file mode 100644 index 8c8c4cd3b2..0000000000 --- a/types/aggregate-error/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Type definitions for aggregate-error 1.0 -// Project: https://github.com/sindresorhus/aggregate-error#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = AggregateError; - -declare class AggregateError extends Error implements Iterable { - constructor(errors: Iterable); - - [Symbol.iterator](): Iterator; -} diff --git a/types/airbnb-prop-types/airbnb-prop-types-tests.ts b/types/airbnb-prop-types/airbnb-prop-types-tests.ts index 7b79086848..cf8535947e 100644 --- a/types/airbnb-prop-types/airbnb-prop-types-tests.ts +++ b/types/airbnb-prop-types/airbnb-prop-types-tests.ts @@ -104,12 +104,13 @@ AirbnbPropTypes.forbidExtraProps({ // $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'])); +const top = ((x?: T): T => x!)(); +type Top = typeof top; +declare function validateRequireableTop(x: React.Requireable): void; + +validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number)); +validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.number, 'foo')); +validateRequireableTop(AirbnbPropTypes.keysOf(PropTypes.oneOf(['foo', 'bar']))); // $ExpectType Requireable AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number); @@ -137,8 +138,8 @@ AirbnbPropTypes.nonNegativeNumber(); // $ExpectType Requireable AirbnbPropTypes.numericString(); -// $ExpectType Requireable<{}> -AirbnbPropTypes.object(); +// $ExpectType Requireable +const props: PropTypes.Requireable = AirbnbPropTypes.object(); // $ExpectType Requireable<{ foo: string; }> AirbnbPropTypes.object<{ foo: string }>(); @@ -151,28 +152,25 @@ AirbnbPropTypes.range(0, 10); // $ExpectType Requireable<5> AirbnbPropTypes.range<5>(0, 10); +// $ExpectType Requireable> +AirbnbPropTypes.ref(); + // $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')); +validateRequireableTop(AirbnbPropTypes.restrictedProp()); +validateRequireableTop(AirbnbPropTypes.restrictedProp(() => 'Error')); +validateRequireableTop(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( +validateRequireableTop(AirbnbPropTypes.sequenceOf({ validator: PropTypes.number })); +validateRequireableTop(AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }, { validator: PropTypes.string })); +validateRequireableTop(AirbnbPropTypes.sequenceOf( { validator: PropTypes.number, min: 0, max: 10 }, { validator: PropTypes.string }, { validator: PropTypes.bool }, -); +)); interface ShapeShape { foo: string; diff --git a/types/airbnb-prop-types/index.d.ts b/types/airbnb-prop-types/index.d.ts index 10c58556c7..da3e3b9eb2 100644 --- a/types/airbnb-prop-types/index.d.ts +++ b/types/airbnb-prop-types/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for airbnb-prop-types 2.11 +// Type definitions for airbnb-prop-types 2.13 // Project: https://github.com/airbnb/prop-types // Definitions by: Miles Johnson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -24,6 +24,12 @@ export type ReactFunctionComponentLike = (...args: any[]) => PropTypes.ReactNode export type ReactTypeLike = string | ReactClassComponentLike | ReactFunctionComponentLike; +export interface ReactRefLike { + readonly current: T | null; +} + +export type ReactLegacyRefLike = ((instance: T | null) => void) | ReactRefLike; + export interface Specifier { max?: number; min?: number; @@ -156,6 +162,8 @@ export function range(min?: number, max?: number): PropTypes.R export function range(min?: number, max?: number): PropTypes.Requireable; +export function ref(): PropTypes.Requireable>; + export function requiredBy

( requiredByPropName: string, propType: PropTypes.Validator

, diff --git a/types/airtable/airtable-tests.ts b/types/airtable/airtable-tests.ts new file mode 100644 index 0000000000..7d7dfbdc60 --- /dev/null +++ b/types/airtable/airtable-tests.ts @@ -0,0 +1,43 @@ +import * as Airtable from 'airtable'; + +interface Row extends Airtable.FieldSet { + field1: string; + attachments: Airtable.Attachment[]; +} + +const airtable = new Airtable(); + +const base = airtable.base('app id'); + +const table = base('table name') as Airtable.Table; + +async () => { + const query = table.select(); + { + const rows = await query.all(); + for (const row of rows) { + row.id; // $ExpectType string + row.fields.field1; // $ExpectType string + for (const attachment of row.fields.attachments) { + attachment.id; // $ExpectType string + attachment.filename; // $ExpectType string + attachment.size; // $ExpectType number + attachment.type; // $ExpectType string + attachment.url; // $ExpectType string + if (attachment.thumbnails) { + attachment.thumbnails.full.height; // $ExpectType number + attachment.thumbnails.full.width; // $ExpectType number + attachment.thumbnails.full.url; // $ExpectType string + + attachment.thumbnails.large.height; // $ExpectType number + attachment.thumbnails.large.width; // $ExpectType number + attachment.thumbnails.large.url; // $ExpectType string + + attachment.thumbnails.small.height; // $ExpectType number + attachment.thumbnails.small.width; // $ExpectType number + attachment.thumbnails.small.url; // $ExpectType string + } + } + } + } +}; diff --git a/types/airtable/index.d.ts b/types/airtable/index.d.ts new file mode 100644 index 0000000000..f3b6efa4ee --- /dev/null +++ b/types/airtable/index.d.ts @@ -0,0 +1,62 @@ +// Type definitions for airtable 0.5 +// Project: https://github.com/airtable/airtable.js +// Definitions by: Brandon Valosek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = Airtable; + +declare global { + class Airtable { + base(appId: string): Airtable.Base; + } + + namespace Airtable { + interface FieldSet { + [ key: string ]: undefined | string | ReadonlyArray; + } + + interface Base { + (tableName: string): Table<{}>; + } + + interface Table { + select(opt?: SelectOptions): Query; + } + + interface SelectOptions { + view?: string; + } + + interface Query { + all(): Promise>; + firstPage(): Promise>; + } + + type Response = ReadonlyArray>; + + interface Row { + id: string; + fields: TFields; + } + + interface Attachment { + id: string; + url: string; + filename: string; + size: number; + type: string; + thumbnails?: { + small: Thumbnail; + large: Thumbnail; + full: Thumbnail; + }; + } + + interface Thumbnail { + url: string; + width: number; + height: number; + } + } +} diff --git a/types/has-yarn/tsconfig.json b/types/airtable/tsconfig.json similarity index 94% rename from types/has-yarn/tsconfig.json rename to types/airtable/tsconfig.json index 824092017a..9ec625d762 100644 --- a/types/has-yarn/tsconfig.json +++ b/types/airtable/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "has-yarn-tests.ts" + "airtable-tests.ts" ] } diff --git a/types/aggregate-error/tslint.json b/types/airtable/tslint.json similarity index 100% rename from types/aggregate-error/tslint.json rename to types/airtable/tslint.json diff --git a/types/alertify/tslint.json b/types/alertify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/alertify/tslint.json +++ b/types/alertify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index fdd0f395fe..4c68a75831 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -98,6 +98,7 @@ let _algoliaIndexSettings: IndexSettings = { placeholders: { '': [''] }, camelCaseAttributes: [''], sortFacetValuesBy: 'count', + queryLanguages: ['fr', 'es'], }; let _algoliaQueryParameters: QueryParameters = { @@ -147,6 +148,7 @@ let _algoliaQueryParameters: QueryParameters = { tagFilters: [''], facetFilters: [''], analytics: false, + clickAnalytics: true, analyticsTags: [''], synonyms: true, replaceSynonymsInHighlight: false, @@ -205,6 +207,11 @@ browser.on('error', function onError(err) { browser.stop(); +index.setSettings({ hitsPerPage: 10 }, () => {}) +index.setSettings({ hitsPerPage: 10 }, { forwardToReplicas: true }, () => {}) +index.setSettings({ hitsPerPage: 10 }).then(() => {}) +index.setSettings({ hitsPerPage: 10 }, { forwardToReplicas: true }).then(() => {}) + index.browse("", { advancedSyntax: false, attributesToRetrieve: ['dogs'] diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 8e3ba4c5ab..8c32304c9e 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for algoliasearch-client-js 3.30.0 +// Type definitions for algoliasearch-client-js 3.30.1 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle // Haroen Viaene @@ -6,6 +6,8 @@ // Samuel Vaillant // Kai Eichinger // Nery Ortez +// Antoine Rousseau +// Luca Pasquale // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -358,6 +360,15 @@ declare namespace algoliasearch { settings: IndexSettings, cb: (err: Error, res: Task) => void ): void; + /** + * Set an index settings + * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings + */ + setSettings( + settings: IndexSettings, + extra: { forwardToReplicas: boolean }, + cb: (err: Error, res: Task) => void + ): void; /** * Clear cache of an index * https://github.com/algolia/algoliasearch-client-js#cache @@ -586,7 +597,7 @@ declare namespace algoliasearch { * Set an index settings * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings */ - setSettings(settings: IndexSettings): Promise; + setSettings(settings: IndexSettings, extra?: { forwardToReplicas: boolean }): Promise; /** * Search in an index * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search @@ -1425,6 +1436,12 @@ declare namespace algoliasearch { * https://www.algolia.com/doc/api-reference/api-parameters/analytics/ */ analytics?: boolean; + /** + * If set to true, enables the Click Analytics feature + * default false + * https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/ + */ + clickAnalytics?: boolean; /** * If set, tag your query with the specified identifiers * default: [] @@ -1778,12 +1795,20 @@ declare namespace algoliasearch { }; /** * List of attributes on which to do a decomposition of camel case words. - * - https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/ + * https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/ */ camelCaseAttributes?: string[]; - + /** + * Controls how facet values are sorted. + * https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/ + */ sortFacetValuesBy?: 'count' | 'alpha'; + /** + * Sets the languages to be used by language-specific settings and functionalities + * such as ignorePlurals, removeStopWords, and CJK word-detection. + * https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/ + */ + queryLanguages?: Array<'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh'>; } interface Response { diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index 11e22f5ccf..2fd13ec2d0 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for algoliasearch-client-js 3.30.0 +// Type definitions for algoliasearch-client-js 3.30.1 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle // Haroen Viaene @@ -7,6 +7,7 @@ // Claas Brüggemann // Kai Eichinger // Nery Ortez +// Antoine Rousseau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -505,6 +506,12 @@ declare namespace algoliasearch { * https://www.algolia.com/doc/api-reference/api-parameters/analytics/ */ analytics?: boolean; + /** + * If set to true, enables the Click Analytics feature + * default false + * https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/ + */ + clickAnalytics?: boolean; /** * If set, tag your query with the specified identifiers * default: [] @@ -534,9 +541,16 @@ declare namespace algoliasearch { userData?: string | object; /** + * Controls how facet values are sorted. * https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/ */ sortFacetValuesBy?: 'count' | 'alpha'; + /** + * Sets the languages to be used by language-specific settings and functionalities + * such as ignorePlurals, removeStopWords, and CJK word-detection. + * https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/ + */ + queryLanguages?: Array<'af' | 'ar' | 'az' | 'bg' | 'bn' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kk' | 'ko' | 'ku' | 'ky' | 'lt' | 'lv' | 'mi' | 'mn' | 'mr' | 'ms' | 'mt' | 'nb' | 'nl' | 'no' | 'ns' | 'pl' | 'ps' | 'pt' | 'pt-br' | 'qu' | 'ro' | 'ru' | 'sk' | 'sq' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tn' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'zh'>; } namespace SearchForFacetValues { diff --git a/types/algoliasearch/tslint.json b/types/algoliasearch/tslint.json index 886f1a8b6c..4ef1833aa4 100644 --- a/types/algoliasearch/tslint.json +++ b/types/algoliasearch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/align-text/index.d.ts b/types/align-text/index.d.ts new file mode 100644 index 0000000000..ad72062b34 --- /dev/null +++ b/types/align-text/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for align-text 1.0 +// Project: https://github.com/jonschlinkert/align-text +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +interface TransformResult { + /** + * the amount of indentation to use. Default is 0 when an object is returned. + */ + indent: number; + /** + * the character to use for indentation. Default is '' (empty string) when an object is returned. + */ + character: string; + /** + * leading characters to use at the beginning of each line. '' (empty string) when an object is returned. + */ + prefix: string; +} + +interface Callback { + /** + * @param len the length of the "current" line + * @param longest the length of the longest line + * @param line the current line (string) being aligned + * @param lines the array of all lines + */ + (len: number, longest: number, line: string, lines: string[]): + | number + | TransformResult; +} + +declare function align_text(text: string, fn?: number | Callback): string; +declare function align_text(text: any[], fn?: number | Callback): string[]; + +export = align_text; diff --git a/types/align-text/test/array.ts b/types/align-text/test/array.ts new file mode 100644 index 0000000000..4d5fef3479 --- /dev/null +++ b/types/align-text/test/array.ts @@ -0,0 +1,6 @@ +import align from "align-text"; + +const text = ["abc", true, 123456, { hello: "world" }]; +align(text, 4); + +align(text); diff --git a/types/align-text/test/center-complex.ts b/types/align-text/test/center-complex.ts new file mode 100644 index 0000000000..8520f92583 --- /dev/null +++ b/types/align-text/test/center-complex.ts @@ -0,0 +1,12 @@ +import align from "align-text"; + +function centerAlign(len: number, longest: number) { + return { + character: "\t", + indent: Math.floor((longest - len) / 2), + prefix: "~ " + }; +} + +const text = ["abc", "abc", "abc"]; +align(text, centerAlign); diff --git a/types/align-text/test/center-simple.ts b/types/align-text/test/center-simple.ts new file mode 100644 index 0000000000..5400551b81 --- /dev/null +++ b/types/align-text/test/center-simple.ts @@ -0,0 +1,8 @@ +import align from "align-text"; + +function centerAlign(len: number, longest: number) { + return Math.floor((longest - len) / 2); +} + +const text = ["abc", "abc", "abc"]; +align(text, centerAlign); diff --git a/types/align-text/test/simple.ts b/types/align-text/test/simple.ts new file mode 100644 index 0000000000..65ef81fcf0 --- /dev/null +++ b/types/align-text/test/simple.ts @@ -0,0 +1,8 @@ +import align from "align-text"; + +const text = ["abc", "abc", "abc"]; +align(text, 4); + +align("abc", 2); + +align("abc"); diff --git a/types/align-text/tsconfig.json b/types/align-text/tsconfig.json new file mode 100644 index 0000000000..bdea3b3399 --- /dev/null +++ b/types/align-text/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, + "allowSyntheticDefaultImports": true + }, + "files": [ + "index.d.ts", + "test/simple.ts", + "test/center-simple.ts", + "test/center-complex.ts", + "test/array.ts" + ] +} diff --git a/types/boxen/tslint.json b/types/align-text/tslint.json similarity index 100% rename from types/boxen/tslint.json rename to types/align-text/tslint.json diff --git a/types/alt/tslint.json b/types/alt/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/alt/tslint.json +++ b/types/alt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amap-js-api-autocomplete/amap-js-api-autocomplete-tests.ts b/types/amap-js-api-autocomplete/amap-js-api-autocomplete-tests.ts new file mode 100644 index 0000000000..fb1b0d9b6b --- /dev/null +++ b/types/amap-js-api-autocomplete/amap-js-api-autocomplete-tests.ts @@ -0,0 +1,108 @@ +declare const div: HTMLDivElement; + +const input = document.createElement('input'); +// $ExpectType Autocomplete +const autoComplete = new AMap.Autocomplete(); +// $ExpectType Autocomplete +new AMap.Autocomplete({}); +// $ExpectType Autocomplete +new AMap.Autocomplete({ + type: 'type', + city: 'city', + datatype: 'all', + citylimit: true, + input: 'input', + output: 'output', + outPutDirAuto: true +}); +// $ExpectType Autocomplete +new AMap.Autocomplete({ + type: 'type', + city: 'city', + datatype: 'all', + citylimit: true, + input, + output: div, + outPutDirAuto: true +}); + +autoComplete.search('keyword', (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + if (typeof result !== 'string') { + // $ExpectType number + result.count; + // $ExpectType string + result.info; + // $ExpectType Tip[] + result.tips; + { + const tip = result.tips[0]; + // $ExpectType string + tip.adcode; + // $ExpectType string + tip.address; + // $ExpectType any[] + tip.city; + // $ExpectType string + tip.district; + // $ExpectType string + tip.id; + // $ExpectType LngLat + tip.location; + // $ExpectType string + tip.name; + // $ExpectType string + tip.typecode; + } + } else { + // $ExpectType string + result; + } +}); + +// $ExpectType void +autoComplete.setType(); +// $ExpectType void +autoComplete.setType('type'); + +// $ExpectType void +autoComplete.setCity(); +// $ExpectType void +autoComplete.setCity('city'); + +// $ExpectType void +autoComplete.setCityLimit(false); + +autoComplete.on('complete', (event: AMap.Autocomplete.EventMap['complete']) => { + // $ExpectType "complete" + event.type; + // $ExpectType string + event.info; + if ('tips' in event) { + // $ExpectType number + event.count; + // $ExpectType Tip[] + event.tips; + } +}); + +autoComplete.on('error', (event: AMap.Autocomplete.EventMap['error']) => { + // $ExpectType "error" + event.type; + // $ExpectType string + event.info; +}); + +autoComplete.on('select', (event: AMap.Autocomplete.EventMap['select']) => { + // $ExpectType "select" + event.type; + // $ExpectType Tip + event.tip; +}); + +autoComplete.on('choose', (event: AMap.Autocomplete.EventMap['choose']) => { + // $ExpectType "choose" + event.type; + // $ExpectType Tip + event.tip; +}); diff --git a/types/amap-js-api-autocomplete/index.d.ts b/types/amap-js-api-autocomplete/index.d.ts new file mode 100644 index 0000000000..4bfc934395 --- /dev/null +++ b/types/amap-js-api-autocomplete/index.d.ts @@ -0,0 +1,144 @@ +// Type definitions for non-npm package amap-js-api-autocomplete 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/search#m_AMap.Autocomplete +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +declare namespace AMap { + namespace Autocomplete { + interface EventMap { + complete: Event<'complete', SearchResult | { info: string }>; + error: Event<'error', { info: string }>; + select: Event<'select', { tip: Tip }>; + choose: Event<'choose', { tip: Tip }>; + } + type DataType = 'all' | 'bus' | 'poi' | 'busline'; + interface Options { + /** + * 输入提示时限定POI类型,多个类型用“|”分隔 + */ + type?: string; + /** + * 输入提示时限定城市 + */ + city?: string; + /** + * 返回的数据类型 + */ + datatype?: DataType; + /** + * 是否强制限制在设置的城市内搜索 + */ + citylimit?: boolean; + /** + * 指定输入框 + */ + input?: string | HTMLInputElement; + /** + * 指定输出面板 + */ + output?: string | HTMLDivElement; + /** + * 是否在input位于页面较下方的时候自动将输入面板显示在input上方以避免被遮挡 + */ + outPutDirAuto?: boolean; + + // internal + closeResultOnScroll?: boolean; + lang?: Lang; + } + interface Tip { + /** + * 名称 + */ + name: string; + /** + * 所属区域 + */ + district: string; + /** + * 区域编码 + */ + adcode: string; + /** + * 地址 + */ + address: string; + /** + * 城市 + */ + city: any[]; + /** + * ID + */ + id: string; + /** + * 坐标经纬度 + */ + location: LngLat; + /** + * 类型编码 + */ + typecode: string; + } + interface SearchResult { + /** + * 查询状态说明 + */ + info: string; + /** + * 输入提示条数 + */ + count: number; + /** + * 输入提示列表 + */ + tips: Tip[]; + } + type SearchStatus = 'complete' | 'error' | 'no_data'; + } + class Autocomplete extends EventEmitter { + /** + * 输入提示,根据输入关键字提示匹配信息 + * @param options 选项 + */ + constructor(options?: Autocomplete.Options); + /** + * 根据输入关键字提示匹配信息 + * @param keyword 关键字 + * @param callback 回调 + */ + search( + keyword: string, + callback: (status: Autocomplete.SearchStatus, result: Autocomplete.SearchResult | string) => void + ): void; + /** + * 设置提示Poi类型,多个类型用“|”分隔 + * @param type Poi类型 + */ + setType(type?: string): void; + /** + * 设置城市 + * @param city 城市 + */ + setCity(city?: string): void; + /** + * 设置是否强制限制城市 + * @param cityLimit 是否强制限制城市 + */ + setCityLimit(cityLimit: boolean): void; + + // internal + /** + * 设置查询语言 + * @param lang 语言 + */ + setLang(lang?: Lang): void; + /** + * 返回查询语言 + */ + getLang(): Lang | undefined; + } +} diff --git a/types/amap-js-api-autocomplete/tsconfig.json b/types/amap-js-api-autocomplete/tsconfig.json new file mode 100644 index 0000000000..f6019445f5 --- /dev/null +++ b/types/amap-js-api-autocomplete/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amap-js-api-autocomplete-tests.ts" + ] +} diff --git a/types/elastic-apm-node/tslint.json b/types/amap-js-api-autocomplete/tslint.json similarity index 100% rename from types/elastic-apm-node/tslint.json rename to types/amap-js-api-autocomplete/tslint.json diff --git a/types/amap-js-api-geocoder/amap-js-api-geocoder-tests.ts b/types/amap-js-api-geocoder/amap-js-api-geocoder-tests.ts new file mode 100644 index 0000000000..51feb02694 --- /dev/null +++ b/types/amap-js-api-geocoder/amap-js-api-geocoder-tests.ts @@ -0,0 +1,227 @@ +declare const lnglat: AMap.LngLat; +declare const lnglatTuple: [number, number]; + +// $ExpectType Geocoder +new AMap.Geocoder(); +// $ExpectType Geocoder +new AMap.Geocoder({}); +// $ExpectType Geocoder +const geocoder = new AMap.Geocoder({ + city: 'city', + radius: 10, + lang: 'zh_cn', + batch: true, + extensions: 'all' +}); + +// $ExpectType void +geocoder.getLocation('address', (status, result) => { + // $ExpectType SearchStatus + status; + if (typeof result !== 'string') { + const geocode = result.geocodes[0]; + const addressComponent = geocode.addressComponent; + // $ExpectType string + result.info; + // $ExpectType string + result.resultNum; + // $ExpectType string + geocode.adcode; + // $ExpectType string + geocode.formattedAddress; + // $ExpectType string + geocode.level; + // $ExpectType LngLat + geocode.location; + // $ExpectType string + addressComponent.building; + // $ExpectType string + addressComponent.building; + // $ExpectType string + addressComponent.buildingType; + // $ExpectType string + addressComponent.city; + // $ExpectType string + addressComponent.citycode; + // $ExpectType string + addressComponent.district; + // $ExpectType string + addressComponent.neighborhood; + // $ExpectType string + addressComponent.neighborhoodType; + // $ExpectType string + addressComponent.province; + // $ExpectType string + addressComponent.street; + // $ExpectType string + addressComponent.streetNumber; + // $ExpectType string + addressComponent.township; + } else { + // $ExpectType string + result; + } +}); + +// $ExpectType void +geocoder.getLocation(['address', 'address'], () => { }); + +// $ExpectType void +geocoder.setCity(); +// $ExpectType void +geocoder.setCity('city'); + +// $ExpectType void +geocoder.getAddress(lnglat, (status, result) => { + // $ExpectType SearchStatus + status; + if (typeof result !== 'string') { + // $ExpectType string + result.info; + + // $ExpectType ReGeocode + const regeocode = result.regeocode; + // $ExpectType ReGeocodeAddressComponent + const addressComponent = regeocode.addressComponent; + { + // $ExpectType string + addressComponent.adcode; + // $ExpectType string + addressComponent.building; + // $ExpectType string + addressComponent.buildingType; + // $ExpectType BuildingArea[] + addressComponent.businessAreas; + { + const businessArea = addressComponent.businessAreas[0]; + // $ExpectType string + businessArea.id; + // $ExpectType LngLat + businessArea.location; + // $ExpectType string + businessArea.name; + } + // $ExpectType string + addressComponent.city; + // $ExpectType string + addressComponent.citycode; + // $ExpectType string + addressComponent.district; + // $ExpectType string + addressComponent.neighborhood; + // $ExpectType string + addressComponent.neighborhoodType; + // $ExpectType string + addressComponent.province; + // $ExpectType string + addressComponent.street; + // $ExpectType string + addressComponent.streetNumber; + // $ExpectType string + addressComponent.township; + } + // $ExpectType Cross[] + regeocode.crosses; + { + const cross = regeocode.crosses[0]; + // $ExpectType string + cross.direction; + // $ExpectType number + cross.distance; + // $ExpectType string + cross.first_id; + // $ExpectType string + cross.first_name; + // $ExpectType LngLat + cross.location; + // $ExpectType string + cross.second_id; + // $ExpectType string + cross.second_name; + } + // $ExpectType string + regeocode.formattedAddress; + // $ExpectType ReGeocodePoi[] + regeocode.pois; + { + const poi = regeocode.pois[0]; + // $ExpectType string + poi.address; + // $ExpectType string + poi.businessArea; + // $ExpectType string + poi.direction; + // $ExpectType number + poi.distance; + // $ExpectType string + poi.id; + // $ExpectType LngLat + poi.location; + // $ExpectType string + poi.name; + // $ExpectType string + poi.tel; + // $ExpectType string + poi.type; + } + // $ExpectType Road[] + regeocode.roads; + { + const road = regeocode.roads[0]; + // $ExpectType string + road.direction; + // $ExpectType number + road.distance; + // $ExpectType string + road.id; + // $ExpectType LngLat + road.location; + // $ExpectType string + road.name; + } + } else { + // $ExpectType string + result; + } +}); + +// $ExpectType void +geocoder.getAddress([lnglat, lnglat], (status, result) => { + if (typeof result !== 'string') { + // $ExpectType ReGeocode[] + result.regeocodes; + } +}); + +geocoder.on('error', (event: AMap.Geocoder.EventMap['error']) => { + // $ExpectType "error" + event.type; + // $ExpectType string + event.info; +}); + +geocoder.on('complete', (event: AMap.Geocoder.EventMap['complete']) => { + // $ExpectType "complete" + event.type; + if ('info' in event) { + // $ExpectType string + event.info; + } + if ('geocodes' in event) { + // $ExpectType string + event.resultNum; + } + if ('regeocode' in event) { + // $ExpectType ReGeocode + event.regeocode; + } + if ('regeocodes' in event) { + // $ExpectType ReGeocode[] + event.regeocodes; + } +}); + +// $ExpectType void +geocoder.getAddress(lnglatTuple, () => { }); +// $ExpectType void +geocoder.getAddress([lnglatTuple, lnglatTuple], () => { }); diff --git a/types/amap-js-api-geocoder/index.d.ts b/types/amap-js-api-geocoder/index.d.ts new file mode 100644 index 0000000000..91b0d12db5 --- /dev/null +++ b/types/amap-js-api-geocoder/index.d.ts @@ -0,0 +1,373 @@ +// Type definitions for non-npm package amap-js-api-geocoder 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/lnglat-to-address#m_AMap.Geocoder +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +declare namespace AMap { + namespace Geocoder { + interface EventMap { + complete: Event<'complete', GeocodeResult | {} | ReGeocodeResult | BatchReGeocodeResult>; + error: Event<'error', { info: string }>; + } + interface Options { + /** + * 城市 + */ + city?: string; + /** + * 中心点 + */ + radius?: number; + /** + * 语言类型 + */ + lang?: Lang; + /** + * 是否批量查询 + */ + batch?: boolean; + /** + * 是否返回详细信息 + */ + extensions?: 'base' | 'all'; + } + interface BuildingArea { + /** + * 唯一标识 + */ + id: string; + /** + * 名称 + */ + name: string; + /** + * 中心点经纬度 + */ + location: LngLat; + } + interface GeocodeAddressComponent { + /** + * 社区 + */ + neighborhood: string; + /** + * 社区类型 + */ + neighborhoodType: string; + /** + * 楼/大厦 + */ + building: string; + /** + * 楼类型 + */ + buildingType: string; + /** + * 省 + */ + province: string; + /** + * 城市 + */ + city: string; + /** + * 区 + */ + district: string; + /** + * 乡镇 + */ + township: string; + /** + * 城市编码 + */ + citycode: string; + /** + * 街道 + */ + street: string; + /** + * 门牌号 + */ + streetNumber: string; + } + interface ReGeocodeAddressComponent { + /** + * 城市编码 + */ + citycode: string; + /** + * 区域编码 + */ + adcode: string; + /** + * 所属商圈信息 + */ + businessAreas: BuildingArea[]; + /** + * 社区 + */ + neighborhoodType: string; + /** + * 社区类型 + */ + neighborhood: string; + /** + * 楼/大厦 + */ + building: string; + /** + * 楼类型 + */ + buildingType: string; + /** + * 街道 + */ + street: string; + /** + * 门牌号 + */ + streetNumber: string; + /** + * 省 + */ + province: string; + /** + * 城市 + */ + city: string; + /** + * 区 + */ + district: string; + /** + * 乡镇 + */ + township: string; + } + interface Geocode { + /** + * 地址组成元素 + */ + addressComponent: GeocodeAddressComponent; + /** + * 格式化地址 + */ + formattedAddress: string; + /** + * 坐标 + */ + location: LngLat; + /** + * 区域编码 + */ + adcode: string; + /** + * 给定地址匹配级别 + */ + level: string; + } + interface GeocodeResult { + /** + * 状态说明 + */ + info: string; + /** + * 地理编码结果数目 + */ + resultNum: string; + /** + * 地理编码结果 + */ + geocodes: Geocode[]; + } + interface Road { + /** + * 唯一标识 + */ + id: string; + /** + * 名称 + */ + name: string; + /** + * 道路离查询点最近距离 + */ + distance: number; + /** + * 道路上离查询点最近的点坐标 + */ + location: LngLat; + /** + * 与查询点的相对方位 + */ + direction: string; + } + interface Cross { + /** + * 道路离查询点最近距离 + */ + distance: number; + /** + * 与查询点的相对方位 + */ + direction: string; + /** + * 经纬度 + */ + location: LngLat; + /** + * 第一条道路id + */ + first_id: string; + /** + * 第一条道路名称 + */ + first_name: string; + /** + * 第二条道路id + */ + second_id: string; + /** + * 第二条道路名称 + */ + second_name: string; + } + interface ReGeocodePoi { + /** + * 唯一标识 + */ + id: string; + /** + * 名称 + */ + name: string; + /** + * 类型 + */ + type: string; + /** + * 电话 + */ + tel: string; + /** + * 该Poi到请求坐标的距离 + */ + distance: number; + /** + * 该Poi相对于请求坐标的方向 + */ + direction: string; + /** + * 址信息 + */ + address: string; + /** + * 坐标 + */ + location: LngLat; + /** + * 商圈名称 + */ + businessArea: string; + } + interface ReGeocodeAoi { + adcode: string; + area: string; + id: string; + location: LngLat; + name: string; + type: string; + } + interface ReGeocode { + /** + * 地址组成元素 + */ + addressComponent: ReGeocodeAddressComponent; + /** + * 格式化地址 + */ + formattedAddress: string; + /** + * 道路信息列表 + */ + roads: Road[]; + /** + * 道路路口列表 + */ + crosses: Cross[]; + /** + * 兴趣点列表 + */ + pois: ReGeocodePoi[]; + aois?: ReGeocodeAoi[]; + } + interface ReGeocodeResult { + /** + * 状态说明 + */ + info: string; + /** + * 逆地理编码结果 + */ + regeocode: ReGeocode; + } + interface BatchReGeocodeResult { + /** + * 状态说明 + */ + info: string; + /** + * 批量逆地理编码结果 + */ + regeocodes: ReGeocode[]; + } + type SearchStatus = 'complete' | 'no_data' | 'error'; + } + class Geocoder extends EventEmitter { + /** + * 地理编码与逆地理编码 + * @param options 选项 + */ + constructor(options?: Geocoder.Options); + /** + * 根据给定的地址描述进行解析 + * @param address 地址描述 + * @param callback 回调 + */ + getLocation( + address: string | string[], + callback: (status: Geocoder.SearchStatus, result: Geocoder.GeocodeResult | string) => void + ): void; + /** + * 设置地址描述所在城市 + * @param city 城市 + */ + setCity(city?: string): void; + /** + * 根据给定坐标进行解析 + * @param location 坐标 + * @param callback 回调 + */ + getAddress( + location: LocationValue, + callback: (status: Geocoder.SearchStatus, result: Geocoder.ReGeocodeResult | string) => void + ): void; + /** + * 根据给定坐标进行解析 + * @param locations 坐标数组 + * @param callback 回调 + */ + getAddress( + locations: LocationValue[], + callback: (status: Geocoder.SearchStatus, result: Geocoder.BatchReGeocodeResult | string) => void + ): void; + + // internal + setLang(lang?: Lang): void; + getLang(): Lang | undefined; + } +} diff --git a/types/amap-js-api-geocoder/tsconfig.json b/types/amap-js-api-geocoder/tsconfig.json new file mode 100644 index 0000000000..58571ba460 --- /dev/null +++ b/types/amap-js-api-geocoder/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amap-js-api-geocoder-tests.ts" + ] +} diff --git a/types/filenamify/tslint.json b/types/amap-js-api-geocoder/tslint.json similarity index 100% rename from types/filenamify/tslint.json rename to types/amap-js-api-geocoder/tslint.json diff --git a/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts b/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts new file mode 100644 index 0000000000..f6efc2dc54 --- /dev/null +++ b/types/amap-js-api-indoor-map/amap-js-api-indoor-map-tests.ts @@ -0,0 +1,114 @@ +// $ExpectType IndoorMap +new AMap.IndoorMap(); +// $ExpectType IndoorMap +new AMap.IndoorMap({}); +// $ExpectType IndoorMap +const indoorMap = new AMap.IndoorMap({ + zIndex: 1, + opacity: 0.5, + cursor: 'cursor', + hideFloorBar: false, + alaysShow: true +}); + +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId'); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', (error, result) => { + // $ExpectType Error | null + error; + // $ExpectType SearchResult + result; + // $ExpectType string + result.id; + // $ExpectType 0 | 1 + result.status; + if (result.status === 0) { + // $ExpectType Building + const building = result.building; + { + // $ExpectType number + building.floor; + // $ExpectType FloorDetails + const floorDetails = building.floor_details; + { + // $ExpectType number[] + floorDetails.floor_indexs; + // $ExpectType string[] + floorDetails.floor_names; + // $ExpectType string[] + floorDetails.floor_nonas; + } + // $ExpectType string + building.id; + // $ExpectType LngLat + building.lnglat; + // $ExpectType string + building.name; + } + } else { + // $ExpectType Error + result.error; + } +}); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, () => { }); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId'); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', () => { }); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', true); +// $ExpectType void +indoorMap.showIndoorMap('indoorMapId', 1, 'shopId', true, () => { }); + +let floor: undefined | false; +floor = indoorMap.showFloor(1); +floor = indoorMap.showFloor(1, true); + +// $ExpectType void +indoorMap.showFloorBar(); + +// $ExpectType void +indoorMap.hideFloorBar(); + +// $ExpectType void +indoorMap.hideLabels(); + +// $ExpectType string | null +indoorMap.getSelectedBuildingId(); + +// $ExpectType Building | null +const building = indoorMap.getSelectedBuilding(); +if (building) { + // $ExpectType number + building.floor; + // $ExpectType FloorDetails + building.floor_details; + // $ExpectType string + building.id; + // $ExpectType LngLat + building.lnglat; + // $ExpectType string + building.name; +} + +indoorMap.on('complete', (event: AMap.IndoorMap.EventMap['complete']) => { + // $ExpectType "complete" + event.type; +}); + +indoorMap.on('click', (event: AMap.IndoorMap.EventMap['click']) => { + // $ExpectType string + event.building_id; + // $ExpectType number + event.floor; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Shop + event.shop; + // $ExpectType "click" + event.type; +}); diff --git a/types/amap-js-api-indoor-map/index.d.ts b/types/amap-js-api-indoor-map/index.d.ts new file mode 100644 index 0000000000..9b30ea1722 --- /dev/null +++ b/types/amap-js-api-indoor-map/index.d.ts @@ -0,0 +1,239 @@ +// Type definitions for non-npm package amap-js-api-indoor-map 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/indoormap +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +declare namespace AMap { + namespace IndoorMap { + interface EventMap { + complete: Event<'complete'>; + click: MouseEvent<'click'>; + + floor_complete: Event<'floor_complete', SearchResult>; + mouseover: MouseEvent<'mouseover'>; + mouseout: MouseEvent<'mouseout'>; + } + type MouseEvent = Event; + interface Options extends Layer.Options { + /** + * 图层叠加的顺序值 + */ + zIndex?: number; + /** + * 图层的透明度 + */ + opacity?: number; + /** + * 鼠标悬停到店铺面时的鼠标样式 + */ + cursor?: string; + /** + * 是否隐藏楼层切换控件 + */ + hideFloorBar?: boolean; + /** + * 是否持续显示 + */ + alaysShow?: boolean; + + // internal + visible?: boolean; + featurezIndex?: number; + zooms?: [number, number]; + disableIconRender?: boolean; + disableLabelRender?: boolean; + disableHoverMarker?: boolean; + autoLoadBuildingsInTile?: boolean; + } + interface FloorDetails { + /** + * 各楼层索引 + */ + floor_indexs: number[]; + /** + * 各楼层英文 + */ + floor_nonas: string[]; + /** + * 各楼层名字 + */ + floor_names: string[]; + } + type ShopCategory = 'public' | 'connection' | 'shop'; + interface Shop { + /** + * 店铺的id + */ + id: string; + /** + * 兴趣点ID + */ + poiId: string; + /** + * 店铺所属楼宇ID + */ + building_id: string; + /** + * 店铺名称 + */ + name: string; + /** + * 店铺的经纬度 + */ + lnglat: LngLat; + /** + * 分类 + */ + category: ShopCategory; + } + interface Building { + /** + * 所属楼宇ID + */ + id: string; + /** + * 楼层名称 + */ + name: string; + /** + * 楼层的经纬度 + */ + lnglat: LngLat; + /** + * 所在楼层 + */ + floor: number; + floor_details: FloorDetails; + } + interface SearchSuccessResult { + /** + * 楼层的id + */ + id: string; + status: 0; + /** + * 建筑信息 + */ + building: Building; + } + interface SearchErrorResult { + /** + * 楼宇id + */ + id: string; + status: 1; + error: Error; + } + type SearchResult = SearchSuccessResult | SearchErrorResult; + } + + class IndoorMap extends Layer { + /** + * 室内地图 + * @param options 选项 + */ + constructor(options?: IndoorMap.Options); + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param shopId 商铺ID + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + shopId?: string, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定室内地图信息 + * @param indoorId 建筑物ID + * @param floor 楼层 + * @param shopId 商铺ID + * @param noMove 阻止移动 + * @param callback 回调 + */ + showIndoorMap( + indoorId: string, + floor?: number, + shopId?: string, + noMove?: boolean, + callback?: (error: null | Error, result: IndoorMap.SearchResult) => void + ): void; + /** + * 显示指定的楼层 + * @param floor 楼层 + * @param noMove 禁止移动 + */ + showFloor(floor: number, noMove?: boolean): false | undefined; + /** + * 显示楼层切换控件 + */ + showFloorBar(): void; + /** + * 隐藏楼层切换控件 + */ + hideFloorBar(): void; + /** + * 显示室内地图标注 + */ + showLabels(): void; + /** + * 隐藏室内地图标注 + */ + hideLabels(): void; + /** + * 获取处于被选中状态的室内地图的ID + */ + getSelectedBuildingId(): string | null; + /** + * 获取处于被选中状态的室内地图的一些基本信息 + */ + getSelectedBuilding(): IndoorMap.Building | null; + + // internal + getFloorBar(): void; + setSelectedBuildingId(id: string): void; + } +} diff --git a/types/amap-js-api-indoor-map/tsconfig.json b/types/amap-js-api-indoor-map/tsconfig.json new file mode 100644 index 0000000000..da736c3c7b --- /dev/null +++ b/types/amap-js-api-indoor-map/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amap-js-api-indoor-map-tests.ts" + ] +} diff --git a/types/get-port/tslint.json b/types/amap-js-api-indoor-map/tslint.json similarity index 100% rename from types/get-port/tslint.json rename to types/amap-js-api-indoor-map/tslint.json diff --git a/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts b/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts new file mode 100644 index 0000000000..ec89b74476 --- /dev/null +++ b/types/amap-js-api-map3d/amap-js-api-map3d-tests.ts @@ -0,0 +1,489 @@ +/** + * preset.ts + */ + +declare const map: AMap.Map; +declare const lnglat: AMap.LngLat; +declare const size: AMap.Size; +declare const lnglatTuple: [number, number]; +declare const pixel: AMap.Pixel; +declare const layer: AMap.Layer; +declare const ambientLight: AMap.Lights.AmbientLight; +declare const directionLight: AMap.Lights.DirectionLight; +declare const line: AMap.Object3D.Line; +declare const mesh: AMap.Object3D.Mesh; +declare const object3d: AMap.Object3D; +declare const geometry: AMap.Geometry3D.Mesh; + +/** + * lights.ts + */ + +// $ExpectType AmbientLight +const testAmbientLight = new AMap.Lights.AmbientLight([0.1, 0, 0.1], 1); + +// $ExpectType void +testAmbientLight.setColor([0.1, 1, 0.5]); + +// $ExpectType void +testAmbientLight.setIntensity(1); + +// $ExpectType DirectionLight +const testDirectionLight = new AMap.Lights.DirectionLight([1, 2, 3], [1, 2, 3], 1); + +// $ExpectType void +testDirectionLight.setColor([1, 2, 3]); + +// $ExpectType void +testDirectionLight.setIntensity(1); + +// $ExpectType void +testDirectionLight.setDirection([1, 2, 3]); + +/** + * map3d.ts + */ + +// $ExpectType Object3DResult | null +map.getObject3DByContainerPos(pixel); + +// $ExpectType Object3DResult | null +const containserPos = map.getObject3DByContainerPos(pixel, [layer], true); +if (containserPos) { + // $ExpectType number + containserPos.index; + // $ExpectType Vector3 + containserPos.point; + // $ExpectType number + containserPos.distance; + // $ExpectType Object3D + containserPos.object; +} else { + // $ExpectType null + containserPos; +} + +map.AmbientLight = ambientLight; +map.AmbientLight = undefined; + +map.DirectionLight = directionLight; +map.DirectionLight = undefined; + +/** + * object3d-group.ts + */ + +// $ExpectType Object3DGroup +const testObject3dGroup1 = new AMap.Object3DGroup(); +// $ExpectType Object3DGroup +const testObject3dGroup2 = new AMap.Object3DGroup(); + +// $ExpectType Object3D[] +testObject3dGroup1.children; +// $ExpectType Mesh[] +testObject3dGroup2.children; + +// $ExoectType void +testObject3dGroup1.add(line); +// $ExoectType void +testObject3dGroup1.add(mesh); +// $ExoectType void +testObject3dGroup2.add(mesh); +// $ExpectError +testObject3dGroup2.add(line); + +// $ExoectType void +testObject3dGroup1.remove(line); +// $ExoectType void +testObject3dGroup1.remove(mesh); +// $ExoectType void +testObject3dGroup2.remove(mesh); +// $ExpectError +testObject3dGroup2.remove(line); + +/** + * object3d-Layer.ts + */ + +// $ExpectType Object3DLayer +new AMap.Object3DLayer(); +// $ExpectType Object3DLayer +new AMap.Object3DLayer({}); +// $ExpectType Object3DLayer +const testObject3DLayer = new AMap.Object3DLayer({ + map, + visible: true, + opacity: 0.1, + zIndex: 2, + zooms: [1, 2] +}); + +// $ExpectType void +testObject3DLayer.setMap(null); +// $ExpectType void +testObject3DLayer.setMap(map); + +// $ExpectType Map | null | undefined +testObject3DLayer.getMap(); + +// $ExpectType void +testObject3DLayer.hide(); + +// $ExpectType void +testObject3DLayer.show(); + +// $ExpectType void +testObject3DLayer.setOpacity(1); + +// $ExpectType number +testObject3DLayer.getOpacity(); + +// $ExpectType void +testObject3DLayer.setzIndex(1); + +// $ExpectType number +testObject3DLayer.getzIndex(); + +// $ExpectType [number, number] +testObject3DLayer.getZooms(); + +// $ExpectType void +testObject3DLayer.add(object3d); + +// $ExpectType void +testObject3DLayer.remove(object3d); + +// $ExpectType void +testObject3DLayer.clear(); + +// $ExpectType void +testObject3DLayer.reDraw(); + +/** + * vector3.ts + */ + +// $ExpectType Vector3 +const testVector = new AMap.Vector3([1, 2, 3]); +// $ExpectType Vector3 +new AMap.Vector3(testVector); + +// $ExpectType [number, number, number] +testVector.elements; + +// $ExpectType void +testVector.set(1, 2, 3); + +// $ExpectType number +testVector.dot(); + +// $ExpectType Vector3 +testVector.clone(); + +// $ExpectType Vector3 +testVector.add(testVector); +// $ExpectType Vector3 +testVector.add([1, 2, 3]); + +// $ExpectType Vector3 +testVector.sub(testVector); +// $ExpectType Vector3 +testVector.sub([1, 2, 3]); + +// $ExpectType Vector3 +testVector.addVectors(testVector, testVector); + +// $ExpectType Vector3 +testVector.subVectors(testVector, testVector); + +// $ExpectType Vector3 +testVector.crossVectors(testVector, testVector); + +// $ExpectType Vector3 +testVector.normalize(); + +// $ExpectType number +testVector.length(); + +/** + * object3d/mesh.ts + */ + +// $ExpectType Mesh +const testMesh = new AMap.Object3D.Mesh(); + +// $ExpectError +testMesh.geometry = geometry; + +// $ExpectType number[] +testMesh.geometry.vertices; +// $ExpectError +testMesh.geometry.vertices = []; +testMesh.geometry.vertices.shift(); + +// $ExpectType number[] +testMesh.geometry.vertexColors; +// $ExpectError +testMesh.geometry.vertexColors = []; +testMesh.geometry.vertexColors.shift(); + +// $ExpectType number[] +testMesh.geometry.vertexUVs; +// $ExpectError +testMesh.geometry.vertexUVs = []; +testMesh.geometry.vertexUVs.shift(); + +// $ExpectType number[] +testMesh.geometry.faces; +// $ExpectError +testMesh.geometry.faces = []; +testMesh.geometry.faces.shift(); + +// $ExpectType number[] +testMesh.geometry.textureIndices; +// $ExpectError +testMesh.geometry.textureIndices = []; +testMesh.geometry.textureIndices.shift(); + +// $ExpectType (string | HTMLCanvasElement)[] +testMesh.textures; + +// $ExpectType boolean +testMesh.needUpdate; + +// $ExpectType boolean +testMesh.transparent; + +// $ExpectType boolean +testMesh.DEPTH_TEST; + +// $ExpectType void +testMesh.reDraw(); + +/** + * object3d/meshAcceptLights.ts + */ + +// $ExpectType MeshAcceptLights +const testMeshAcceptLights = new AMap.Object3D.MeshAcceptLights(); + +// $ExpectError +testMeshAcceptLights.geometry = geometry; + +// $ExpectType number[] +testMeshAcceptLights.geometry.vertices; +// $ExpectError +testMeshAcceptLights.geometry.vertices = []; +testMeshAcceptLights.geometry.vertices.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.vertexColors; +// $ExpectError +testMeshAcceptLights.geometry.vertexColors = []; +testMeshAcceptLights.geometry.vertexColors.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.vertexUVs; +// $ExpectError +testMeshAcceptLights.geometry.vertexUVs = []; +testMeshAcceptLights.geometry.vertexUVs.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.faces; +// $ExpectError +testMeshAcceptLights.geometry.faces = []; +testMeshAcceptLights.geometry.faces.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.textureIndices; +// $ExpectError +testMeshAcceptLights.geometry.textureIndices = []; +testMeshAcceptLights.geometry.textureIndices.shift(); + +// $ExpectType number[] +testMeshAcceptLights.geometry.vertexNormals; +// $ExpectError +testMeshAcceptLights.geometry.vertexNormals = []; +testMeshAcceptLights.geometry.vertexNormals.shift(); + +// $ExpectType (string | HTMLCanvasElement)[] +testMeshAcceptLights.textures; + +// $ExpectType boolean +testMeshAcceptLights.needUpdate; + +// $ExpectType boolean +testMeshAcceptLights.transparent; + +// $ExpectType boolean +testMeshAcceptLights.DEPTH_TEST; + +// $ExpectType void +testMeshAcceptLights.reDraw(); + +/** + * object3d/meshLine.ts + */ + +// $ExpectError +new AMap.Object3D.MeshLine(); +// $ExpectError +new AMap.Object3D.MeshLine({}); +// $ExpectType MeshLine +const testMeshLine = new AMap.Object3D.MeshLine({ + path: [lnglat], + width: 1, + height: 1, + color: 'red' +}); +// $ExpectType MeshLine +new AMap.Object3D.MeshLine({ + path: [lnglat], + color: [0, 0, 1, 1] +}); +// $ExpectType MeshLine +new AMap.Object3D.MeshLine({ + path: [[1, 2]] +}); +// $ExpectType MeshLine +new AMap.Object3D.MeshLine({ + path: [lnglat], + unit: 'meter' +}); +// $ExpectType MeshLine +new AMap.Object3D.MeshLine({ + path: [pixel], + unit: 'px' +}); +// $ExpectError +new AMap.Object3D.MeshLine({ + path: [lnglat], + unit: 'px' +}); +// $ExpectError +new AMap.Object3D.MeshLine({ + path: [pixel], + unit: 'meter' +}); + +// $ExpectType number[] +testMeshLine.geometry.vertices; +// $ExpectError +testMeshLine.geometry.vertices = []; +testMeshLine.geometry.vertices.shift(); + +// $ExpectType number[] +testMeshLine.geometry.vertexUVs; +// $ExpectError +testMeshLine.geometry.vertexUVs = []; +testMeshLine.geometry.vertexUVs.shift(); + +// $ExpectType number[] +testMeshLine.geometry.vertexColors; +// $ExpectError +testMeshLine.geometry.vertexColors = []; +testMeshLine.geometry.vertexColors.shift(); + +// $ExpectType number[] +testMeshLine.geometry.vertexColors; +// $ExpectError +testMeshLine.geometry.vertexColors = []; +testMeshLine.geometry.vertexColors.shift(); + +// $ExpectType number[] +testMeshLine.geometry.vertexIndices; +// $ExpectError +testMeshLine.geometry.vertexIndices = []; +testMeshLine.geometry.vertexIndices.shift(); + +// $ExpectType number[] +testMeshLine.geometry.directions; +// $ExpectError +testMeshLine.geometry.directions = []; +testMeshLine.geometry.directions.shift(); + +// $ExpectType number[] +testMeshLine.geometry.textureIndices; +// $ExpectError +testMeshLine.geometry.textureIndices = []; +testMeshLine.geometry.textureIndices.shift(); + +// $ExpectType number +testMeshLine.width; + +// $ExpectType void +testMeshLine.setPath([lnglat]); +// $ExpectType void +testMeshLine.setPath([lnglatTuple]); +// $ExpectType void +testMeshLine.setPath([pixel]); + +// $ExpectType void +testMeshLine.setWidth(10); + +// $ExpectType void +testMeshLine.setHeight(10); + +// $ExpectType void +testMeshLine.setColor('red'); + +/** + * object3d/prism.ts + */ + +// $ExpectError +new AMap.Object3D.Prism(); +// $ExpectError +new AMap.Object3D.Prism({}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: 'red', + height: 1, + color2: 'blue' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [pixel], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [[lnglat]], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [[pixel]], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [[lnglatTuple]], + color: 'red' +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: ['red'] +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: [1, 1, 1, 1] +}); +// $ExpectType Prism +new AMap.Object3D.Prism({ + path: [lnglat], + color: [[1, 1, 1, 1]] +}); diff --git a/types/amap-js-api-map3d/geometry-3d.d.ts b/types/amap-js-api-map3d/geometry-3d.d.ts new file mode 100644 index 0000000000..edb4fd2a85 --- /dev/null +++ b/types/amap-js-api-map3d/geometry-3d.d.ts @@ -0,0 +1,28 @@ +declare namespace AMap { + abstract class Geometry3D { + readonly vertices: number[]; + readonly vertexUVs: number[]; + readonly vertexColors: number[]; + } + + namespace Geometry3D { + class Mesh extends Geometry3D { + readonly type: 'mesh'; + readonly faces: number[]; + readonly textureIndices: number[]; + } + + class Line extends Geometry3D { + readonly type: 'line'; + readonly segments: number[]; + readonly textureIndices: number[]; + } + + class Points extends Geometry3D { + readonly type: 'points'; + readonly pointSizes: number[]; + readonly pointAreas: number[]; + readonly textureIndices: number[]; + } + } +} diff --git a/types/amap-js-api-map3d/index.d.ts b/types/amap-js-api-map3d/index.d.ts new file mode 100644 index 0000000000..43be45eb13 --- /dev/null +++ b/types/amap-js-api-map3d/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for non-npm package amap-js-api-map3d 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/maps-3d +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +/// +/// +/// +/// +/// +/// +/// diff --git a/types/amap-js-api-map3d/lights.d.ts b/types/amap-js-api-map3d/lights.d.ts new file mode 100644 index 0000000000..b637ee79ef --- /dev/null +++ b/types/amap-js-api-map3d/lights.d.ts @@ -0,0 +1,17 @@ +declare namespace AMap { + namespace Lights { + class AmbientLight { + constructor(color: [number, number, number], intensity: number); + setColor(color: [number, number, number]): void; + setIntensity(intensity: number): void; + } + + class DirectionLight { + constructor(direction: [number, number, number], color: [number, number, number], intensity: number); + update(): void; + setDirection(direction: [number, number, number]): void; + setColor(direction: [number, number, number]): void; + setIntensity(intensity: number): void; + } + } +} diff --git a/types/amap-js-api-map3d/map3d.d.ts b/types/amap-js-api-map3d/map3d.d.ts new file mode 100644 index 0000000000..f2345f1a30 --- /dev/null +++ b/types/amap-js-api-map3d/map3d.d.ts @@ -0,0 +1,15 @@ +declare namespace AMap { + namespace Map { + interface Object3DResult { + index: number; + point: Vector3; + distance: number; + object: Object3D; + } + } + interface Map { + AmbientLight?: Lights.AmbientLight; + DirectionLight?: Lights.DirectionLight; + getObject3DByContainerPos(pixel: Pixel, layers?: Layer[], all?: boolean): Map.Object3DResult | null; + } +} diff --git a/types/amap-js-api-map3d/object3d-group.d.ts b/types/amap-js-api-map3d/object3d-group.d.ts new file mode 100644 index 0000000000..4c1f4d90d3 --- /dev/null +++ b/types/amap-js-api-map3d/object3d-group.d.ts @@ -0,0 +1,8 @@ +declare namespace AMap { + class Object3DGroup extends Object3D { + constructor(); + children: C[]; + add(object3d: C): void; + remove(object3d: C): void; + } +} diff --git a/types/amap-js-api-map3d/object3d-layer.d.ts b/types/amap-js-api-map3d/object3d-layer.d.ts new file mode 100644 index 0000000000..de29a0bfd9 --- /dev/null +++ b/types/amap-js-api-map3d/object3d-layer.d.ts @@ -0,0 +1,27 @@ +declare namespace AMap { + namespace Object3DLayer { + interface Options { + map?: Map; + visible?: boolean; + opacity?: number; + zIndex?: number; + zooms?: [number, number]; + } + } + + class Object3DLayer extends Layer { + constructor(options?: Object3DLayer.Options) + add(object3d: Object3D): void; + remove(object3d: Object3D): void; + clear(): void; + reDraw(): void; + + // internal + setOption(options: { + position?: number; + scale?: number; + height?: number; + scene?: number; + }): void; + } +} diff --git a/types/amap-js-api-map3d/object3d.d.ts b/types/amap-js-api-map3d/object3d.d.ts new file mode 100644 index 0000000000..32f63e2378 --- /dev/null +++ b/types/amap-js-api-map3d/object3d.d.ts @@ -0,0 +1,92 @@ +declare namespace AMap { + class Object3D { + readonly geometry: Geometry3D; + transparent: boolean; + DEPTH_TEST: boolean; + textures: Array; + needUpdate: boolean; + reDraw(): void; + + // internal + reset(): void; + } + + namespace Object3D { + class Mesh extends Object3D { + readonly geometry: Geometry3D.Mesh; + } + + class MeshAcceptLights extends Mesh { + readonly geometry: Geometry3D.Mesh & { readonly vertexNormals: number[] }; + } + + namespace Prism { + interface Options { + path: LngLat[] | Pixel[] | Array>; + color: string | number[] | Array; + height?: number; + color2?: string | number[] | Array; + } + } + class Prism extends MeshAcceptLights { + constructor(options: Prism.Options); + } + + // tslint:disable-next-line + class Wall extends Prism { } + + class Line extends Object3D { + readonly geometry: Geometry3D.Line; + } + + namespace ThinLine { + interface Options { + path: Array<[number, number]>; + color: string; + altitude?: number; + dashArray?: number[]; + } + } + class ThinLine extends Line { + constructor(options: ThinLine.Options); + } + + class Points extends Object3D { + readonly geometry: Geometry3D.Points; + borderColor: string; + borderWeight: number; + } + + class RoundPoints extends Points { + merge: boolean; + } + + namespace MeshLine { + type Options = { + width?: number; + height?: number | number[]; + color?: string | number[]; + } & ({ + unit?: 'meter'; + path: Array<[number, number]> | LngLat[]; + } | { + unit: 'px'; + path: Array<[number, number]> | Pixel[]; + }); + } + // inherit from WideLine + class MeshLine extends Object3D { + constructor(options: MeshLine.Options); + readonly geometry: Geometry3D & { + readonly vertexIndices: number[]; + readonly directions: number[]; + readonly textureIndices: number[]; + }; + width: number; + setPath(path: LngLat[] | Pixel[] | Array<[number, number]>): void; + setWidth(width: number): void; + setHeight(height: number | number[]): void; + setColor(color: string): void; + } + } +} diff --git a/types/amap-js-api-map3d/tsconfig.json b/types/amap-js-api-map3d/tsconfig.json new file mode 100644 index 0000000000..e28735d963 --- /dev/null +++ b/types/amap-js-api-map3d/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "geometry-3d.d.ts", + "index.d.ts", + "lights.d.ts", + "map3d.d.ts", + "object3d-group.d.ts", + "object3d-layer.d.ts", + "object3d.d.ts", + "vector3.d.ts", + "amap-js-api-map3d-tests.ts" + ] +} diff --git a/types/make-dir/tslint.json b/types/amap-js-api-map3d/tslint.json similarity index 100% rename from types/make-dir/tslint.json rename to types/amap-js-api-map3d/tslint.json diff --git a/types/amap-js-api-map3d/vector3.d.ts b/types/amap-js-api-map3d/vector3.d.ts new file mode 100644 index 0000000000..1cb02fe9b0 --- /dev/null +++ b/types/amap-js-api-map3d/vector3.d.ts @@ -0,0 +1,16 @@ +declare namespace AMap { + class Vector3 { + readonly elements: [number, number, number]; + constructor(elements: [number, number, number] | Vector3); + set(x: number, y: number, z: number): void; + dot(): number; + clone(): Vector3; + add(elements: [number, number, number] | Vector3): this; + sub(elements: [number, number, number] | Vector3): this; + addVectors(a: Vector3, b: Vector3): this; + subVectors(a: Vector3, b: Vector3): this; + crossVectors(a: Vector3, b: Vector3): this; + normalize(): this; + length(): number; + } +} diff --git a/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts b/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts new file mode 100644 index 0000000000..b4c787c301 --- /dev/null +++ b/types/amap-js-api-place-search/amap-js-api-place-search-tests.ts @@ -0,0 +1,435 @@ +declare const map: AMap.Map; +declare const div: HTMLElement; +declare const lnglat: AMap.LngLat; +declare const lnglatTuple: [number, number]; +declare const bounds: AMap.Bounds; +declare const polygon: AMap.Polygon; +declare const lang: AMap.Lang; + +// $ExpectType PlaceSearch +const placeSearch = new AMap.PlaceSearch(); +// $ExpectType PlaceSearch +new AMap.PlaceSearch({}); +// $ExpectType PlaceSearch +new AMap.PlaceSearch({ + city: '深圳', + citylimit: true, + children: 1, + type: '餐饮服务', + lang: 'zh_cn', + pageSize: 10, + pageIndex: 10, + extensions: 'all', + map, + panel: div, + showCover: true, + renderStyle: 'newpc', + autoFitView: true +}); + +// $ExpectType void +placeSearch.search('keyword', (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + // $ExpectType string | SearchResult + result; + if (typeof result !== 'string') { + // $ExpectType string + result.info; + // $ExpectType PoiList + result.poiList; + // $ExpectType string[] | undefined + result.keywordList; + // $ExpectType CityInfo[] | undefined + result.cityList; + + const poiList = result.poiList; + // $ExpectType number + poiList.pageIndex; + // $ExpectType number + poiList.pageSize; + // $ExpectType number + poiList.count; + + const poi = poiList.pois[0]; + // $ExpectType string + poi.address; + // $ExpectType number + poi.distance; + // $ExpectType string + poi.id; + // $ExpectType LngLat | null + poi.location; + // $ExpectType string + poi.name; + // $ExpectType string + poi.shopinfo; + // $ExpectType string + poi.tel; + // $ExpectType string + poi.type; + if ('website' in poi) { + // $ExpectType string + poi.adcode; + // $ExpectType string + poi.adname; + // $ExpectType string + poi.citycode; + // $ExpectType string + poi.cityname; + // $ExpectType boolean + poi.discount; + // $ExpectType string + poi.email; + // $ExpectType LngLat | null + poi.entr_location; + // $ExpectType LngLat | null + poi.exit_location; + // $ExpectType boolean + poi.groupbuy; + if (poi.indoor_map) { + const indoorData = poi.indoor_data; + // $ExpectType string + indoorData.cpid; + // $ExpectType string + indoorData.floor; + // $ExpectType string + indoorData.truefloor; + } + poi.pcode; + // $ExpectType PoiPhoto[] + poi.photos; + // $ExpectType string + poi.pname; + // $ExpectType string + poi.postcode; + // $ExpectType string + poi.website; + + const photo = poi.photos[0]; + // $ExpectType string + photo.title; + // $ExpectType string + photo.url; + // $ExpectType Groupbuy[] | undefined + poi.groupbuys; + if (poi.groupbuys) { + const groupbuy = poi.groupbuys[0]; + // $ExpectType string + groupbuy.title; + // $ExpectType string + groupbuy.type_code; + // $ExpectType string + groupbuy.type; + // $ExpectType string + groupbuy.detail; + // $ExpectType string + groupbuy.stime; + // $ExpectType string + groupbuy.etime; + // $ExpectType number + groupbuy.count; + // $ExpectType number + groupbuy.sold_num; + // $ExpectType number + groupbuy.original_price; + // $ExpectType number + groupbuy.groupbuy_price; + // $ExpectType number + groupbuy.discount; + // $ExpectType string + groupbuy.ticket_address; + // $ExpectType string + groupbuy.ticket_tel; + // $ExpectType PoiPhoto[] + groupbuy.photos; + // $ExpectType string + groupbuy.url; + // $ExpectType string + groupbuy.provider; + } + // $ExpectType Discount[] | undefined + poi.discounts; + if (poi.discounts) { + const discount = poi.discounts[0]; + // $ExpectType string + discount.title; + // $ExpectType string + discount.detail; + // $ExpectType string + discount.start_time; + // $ExpectType string + discount.end_time; + // $ExpectType number + discount.sold_num; + // $ExpectType PoiPhoto[] + discount.photos; + // $ExpectType string + discount.url; + // $ExpectType string + discount.provider; + } + if (poi.deep_type === 'CINEMA') { + // $ExpectType Cinema + const cinema = poi.cinema; + // $ExpectType string + cinema.intro; + // $ExpectType string + cinema.rating; + // $ExpectType string + cinema.deep_src; + // $ExpectType string + cinema.parking; + // $ExpectType string + cinema.opentime_GDF; + // $ExpectType string + cinema.opentime; + // $ExpectType PoiPhoto[] + cinema.photos; + } + if (poi.deep_type === 'DINING') { + // $ExpectType Dining + const dining = poi.dining; + // $ExpectType string + dining.cuisines; + // $ExpectType string + dining.tag; + // $ExpectType string + dining.intro; + // $ExpectType string + dining.rating; + // $ExpectType string + dining.cp_rating; + // $ExpectType string + dining.deep_src; + // $ExpectType string + dining.taste_rating; + // $ExpectType string + dining.environment_rating; + // $ExpectType string + dining.service_rating; + // $ExpectType string + dining.cost; + // $ExpectType string + dining.recommend; + // $ExpectType string + dining.atmosphere; + // $ExpectType string + dining.ordering_wap_url; + // $ExpectType string + dining.ordering_web_url; + // $ExpectType string + dining.ordering_app_url; + // $ExpectType string + dining.opentime_GDF; + // $ExpectType string + dining.opentime; + // $ExpectType string + dining.addition; + // $ExpectType PoiPhoto[] + dining.photos; + } + if (poi.deep_type === 'SCENIC') { + // $ExpectType Scenic + const scenic = poi.scenic; + // $ExpectType string + scenic.intro; + // $ExpectType string + scenic.rating; + // $ExpectType string + scenic.deep_src; + // $ExpectType string + scenic.level; + // $ExpectType string + scenic.price; + // $ExpectType string + scenic.season; + // $ExpectType string + scenic.recommend; + // $ExpectType string + scenic.theme; + // $ExpectType string + scenic.ordering_wap_url; + // $ExpectType string + scenic.ordering_web_url; + // $ExpectType string + scenic.opentime_GDF; + // $ExpectType string + scenic.opentime; + // $ExpectType PoiPhoto[] + scenic.photos; + } + if (poi.deep_type === 'HOTEL') { + // $ExpectType Hotel + const hotel = poi.hotel; + // $ExpectType string + hotel.rating; + // $ExpectType string + hotel.star; + // $ExpectType string + hotel.intro; + // $ExpectType string + hotel.lowest_price; + // $ExpectType string + hotel.faci_rating; + // $ExpectType string + hotel.health_rating; + // $ExpectType string + hotel.environment_rating; + // $ExpectType string + hotel.service_rating; + // $ExpectType string + hotel.traffic; + // $ExpectType string + hotel.addition; + // $ExpectType string + hotel.deep_src; + // $ExpectType PoiPhoto[] + hotel.photos; + } + } + + if (result.cityList) { + const city = result.cityList[0]; + // $ExpectType string + city.adcode; + // $ExpectType string + city.citycode; + // $ExpectType number + city.count; + // $ExpectType string + city.name; + } + } else { + // $ExpectType string + result; + } +}); + +// $ExpectType void +placeSearch.searchNearBy('keyword', lnglat, 10, (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + // $ExpectType string | SearchResult + result; +}); +// $ExpectType void +placeSearch.searchNearBy('keyword', lnglatTuple, 10, () => { }); + +// $ExpectType void +placeSearch.searchInBounds('keyword', bounds, (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + // $ExpectType string | SearchResult + result; +}); +// $ExpectType void +placeSearch.searchInBounds('keyword', polygon, () => { }); + +// $ExpectType void +placeSearch.getDetails('id', (status, result) => { + const temp: 'error' | 'complete' | 'no_data' = status; + // $ExpectType string | SearchResult + result; +}); + +// $ExpectType void +placeSearch.setType('type'); +// $ExpectType void +placeSearch.setType(); + +// $ExpectType void +placeSearch.setCityLimit(true); +// $ExpectType void +placeSearch.setCityLimit(); + +// $ExpectType void +placeSearch.setPageIndex(1); +// $ExpectType void +placeSearch.setPageIndex(); + +// $ExpectType void +placeSearch.setPageSize(1); +// $ExpectType void +placeSearch.setPageSize(); + +// $ExpectType void +placeSearch.setCity('city'); +// $ExpectType void +placeSearch.setCity(); + +// $ExpectType void +placeSearch.setLang(lang); +// $ExpectType void +placeSearch.setLang(); + +// $ExpectType "zh_cn" | "en" | "zh_en" | undefined +placeSearch.getLang(); + +// $ExpectType void +placeSearch.clear(); + +// $ExpectType void +placeSearch.poiOnAMAP({ + id: 'id', +}); +// $ExpectType void +placeSearch.poiOnAMAP({ + location: lnglat, + id: 'id', + name: 'name' +}); + +// $ExpectType void +placeSearch.detailOnAMAP({ + id: 'id', +}); +// $ExpectType void +placeSearch.detailOnAMAP({ + location: lnglat, + id: 'id', + name: 'name' +}); + +// $ExpectType void +placeSearch.open(); + +// $ExpectType void +placeSearch.close(); + +placeSearch.on('complete', (event: AMap.PlaceSearch.EventMap['complete']) => { + // $ExpectType "complete" + event.type; + // $ExpectType string + event.info; + // $ExpectType PoiList + event.poiList; + // $ExpectType string[] | undefined + event.keywordList; + // $ExpectType CityInfo[] | undefined + event.cityList; +}); + +placeSearch.on('listElementClick', (event: AMap.PlaceSearch.EventMap['listElementClick']) => { + // $ExpectType MouseEvent + event.event; + // $ExpectType string + event.id; + // $ExpectType number + event.index; + // $ExpectType Marker + event.marker; + // $ExpectType HTMLLIElement + event.listElement; +}); + +placeSearch.on('markerClick', (event: AMap.PlaceSearch.EventMap['markerClick']) => { + const markerEvent = event.event; + // $ExpectType Marker + markerEvent.target; + // $ExpectType string + event.id; + // $ExpectType number + event.index; + // $ExpectType Marker + event.marker; + // $ExpectType HTMLLIElement + event.listElement; +}); diff --git a/types/amap-js-api-place-search/index.d.ts b/types/amap-js-api-place-search/index.d.ts new file mode 100644 index 0000000000..4a333f3b2b --- /dev/null +++ b/types/amap-js-api-place-search/index.d.ts @@ -0,0 +1,737 @@ +// Type definitions for non-npm package amap-js-api-place-search 1.4 +// Project: https://lbs.amap.com/api/javascript-api/reference/search#m_AMap.PlaceSearch +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +declare namespace AMap { + namespace PlaceSearch { + interface EventMap { + complete: Event<'complete', SearchResult>; + error: Event<'error', { info: string }>; + selectChanged: Event<'selectChanged', { + selected: SelectChangeEventData | EventMap['markerClick'] | EventMap['listElementClick']; + lastSelected: SelectChangeEventData | EventMap['markerClick'] | EventMap['listElementClick'] | null; + }>; + listElementClick: SelectChangeEvent<'listElementClick', MouseEvent>; + markerClick: SelectChangeEvent<'markerClick', Marker.EventMap['click']>; + // internal + renderComplete: Event<'renderComplete', { + result: SelectChangeEventData[]; + markers: Marker[]; + listElements: HTMLElement[]; + }>; + infoWindowClick: Event<'infoWindowClick', SelectChangeEventData & { + event: MouseEvent; + infoWindow: InfoWindow; + infoWindowContentDom: HTMLDivElement; + }>; + willClear: Event<'willClear', { + id: string; + index: number; + data: Poi[]; + }>; + markerDestoryed: Event<'markerDestoryed', SelectChangeEventData>; // typo in source code + listElementDetroyed: Event<'listElementDetroyed', SelectChangeEventData>; // typo too + } + + interface SelectChangeEventData { + /** + * 当前选中的POI的ID + */ + id: string; + /** + * 索引 + */ + index: number; + /** + * 当前选中的POI对应的在地图中的Marker对象 + */ + marker: Marker; + /** + * 当前选中的POI在结果面板中对应的列表项 + */ + listElement: HTMLLIElement; + /** + * 当前选中的POI的信息 + */ + data: Poi[]; + } + type SelectChangeEvent = Event; + interface PoiPhoto { + /** + * 图片名称 + */ + title: string; + /** + * 图片url + */ + url: string; + } + interface PoiBase { + /** + * 全局唯一ID + */ + id: string; + /** + * 名称 + */ + name: string; + /** + * 兴趣点类型 + */ + type: string; + /** + * 兴趣点经纬度 + */ + location: LngLat | null; + /** + * 地址 + */ + address: string; + /** + * 离中心点距离 + */ + distance: number; + /** + * 电话 + */ + tel: string; + shopinfo: string; + children?: any[]; // TODO Array<{location: LngLat | null}> + } + 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: PoiPhoto[]; + /** + * 来源url + */ + url: string; + /** + * 来源标识 + */ + provider: string; + } + interface Discount { + /** + * 优惠标题 + */ + title: string; + /** + * 优惠详情 + */ + detail: string; + /** + * 开始时间 + */ + start_time: string; + /** + * 结束时间 + */ + end_time: string; + /** + * 已卖出数量 + */ + sold_num: number; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + /** + * 来源url + */ + url: string; + /** + * 来源标识 + */ + provider: string; + } + interface Cinema { + /** + * 简介 + */ + intro: string; + /** + * 综合评分 + */ + rating: string; + /** + * 信息来源 + */ + deep_src: string; + /** + * 停车场设施 + */ + parking: string; + /** + * 规范格式的营业时间 + */ + opentime_GDF: string; + /** + * 非规范格式的营业时间 + */ + opentime: string; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + } + interface Dining { + /** + * 菜系 + */ + cuisines: string; + /** + * 标签 + */ + tag: string; + /** + * 简介 + */ + intro: string; + /** + * 综合评分 + */ + rating: string; + /** + * 单数据源的评分 + */ + cp_rating: string; + /** + * 信息来源 + */ + deep_src: string; + /** + * 口味评分 + */ + taste_rating: string; + /** + * 环境评分 + */ + environment_rating: string; + /** + * 服务评分 + */ + service_rating: string; + /** + * 人均消费 + */ + cost: string; + /** + * 特色菜 + */ + recommend: string; + /** + * 氛围 + */ + atmosphere: string; + /** + * 订餐wap链接 + */ + ordering_wap_url: string; + /** + * 订餐web链接 + */ + ordering_web_url: string; + /** + * 订餐APP URL + */ + ordering_app_url: string; + /** + * 规范格式的营业时间 + */ + opentime_GDF: string; + /** + * 非规范格式的营业时间 + */ + opentime: string; + /** + * 餐厅特色 + */ + addition: string; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + } + interface Scenic { + /** + * 简介 + */ + intro: string; + /** + * 综合评分 + */ + rating: string; + /** + * 信息来源 + */ + deep_src: string; + /** + * 景区国标级别 + */ + level: string; + /** + * 门票价格 + */ + price: string; + /** + * 适合游玩的季节 + */ + season: string; + /** + * 推荐景点 + */ + recommend: string; + /** + * 景区主题 + */ + theme: string; + /** + * wap购票链接 + */ + ordering_wap_url: string; + /** + * web购票链接 + */ + ordering_web_url: string; + /** + * 规范格式的营业时间 + */ + opentime_GDF: string; + /** + * 非规范格式的营业时间 + */ + opentime: string; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + } + interface Hotel { + /** + * 综合评分 + */ + rating: string; + /** + * 星级 + */ + star: string; + /** + * 简介 + */ + intro: string; + /** + * 最低房价 + */ + lowest_price: string; + /** + * 设施评分 + */ + faci_rating: string; + /** + * 卫生评分 + */ + health_rating: string; + /** + * 环境评分 + */ + environment_rating: string; + /** + * 服务评分 + */ + service_rating: string; + /** + * 交通提示 + */ + traffic: string; + /** + * 特色服务 + */ + addition: string; + /** + * 信息来源 + */ + deep_src: string; + /** + * 图片信息列表 + */ + photos: PoiPhoto[]; + } + type PoiExt = PoiBase & { + /** + * 网址 + */ + website: string; + /** + * 所在省份编码 + */ + pcode: string; + /** + * 所在城市编码 + */ + citycode: string; + /** + * 所在区域编码 + */ + adcode: string; + /** + * 邮编 + */ + postcode: string; + /** + * 所在省份 + */ + pname: string; + /** + * 所在城市名称 + */ + cityname: string; + /** + * 所在行政区名称 + */ + adname: string; + /** + * 电子邮箱 + */ + email: string; + /** + * 照片 + */ + photos: PoiPhoto[]; + /** + * 入口经纬度 + */ + entr_location: LngLat | null; + /** + * 出口经纬度 + */ + exit_location: LngLat | null; + /** + * @deprecated 是否有团购信息 + */ + groupbuy: boolean; + /** + * @deprecated 是否有优惠信息 + */ + discount: boolean; + } & ({ + indoor_map: true; + indoor_data: { + cpid: string; + floor: string; + truefloor: string; + }; + } | { + indoor_map: false; + }) & { + /** + * @deprecated 团购信息 + */ + groupbuys?: Groupbuy[]; + /** + * @deprecated 优惠信息 + */ + discounts?: Discount[]; + } & ({ + deep_type: 'CINEMA'; + /** + * @deprecated 影院类深度信息 + */ + cinema: Cinema; + } | { + deep_type: 'DINING'; + /** + * @deprecated 餐饮类深度信息 + */ + dining: Dining; + } | { + deep_type: 'SCENIC'; + /** + * @deprecated 景点类深度信息 + */ + scenic: Scenic; + } | { + deep_type: 'HOTEL'; + /** + * @deprecated 酒店类深度信息 + */ + hotel: Hotel; + }); + interface Options { + /** + * 兴趣点城市 + */ + city?: string; + /** + * 是否强制限制在设置的城市内搜索 + */ + citylimit?: boolean; + /** + * 是否按照层级展示子POI数据 + * children=1,展示子节点POI数据,children=0,不展示子节点数据 + */ + children?: number; + /** + * 兴趣点类别,多个类别用“|”分割 + */ + type?: string; + /** + * 检索语言类型 + */ + lang?: Lang; + /** + * 单页显示结果条数 + */ + pageSize?: number; + /** + * 页码 + */ + pageIndex?: number; + /** + * 是否返回详细信息 + * base返回基本地址信息;all返回基本+详细信息 + */ + extensions?: 'base' | 'all'; + /** + * Map对象 + */ + map?: Map; + /** + * 结果列表的HTML容器id或容器元素 + */ + panel?: string | HTMLElement; + /** + * 是否在地图上显示周边搜索的圆或者范围搜索的多边形 + */ + showCover?: boolean; + /** + * 绘制的UI风格 + */ + renderStyle?: 'newpc' | 'default'; + /** + * 是否自动调整地图视野使绘制的Marker点都处于视口的可见范围 + */ + autoFitView?: boolean; + + // internal + renderEngine?: string; + rankBy?: string; + } + interface PoiList { + /** + * Poi列表 + */ + pois: Poi[]; // PlaceSearchPoiBase[] | PlaceSearchPoiExt[]; + /** + * 页码 + */ + 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[]; + } + type Poi = PoiBase | PoiExt; + type SearchStatus = 'complete' | 'error' | 'no_data'; + } + class PlaceSearch extends EventEmitter { + /** + * 地点搜索服务 + * @param options 选项 + */ + constructor(options?: PlaceSearch.Options); + /** + * 根据关键字搜索 + * @param keyword 根据关键字搜索 + * @param callback 回调 + */ + search( + keyword: string, + callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void + ): void; + /** + * 周边查询 + * @param keyword 关键字 + * @param center 搜索中心 + * @param radius 搜索半径 + * @param callback 回调 + */ + searchNearBy( + keyword: string, + center: LocationValue, + radius: number, + callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void + ): void; + /** + * 根据范围和关键词进行范围查询 + * @param keyword 关键字 + * @param bounds 搜索范围 + * @param callback 回调 + */ + searchInBounds( + keyword: string, + bounds: Bounds | Polygon, + callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void + ): void; + /** + * 根据POIID 查询POI 详细信息 + * @param POIID POIID + * @param callback 搜索回调 + */ + getDetails( + POIID: string, + callback: (status: PlaceSearch.SearchStatus, result: string | PlaceSearch.SearchResult) => void + ): void; + /** + * 设置查询类别 + * @param type 查询类别 + */ + setType(type?: string): void; + /** + * 设置是否强制限制城市 + * @param limit 是否强制限制城市 + */ + setCityLimit(limit?: boolean): void; + /** + * 设置查询结果特定页数 + * @param pageIndex 页码 + */ + setPageIndex(pageIndex?: number): void; + /** + * 设置查询单页结果数 + * @param pageSize 结果数 + */ + setPageSize(pageSize?: number): void; + /** + * 设置查询城市 + * @param city 城市 + */ + setCity(city?: string): void; + /** + * 设置检索语言类型 + * @param lang 语言类型 + */ + setLang(lang?: Lang): void; + /** + * 获取检索语言类型 + */ + getLang(): Lang | undefined; + /** + * 清除搜索结果 + */ + clear(): void; + /** + * 唤起高德地图客户端marker页 + * @param obj 唤起参数 + */ + poiOnAMAP(obj: { location?: LocationValue; id: string; name?: string; }): void; + /** + * 唤起高德地图客户端POI详情页 + * @param obj 唤起参数 + */ + detailOnAMAP(obj: { location?: LocationValue; id: string; name?: string; }): void; + + // internal + open(): void; + close(): void; + } +} diff --git a/types/amap-js-api-place-search/tsconfig.json b/types/amap-js-api-place-search/tsconfig.json new file mode 100644 index 0000000000..e3259e1b01 --- /dev/null +++ b/types/amap-js-api-place-search/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amap-js-api-place-search-tests.ts" + ] +} diff --git a/types/opn/tslint.json b/types/amap-js-api-place-search/tslint.json similarity index 100% rename from types/opn/tslint.json rename to types/amap-js-api-place-search/tslint.json diff --git a/types/amap-js-api/amap-js-api-tests.ts b/types/amap-js-api/amap-js-api-tests.ts new file mode 100644 index 0000000000..0a2c1426b2 --- /dev/null +++ b/types/amap-js-api/amap-js-api-tests.ts @@ -0,0 +1,3421 @@ +/** + * preset.ts + */ + +declare const map: AMap.Map; +declare const lnglat: AMap.LngLat; +declare const size: AMap.Size; +declare const lnglatTuple: [number, number]; +declare const pixel: AMap.Pixel; +declare const markerShape: AMap.MarkerShape; +declare const icon: AMap.Icon; +declare const bounds: AMap.Bounds; +declare const div: HTMLDivElement; +declare const lang: AMap.Lang; +declare const domEle: HTMLElement; +declare const canvasEle: HTMLCanvasElement; +declare const imgEle: HTMLImageElement; + +declare const circle: AMap.Circle; +declare const marker: AMap.Marker; +declare const layer: AMap.Layer; +declare const tileLayer: AMap.TileLayer; +declare const massMarksLayer: AMap.MassMarks; + +// declare const videoLayer: AMap.VideoLayer; +// declare const buildings: AMap.Buildings; +// declare const canvasLayer: AMap.CanvasLayer; +// declare const flexible: AMap.TileLayer.Flexible; +// declare const imageLayer: AMap.ImageLayer; +// declare const tileLayerGroup: AMap.LayerGroup; +// declare const layerGroup: AMap.LayerGroup; +// declare const trafficLayer: AMap.TileLayer.Traffic; +// declare const bezierCurve: AMap.BezierCurve; +// declare const contextMenu: AMap.ContextMenu; +// declare const polyline: AMap.Polyline; +// declare const polygon: AMap.Polygon; + +/** + * arryBounds.ts + */ + +// $ExpectType ArrayBounds +const testArrayBounds = new AMap.ArrayBounds([lnglat, lnglat, lnglat]); + +// $ExpectType LngLat[] +testArrayBounds.bounds; + +// $ExpectType boolean +testArrayBounds.contains(lnglat); + +// $ExpectType Bounds +testArrayBounds.toBounds(); + +// $ExpectType LngLat +testArrayBounds.getCenter(); + +/** + * bounds.ts + */ + +// $ExpectType Bounds +const testBounds = new AMap.Bounds(lnglat, lnglat); + +// $ExpectType boolean +testBounds.contains(lnglat); +// $ExpectType boolean +testBounds.contains(lnglatTuple); + +// $ExpectType LngLat +testBounds.getCenter(); + +// $ExpectType LngLat +testBounds.getSouthWest(); + +// $ExpectType LngLat +testBounds.getSouthEast(); + +// $ExpectType LngLat +testBounds.getNorthEast(); + +// $ExpectType LngLat +testBounds.getNorthWest(); + +// $ExpectType string +testBounds.toString(); + +/** + * browser.ts + */ + +const brwoser = AMap.Browser; + +// $ExpectType string +brwoser.ua; + +// $ExpectType boolean +brwoser.mobile; + +const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other' = brwoser.plat; + +// $ExpectType boolean +brwoser.mac; + +// $ExpectType boolean +brwoser.windows; + +// $ExpectType boolean +brwoser.ios; + +// $ExpectType boolean +brwoser.iPad; + +// $ExpectType boolean +brwoser.iPhone; + +// $ExpectType boolean +brwoser.android; + +// $ExpectType boolean +brwoser.android23; + +// $ExpectType boolean +brwoser.chrome; + +// $ExpectType boolean +brwoser.firefox; + +// $ExpectType boolean +brwoser.safari; + +// $ExpectType boolean +brwoser.wechat; + +// $ExpectType boolean +brwoser.uc; + +// $ExpectType boolean +brwoser.qq; + +// $ExpectType boolean +brwoser.ie; + +// $ExpectType boolean +brwoser.ie6; + +// $ExpectType boolean +brwoser.ie7; + +// $ExpectType boolean +brwoser.ie8; + +// $ExpectType boolean +brwoser.ie9; + +// $ExpectType boolean +brwoser.ie10; + +// $ExpectType boolean +brwoser.ie11; + +// $ExpectType boolean +brwoser.edge; + +// $ExpectType boolean +brwoser.ielt9; + +// $ExpectType boolean +brwoser.baidu; + +// $ExpectType boolean +brwoser.isLocalStorage; + +// $ExpectType boolean +brwoser.isGeolocation; + +// $ExpectType boolean +brwoser.mobileWebkit; + +// $ExpectType boolean +brwoser.mobileWebkit3d; + +// $ExpectType boolean +brwoser.mobileOpera; + +// $ExpectType boolean +brwoser.retina; + +// $ExpectType boolean +brwoser.touch; + +// $ExpectType boolean +brwoser.msPointer; + +// $ExpectType boolean +brwoser.pointer; + +// $ExpectType boolean +brwoser.webkit; + +// $ExpectType boolean +brwoser.ie3d; + +// $ExpectType boolean +brwoser.webkit3d; + +// $ExpectType boolean +brwoser.gecko3d; + +// $ExpectType boolean +brwoser.opera3d; + +// $ExpectType boolean +brwoser.any3d; + +// $ExpectType boolean +brwoser.isCanvas; + +// $ExpectType boolean +brwoser.isSvg; + +// $ExpectType boolean +brwoser.isVML; + +// $ExpectType boolean +brwoser.isWorker; + +// $ExpectType boolean +brwoser.isWebsocket; + +// $ExpectType boolean +brwoser.isWebGL(); + +/** + * convert-from.ts + */ + +declare const convertType: 'baidu' | 'mapbar' | 'gps' | null; +// $ExpectType void +AMap.convertFrom(lnglat, convertType, (status, result) => { + const temp: 'complete' | 'error' = status; + if (typeof result !== 'string') { + // $ExpectType string + result.info; + // $ExpectType LngLat[] + result.locations; + } else { + // $ExpectType string + result; + } +}); +// $ExpectType void +AMap.convertFrom([lnglat], null, () => { }); +// $ExpectType void +AMap.convertFrom(lnglatTuple, null, () => { }); +// $ExpectType void +AMap.convertFrom([lnglatTuple], null, () => { }); + +/** + * dom-util.ts + */ + +const domUtil = AMap.DomUtil; + +// $ExpectType Size +domUtil.getViewport(div); + +// $ExpectType Pixel +domUtil.getViewportOffset(div); + +// $ExpectType HTMLDivElement +domUtil.create('div'); +// $ExpectType HTMLAnchorElement +domUtil.create('a'); +// $ExpectType HTMLDivElement +domUtil.create('div', div); +// $ExpectType HTMLDivElement +domUtil.create('div', div, 'className'); + +// $ExpectType void +domUtil.setClass(div); +// $ExpectType void +domUtil.setClass(div, 'className'); + +// $ExpectType boolean +domUtil.hasClass(div, 'className'); + +// $ExpectType void +domUtil.removeClass(div, 'className'); + +// $ExpectType void +domUtil.setOpacity(div, 1); + +// $ExpectType void +domUtil.rotate(div, 10); +// $ExpectType void +domUtil.rotate(div, 10, { x: 10, y: 10 }); + +const util2: typeof AMap.DomUtil = domUtil.setCss(div, { textAlign: 'left' }); +// $ExpectError +domUtil.setCss(div, { textAlign: 10 }); + +// $ExpectType void +domUtil.empty(div); + +// $ExpectType void +domUtil.remove(div); + +/** + * event.ts + */ + +// $ExpectType Map +map.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; +}); + +// $ExpectType EventListener<0> +AMap.event.addDomListener(div, 'click', event => { + // $ExpectType number + event.clientX; +}); + +// $ExpectType EventListener<1> +AMap.event.addListener(map, 'hotspotclick', function(event: AMap.Map.EventMap['hotspotclick']) { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType number + this.test; +}, { test: 1 }); +AMap.event.addListener(map, 'click', (event: AMap.Map.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Map + event.target; +}); + +// $ExpectType EventListener<1> +const eventListener = AMap.event.addListenerOnce(map, 'hotspotclick', function(event: AMap.Map.EventMap['hotspotclick']) { + // $ExpectType "hotspotclick" + event.type; + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType number + this.test; +}, { test: 1 }); + +// $ExpectType void +AMap.event.removeListener(eventListener); + +// $ExpectType void +AMap.event.trigger(map, 'click', { + lnglat, + pixel, + target: map +}); +// $ExpectType void +AMap.event.trigger(map, 'hotspotclick', { + lnglat, + name: 'name', + id: 'id', + isIndoorPOI: true +}); +// $ExpectType void +AMap.event.trigger(map, 'complete'); + +/** + * geometry-util.ts + */ + +{ + const point = lnglat; + const pointTuple = lnglatTuple; + const line = [point]; + const lineTuple = [pointTuple]; + const ring = [point]; + const ringTuple = [pointTuple]; + const polygon = [ring]; + const polygonTuple = [ringTuple]; + const geometryUtil = AMap.GeometryUtil; + + // $ExpectType number + geometryUtil.distance(point, point); + // $ExpectType number + geometryUtil.distance(pointTuple, pointTuple); + // $ExpectType number + geometryUtil.distance(point, line); + // $ExpectType number + geometryUtil.distance(pointTuple, lineTuple); + + // $ExpectType number + geometryUtil.ringArea(ring); + // $ExpectType number + geometryUtil.ringArea(ringTuple); + + // $ExpectType boolean + geometryUtil.isClockwise(ring); + // $ExpectType boolean + geometryUtil.isClockwise(ringTuple); + + // $ExpectType number + geometryUtil.distanceOfLine(line); + // $ExpectType number + geometryUtil.distanceOfLine(lineTuple); + + // $ExpectType [number, number][] + geometryUtil.ringRingClip(ring, ring); + // $ExpectType [number, number][] + geometryUtil.ringRingClip(ringTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.doesRingRingIntersect(ring, ring); + // $ExpectType boolean + geometryUtil.doesRingRingIntersect(ringTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.doesLineRingIntersect(line, ring); + // $ExpectType boolean + geometryUtil.doesLineRingIntersect(lineTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.doesLineLineIntersect(line, line); + // $ExpectType boolean + geometryUtil.doesLineLineIntersect(lineTuple, lineTuple); + + // $ExpectType boolean + geometryUtil.doesSegmentPolygonIntersect(point, point, polygon); + // $ExpectType boolean + geometryUtil.doesSegmentPolygonIntersect(pointTuple, pointTuple, polygonTuple); + + // $ExpectType boolean + geometryUtil.doesSegmentRingIntersect(point, point, ring); + // $ExpectType boolean + geometryUtil.doesSegmentRingIntersect(pointTuple, pointTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.doesSegmentLineIntersect(point, point, line); + // $ExpectType boolean + geometryUtil.doesSegmentLineIntersect(pointTuple, pointTuple, lineTuple); + + // $ExpectType boolean + geometryUtil.doesSegmentsIntersect(point, point, point, point); + // $ExpectType boolean + geometryUtil.doesSegmentsIntersect(pointTuple, pointTuple, pointTuple, pointTuple); + + // $ExpectType boolean + geometryUtil.isPointInRing(point, ring); + // $ExpectType boolean + geometryUtil.isPointInRing(pointTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.isRingInRing(ring, ring); + // $ExpectType boolean + geometryUtil.isRingInRing(ringTuple, ringTuple); + + // $ExpectType boolean + geometryUtil.isPointInPolygon(point, polygon); + // $ExpectType boolean + geometryUtil.isPointInPolygon(pointTuple, polygonTuple); + + // $ExpectType [number, number][] + geometryUtil.makesureClockwise(lineTuple); + + // $ExpectType [number, number][] + geometryUtil.makesureAntiClockwise(lineTuple); + + // $ExpectType [number, number] + geometryUtil.closestOnSegment(point, point, point); + // $ExpectType [number, number] + geometryUtil.closestOnSegment(pointTuple, pointTuple, pointTuple); + + // $ExpectType [number, number] + geometryUtil.closestOnSegment(point, point, point); + // $ExpectType [number, number] + geometryUtil.closestOnSegment(pointTuple, pointTuple, pointTuple); + + // $ExpectType [number, number] + geometryUtil.closestOnLine(point, line); + // $ExpectType [number, number] + geometryUtil.closestOnLine(pointTuple, lineTuple); + + // $ExpectType number + geometryUtil.distanceToSegment(point, point, point); + // $ExpectType number + geometryUtil.distanceToSegment(pointTuple, pointTuple, pointTuple); + + // $ExpectType number + geometryUtil.distanceToLine(point, line); + // $ExpectType number + geometryUtil.distanceToLine(pointTuple, lineTuple); + + // $ExpectType boolean + geometryUtil.isPointOnSegment(point, point, point); + // $ExpectType boolean + geometryUtil.isPointOnSegment(point, point, point, 1); + // $ExpectType boolean + geometryUtil.isPointOnSegment(pointTuple, pointTuple, pointTuple); + // $ExpectType boolean + geometryUtil.isPointOnSegment(pointTuple, pointTuple, pointTuple, 1); + + // $ExpectType boolean + geometryUtil.isPointOnLine(point, line); + // $ExpectType boolean + geometryUtil.isPointOnLine(point, line, 1); + // $ExpectType boolean + geometryUtil.isPointOnLine(pointTuple, lineTuple); + // $ExpectType boolean + geometryUtil.isPointOnLine(pointTuple, lineTuple, 1); + + // $ExpectType boolean + geometryUtil.isPointOnRing(point, ring); + // $ExpectType boolean + geometryUtil.isPointOnRing(point, ring, 1); + // $ExpectType boolean + geometryUtil.isPointOnRing(pointTuple, ringTuple); + // $ExpectType boolean + geometryUtil.isPointOnRing(pointTuple, ringTuple, 1); + + // $ExpectType boolean + geometryUtil.isPointOnPolygon(point, polygon); + // $ExpectType boolean + geometryUtil.isPointOnPolygon(point, polygon, 1); + // $ExpectType boolean + geometryUtil.isPointOnPolygon(pointTuple, polygonTuple); + // $ExpectType boolean + geometryUtil.isPointOnPolygon(pointTuple, polygonTuple, 1); +} + +/** + * lnglat.ts + */ + +// $ExpectType LngLat +new AMap.LngLat(114, 22); +// $ExpectType LngLat +const testLnglat = new AMap.LngLat(113, 21); + +// $ExpectType LngLat +testLnglat.offset(1, 2); + +// $ExpectType number +testLnglat.distance(testLnglat); +// $ExpectType number +testLnglat.distance([testLnglat]); + +// $ExpectType number +testLnglat.getLng(); + +// $ExpectType number +testLnglat.getLat(); + +// $ExpectType boolean +testLnglat.equals(testLnglat); + +// $ExpectType string +testLnglat.toString(); + +// $ExpectType LngLat +testLnglat.add(testLnglat); +// $ExpectType LngLat +testLnglat.add(testLnglat, true); + +// $ExpectType LngLat +testLnglat.subtract(testLnglat); +// $ExpectType LngLat +testLnglat.subtract(testLnglat, true); + +// $ExpectType LngLat +testLnglat.divideBy(1); +// $ExpectType LngLat +testLnglat.divideBy(1, true); + +// $ExpectType LngLat +testLnglat.multiplyBy(1); +// $ExpectType LngLat +testLnglat.multiplyBy(1, true); + +/** + * map.ts + */ + +// $ExpectType Map +new AMap.Map('map'); +// $ExpectType Map +new AMap.Map(div); + +// $ExpectType Map +new AMap.Map(div, {}); + +// $ExpectType Map +const testMap = new AMap.Map(div, { + layers: [tileLayer], + zoom: 15, + center: [1, 2], + labelzIndex: 110, + zooms: [5, 15], + lang: 'zh_cn', + defaultCursor: 'default', + crs: 'EPSG4326', + animateEnable: true, + isHotspot: false, + defaultLayer: tileLayer, + rotateEnable: true, + resizeEnable: true, + showIndoorMap: true, + // indoorMap, // TODO + expandZoomRange: true, + dragEnable: true, + zoomEnable: true, + doubleClickZoom: true, + keyboardEnable: true, + jogEnable: true, + scrollWheel: true, + touchZoom: true, + mapStyle: '', + features: ['road'], + showBuildingBlock: true, + skyColor: '#fff', + preloadMode: true, + mask: [[1, 2], [2, 3], [3, 4]] +}); + +// $ExpectType number +testMap.getZoom(); + +// $ExpectType Layer[] +testMap.getLayers(); + +// $ExpectType LngLat +testMap.getCenter(); + +// $ExpectType HTMLElement | null +testMap.getContainer(); + +testMap.getCity(city => { + // $ExpectType string + city.city; + // $ExpectType string + city.citycode; + // $ExpectType string + city.district; + // $ExpectType string | never[] + city.province; +}); + +// $ExpectType Bounds +testMap.getBounds(); + +// $ExpectType number +testMap.getLabelzIndex(); + +// $ExpectType Lang +testMap.getLang(); + +// $ExpectType Size +testMap.getSize(); + +// $ExpectType number +testMap.getRotation(); + +// $ExpectType Status +const mapStatus = testMap.getStatus(); +// $ExpectType boolean +mapStatus.animateEnable; +// $ExpectType boolean +mapStatus.doubleClickZoom; +// $ExpectType boolean +mapStatus.dragEnable; +// $ExpectType boolean +mapStatus.isHotspot; +// $ExpectType boolean +mapStatus.jogEnable; +// $ExpectType boolean +mapStatus.keyboardEnable; +// $ExpectType boolean +mapStatus.pitchEnable; +// $ExpectType boolean +mapStatus.resizeEnable; +// $ExpectType boolean +mapStatus.rotateEnable; +// $ExpectType boolean +mapStatus.scrollWheel; +// $ExpectType boolean +mapStatus.touchZoom; +// $ExpectType boolean +mapStatus.zoomEnable; + +// $ExpectType string +testMap.getDefaultCursor(); + +// $ExpectType number +testMap.getResolution(); + +// $ExpectType number +testMap.getScale(); +// $ExpectType number +testMap.getScale(1); + +// $ExpectType void +testMap.setZoom(1); + +// $ExpectType void +testMap.setLabelzIndex(1); + +// $ExpectType void +testMap.setLayers([tileLayer]); + +// $ExpectType void +testMap.setCenter(lnglat); +// $ExpectType void +testMap.setCenter([1, 2]); + +// $ExpectType void +testMap.setZoomAndCenter(13, lnglat); +// $ExpectType void +testMap.setZoomAndCenter(13, [1, 2]); + +// $ExpectType void +testMap.setCity('city', (coord, zoom) => { + // $ExpectType string + coord[0]; + // $ExpectType string + coord[1]; + // $ExpectType number + zoom; +}); + +// $ExpectType Bounds +testMap.setBounds(bounds); + +// $ExpectType void +testMap.setLimitBounds(bounds); + +// $ExpectType void +testMap.clearLimitBounds(); + +// $ExpectType void +testMap.setLang('zh_cn'); + +// $ExpectType void +testMap.setRotation(1); + +// $ExpectType void +testMap.setStatus({}); +// $ExpectType void +testMap.setStatus({ + animateEnable: true, + doubleClickZoom: true, + dragEnable: true, + isHotspot: true, + jogEnable: true, + keyboardEnable: true, + pitchEnable: false, + resizeEnable: false, + rotateEnable: false, + scrollWheel: true, + touchZoom: true, + zoomEnable: true +}); + +// $ExpectType void +testMap.setDefaultCursor('default'); + +// $ExpectType void +testMap.zoomIn(); + +// $ExpectType void +testMap.zoomOut(); + +// $ExpectType void +testMap.panTo([1, 2]); +// $ExpectType void +testMap.panTo(lnglat); + +// $ExpectType void +testMap.panBy(1, 2); + +// $ExpectType void +testMap.clearMap(); + +// $ExpectType Map +testMap.plugin('plugin name', () => { }); +// $ExpectType Map +testMap.plugin(['plugin name'], () => { }); + +// $ExpectType void +testMap.clearInfoWindow(); + +// $ExpectType LngLat +testMap.pixelToLngLat(pixel); +// $ExpectType LngLat +testMap.pixelToLngLat(pixel, 1); + +// $ExpectType Pixel +testMap.lnglatToPixel(lnglat); +// $ExpectType Pixel +testMap.lnglatToPixel(lnglat, 1); + +// $ExpectType LngLat +testMap.containerToLngLat(pixel); + +// $ExpectType Pixel +testMap.lngLatToContainer(lnglat); +// $ExpectType Pixel +testMap.lnglatTocontainer(lnglat); + +// $ExpectType void +testMap.setMapStyle(''); +// $ExpectType string +testMap.getMapStyle(); + +// $ExpectType void +testMap.setFeatures('all'); +// $ExpectType void +testMap.setFeatures(['bg']); + +const feature: 'all' | 'bg' | 'point' | 'road' | 'building' | AMap.Map.Feature[] = testMap.getFeatures(); + +// $ExpectType void +testMap.setDefaultLayer(tileLayer); + +// $ExpectType void +testMap.setPitch(1); +// $ExpectType number +testMap.getPitch(); + +// $ExpectType ViewMode +testMap.getViewMode_(); + +// $ExpectType Pixel +testMap.lngLatToGeodeticCoord(lnglat); +// $ExpectType Pixel +testMap.lngLatToGeodeticCoord(lnglatTuple); + +// $ExpectType LngLat +testMap.geodeticCoordToLngLat(pixel); + +// $ExpectType void +testMap.destroy(); + +declare function dblClickHandler(this: AMap.Map, event: AMap.Map.EventMap['dblclick']): void; + +// $ExpectType Map +testMap.on('click', (event: AMap.Map.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Pixel + event.pixel; + // $ExpectType LngLat + event.lnglat; + // $ExpectType Map + event.target; +}); +// $ExpectType Map +testMap.on('dblclick', dblClickHandler); +// $ExpectType Map +testMap.on('complete', (event: AMap.Map.EventMap['complete']) => { + // $ExpectType "complete" + event.type; + // $ExpectError + event.value; +}); +// $ExpectType Map +testMap.on('hotspotclick', (event: AMap.Map.EventMap['hotspotclick']) => { + // $ExpectType string + event.id; + // $ExpectType LngLat + event.lnglat; + // $ExpectType string + event.name; + // $ExpectType "hotspotclick" + event.type; +}); +// $ExpectType Map +testMap.on('custom', (event: AMap.Event<'custom', { test: string }>) => { + // $ExpectType "custom" + event.type; + // $ExpectType string + event.test; +}); + +// $ExpectType Map +testMap.off('dblclick', dblClickHandler); +// $ExpectType Map +testMap.off('click', 'mv'); + +// $ExpectType Map +testMap.emit('click', { + target: testMap, + lnglat, + pixel +}); + +testMap.emit('complete'); +// $ExpectType Map +testMap.emit('hotspotclick', { + lnglat, + name: '123', + id: '123', + isIndoorPOI: true +}); +// $ExpectType Map +testMap.emit('custom', { + test: 1 +}); +// $ExpectType Map +testMap.emit('custom', undefined); + +/** + * pixel.ts + */ + +// $ExpectType Pixel +new AMap.Pixel(10, 20); +// $ExpectType Pixel +const testPixel = new AMap.Pixel(10, 20); + +// $ExpectType number +testPixel.getX(); + +// $ExpectType number +testPixel.getY(); + +// $ExpectType boolean +testPixel.equals(testPixel); + +// $ExpectType string +testPixel.toString(); + +// $ExpectType Pixel +testPixel.add({ x: 1, y: 2 }); +// $ExpectType Pixel +testPixel.add({ x: 1, y: 2 }, false); + +// $ExpectType Pixel +testPixel.round(); + +// $ExpectType Pixel +testPixel.floor(); + +// $ExpectType number +testPixel.length(); + +// $ExpectType number | null +testPixel.direction(); + +// $ExpectType Pixel +testPixel.toFixed(); +// $ExpectType Pixel +testPixel.toFixed(2); + +/** + * size.ts + */ + +// $ExpectType Size +const testSize = new AMap.Size(10, 20); + +// $ExpectType number +testSize.getHeight(); + +// $ExpectType number +testSize.getWidth(); + +// $ExpectType string +testSize.toString(); + +// $ExpectType boolean +testSize.contains({ x: 10, y: 10 }); + +/** + * util.ts + */ + +const util = AMap.Util; + +// $ExpectType string +util.colorNameToHex('colorName'); + +// $ExpectType string +util.rgbHex2Rgba('rgbHex'); + +// $ExpectType string +util.argbHex2Rgba('argbHex'); + +// $ExpectType boolean +util.isEmpty({}); +// $ExpectError +util.isEmpty(1); + +// $ExpectType number[] +util.deleteItemFromArray([1], 1); + +// $ExpectType number[] +util.deleteItemFromArrayByIndex([1], 1); + +// $ExpectType number +util.indexOf([1], 1); +// $ExpectError +util.indexOf([1], '1'); + +// $ExpectType number +util.format(1); +// $ExpectType number +util.format(1, 1); + +declare const value1: number | number[]; +// $ExpectType boolean +util.isArray(value1); +if (util.isArray(value1)) { + // $ExpectType number[] + value1; +} else { + // $ExpectType number + value1; +} + +declare const value2: number | HTMLElement; +// $ExpectType boolean +util.isDOM(value2); +if (util.isDOM(value2)) { + // $ExpectType HTMLElement + value2; +} else { + // $ExpectType number + value2; +} + +// $ExpectType boolean +util.includes([1], 1); +// $ExpectError +util.includes([1], '1'); + +// $ExpectType number +util.requestIdleCallback(() => { }); +// $ExpectType number +const idleCallbackHandle = util.requestIdleCallback(() => { }, { timeout: 1 }); + +// $ExpectType void +util.cancelIdleCallback(idleCallbackHandle); + +// $ExpectType number +util.requestAnimFrame(() => { }); +// $ExpectType number +const animFrameHandle = util.requestAnimFrame(function() { + // $ExpectType number + this.test; +}, { test: 1 }); + +// $ExpectType void +util.cancelAnimFrame(animFrameHandle); + +/** + * view2d.ts + */ + +// $ExpectType View2D +new AMap.View2D(); +// $ExpectType View2D +new AMap.View2D({}); + +// $ExpectType View2D +new AMap.View2D({ + center: [1, 2], + rotation: 1, + zoom: 10, + crs: 'EPGS3395' +}); + +// $ExpectType View2D +const testView2d = new AMap.View2D({ + center: lnglat +}); + +// $ExpectType View2D +testView2d.on('complete', () => { }); + +/** + * layer/buildings.ts + */ + +// $ExpectType Buildings +new AMap.Buildings(); +// $ExpectType Buildings +new AMap.Buildings(); +// $ExpectType Buildings +const testBuildings = new AMap.Buildings({ + zooms: [1, 18], + opacity: 0.8, + heightFactor: 1, + visible: true, + zIndex: 10, + map +}); + +testBuildings.setStyle({ + hideWithoutStyle: false, + areas: [ + { + visible: true, + rejectTexture: true, + color1: 'ffffff00', + color2: 'ffffcc00', + path: [[1, 2]] + }, + { + visible: true, + rejectTexture: true, + color1: 'ffffff00', + color2: 'ffffcc00', + path: [lnglat] + }, + { + color1: 'ff99ff00', + path: [lnglat] + }, + ] +}); + +/** + * layer/canvasLayer.ts + */ + +// $ExpectType CanvasLayer +new AMap.CanvasLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType CanvasLayer +new AMap.CanvasLayer(); +// $ExpectType CanvasLayer +new AMap.CanvasLayer({}); +// $ExpectType CanvasLayer +const testCanvasLayer = new AMap.CanvasLayer({ + bounds +}); + +// $ExpectType void +testCanvasLayer.setMap(null); +// $ExpectType void +testCanvasLayer.setMap(map); + +// $ExpectType Map | null | undefined +testCanvasLayer.getMap(); + +// $ExpectType void +testCanvasLayer.show(); + +// $ExpectType void +testCanvasLayer.hide(); + +// $ExpectType number +testCanvasLayer.getzIndex(); + +// $ExpectType void +testCanvasLayer.setzIndex(10); + +// $ExpectType HTMLCanvasElement | null +testCanvasLayer.getElement(); + +// $ExpectType void +testCanvasLayer.setCanvas(canvasEle); + +// $ExpectType HTMLCanvasElement | undefined +testCanvasLayer.getCanvas(); + +/** + * layer/flexible.ts + */ + +// $ExpectType Flexible +new AMap.TileLayer.Flexible(); +// $ExpectType Flexible +new AMap.TileLayer.Flexible({}); +// $ExpectType Flexible +const testFlexible = new AMap.TileLayer.Flexible({ + createTile(x, y, z, success, fail) { + // $ExpectType number + x; + // $ExpectType number + y; + // $ExpectType number + z; + // $ExpectType void + success(imgEle); + // $ExpectType void + success(canvasEle); + // $ExpectType void + fail(); + }, + cacheSize: 10, + opacity: 1, + visible: true, + map, + zIndex: 1, + zooms: [1, 2] +}); + +// $ExpectType void +testFlexible.setMap(null); +// $ExpectType void +testFlexible.setMap(map); + +// $ExpectType Map | null | undefined +testFlexible.getMap(); + +// $ExpectType void +testFlexible.show(); + +// $ExpectType void +testFlexible.hide(); + +// $ExpectType void +testFlexible.setzIndex(10); + +// $ExpectType number +testFlexible.getzIndex(); + +/** + * layer/imageLayer.ts + */ + +// $ExpectType ImageLayer +new AMap.ImageLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType ImageLayer +new AMap.ImageLayer(); +// $ExpectType ImageLayer +new AMap.ImageLayer({}); +// $ExpectType ImageLayer +const testImageLayer = new AMap.ImageLayer({ + bounds +}); + +// $ExpectType void +testImageLayer.setMap(null); +// $ExpectType void +testImageLayer.setMap(map); + +// $ExpectType Map | null | undefined +testImageLayer.getMap(); + +// $ExpectType void +testImageLayer.show(); + +// $ExpectType void +testImageLayer.hide(); + +// $ExpectType number +testImageLayer.getzIndex(); + +// $ExpectType void +testImageLayer.setzIndex(10); + +// $ExpectType HTMLImageElement | null +testImageLayer.getElement(); + +// $ExpectType void +testImageLayer.setImageUrl('url'); + +// $ExpectType string | undefined +testImageLayer.getImageUrl(); + +/** + * layer/layer.ts + */ + +// $ExpectError +new AMap.Layer(); + +// $ExpectType HTMLDivElement | undefined +layer.getContainer(); + +// $ExpectType [number, number] +layer.getZooms(); + +// $ExpectType void +layer.setOpacity(1); + +// $ExpectType number +layer.getOpacity(); + +// $ExpectType void +layer.show(); + +// $ExpectType void +layer.hide(); + +// $ExpectType void +layer.setMap(); +// $ExpectType void +layer.setMap(map); + +// $ExpectType void +layer.setzIndex(1); + +// $ExpectType number +layer.getzIndex(); + +/** + * layer/layerGroup.ts + */ + +// $ExpectError +new AMap.LayerGroup(); + +// $ExpectType LayerGroup +new AMap.LayerGroup(tileLayer); +// $ExpectType LayerGroup +const testTileLayerGroup = new AMap.LayerGroup([tileLayer]); +// $ExpectType LayerGroup +const testAnyLauerGroup = new AMap.LayerGroup([]); + +// $ExpectType LayerGroup +testTileLayerGroup.addLayer(tileLayer); +// $ExpectType LayerGroup +testTileLayerGroup.addLayer([tileLayer]); +// $ExpectError +testTileLayerGroup.addLayer(massMarksLayer); + +// $ExpectType TileLayer[] +testTileLayerGroup.getLayers(); + +// $ExpectType TileLayer | null +testTileLayerGroup.getLayer(function(item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType null + this; + + return true; +}); + +testTileLayerGroup.hasLayer(function(item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType null + this; + + return true; +}); +testTileLayerGroup.hasLayer(tileLayer); + +// $ExpectType LayerGroup +testTileLayerGroup.removeLayer(tileLayer); +// $ExpectType LayerGroup +testTileLayerGroup.removeLayer([tileLayer]); + +// $ExpectType LayerGroup +testTileLayerGroup.clearLayers(); + +testTileLayerGroup.eachLayer(function(item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType TileLayer + this; +}); +testTileLayerGroup.eachLayer(function(item, index, list) { + // $ExpectType TileLayer + item; + // $ExpectType number + index; + // $ExpectType TileLayer[] + list; + // $ExpectType number + this.test; +}, { test: 1 }); + +// $ExpectType LayerGroup +testTileLayerGroup.setMap(map); + +// $ExpectType LayerGroup +testTileLayerGroup.hide(); + +// $ExpectType LayerGroup +testTileLayerGroup.show(); + +// $ExpectType LayerGroup +testTileLayerGroup.reload(); + +// $ExpectType LayerGroup +testTileLayerGroup.setOptions({}); + +// $ExpectType LayerGroup +testTileLayerGroup.setOptions({ + tileSize: 256 +}); +// layerGruop.setOptions({ +// // $ExpectError +// interval: 1 +// }); + +testAnyLauerGroup.addLayer(tileLayer); + +testAnyLauerGroup.addLayer(massMarksLayer); + +testAnyLauerGroup.setOptions({ + test: 1 +}); + +/** + * layer/massMarks.ts + */ + +const massMarksStyle1 = { + anchor: pixel, + url: '', + size, + rotation: 1 +}; +const massMarksStyle2 = { + anchor: pixel, + url: '', + size +}; +const massMarksData1 = { + lnglat +}; + +interface MassMarksCustomData extends AMap.MassMarks.Data { + name: string; + id: string; +} +const massMarksMassMarksCustomData: MassMarksCustomData = { + lnglat: [1, 2], + style: 1, + name: '', + id: '' +}; + +// $ExpectError +new AMap.MassMarks(); +// $ExpectError +new AMap.MassMarks([], {}); + +new AMap.MassMarks([], { + style: [massMarksStyle1, massMarksStyle2] +}); +new AMap.MassMarks([massMarksData1], { + style: [massMarksStyle1, massMarksStyle2] +}); + +// $ExpectType MassMarks +const testMassMarks = new AMap.MassMarks([massMarksMassMarksCustomData], { + style: [massMarksStyle1, massMarksStyle2] +}); + +// $ExpectType void +testMassMarks.setStyle(massMarksStyle1); +// $ExpectType void +testMassMarks.setStyle([massMarksStyle1]); + +// $ExpectType Style | Style[] +testMassMarks.getStyle(); + +// $ExpectType void +testMassMarks.setData(''); + +// $ExpectError +testMassMarks.setData(massMarksData1); +// $ExpectError +testMassMarks.setData(massMarksMassMarksCustomData); + +const massMarksCustomData = testMassMarks.getData()[0]; +// $ExpectType string +massMarksCustomData.name; +// $ExpectType string +massMarksCustomData.id; +// $ExpectType LngLat +massMarksCustomData.lnglat; + +// $ExpectType void +testMassMarks.clear(); + +testMassMarks.on('click', (event: AMap.MassMarks.EventMap['click']) => { + // $ExpectType "click" + event.type; + + // $ExpectType MassMarksCustomData + event.data; + + // $ExpectType MassMarks + event.target; +}); + +/** + * layer/tileLayer.ts + */ + +// $ExpectType TileLayer +new AMap.TileLayer(); + +// $ExpectType TileLayer +new AMap.TileLayer({}); + +// $ExpectType TileLayer +const testTileLayer = new AMap.TileLayer({ + map, + tileSize: 256, + tileUrl: '', + errorUrl: '', + getTileUrl: (x, y, z) => '', + zIndex: 1, + opacity: 0.1, + zooms: [3, 18], + detectRetina: true +}); + +// $ExpectType string[] +testTileLayer.getTiles(); + +// $ExpectType void +testTileLayer.reload(); + +// $ExpectType void +testTileLayer.setTileUrl(''); +// $ExpectType void +testTileLayer.setTileUrl((x, y, level) => { + // $ExpectType number + x; + // $ExpectType number + y; + // $ExpectType number + level; + return ''; +}); + +// $ExpectType TileLayer +testTileLayer.on('complete', () => { }); + +testTileLayer.off('complete', () => { }); + +testTileLayer.emit('complete'); + +// $ExpectType Traffic +const testTrafficLayer = new AMap.TileLayer.Traffic({}); +// $ExpectType Traffic +new AMap.TileLayer.Traffic({ + autoRefresh: true, + interval: 180 +}); + +testTrafficLayer.on('complete', () => { }); + +/** + * layer/videoLayer.ts + */ + +// $ExpectType VideoLayer +new AMap.VideoLayer({ + map, + bounds, + visible: true, + zooms: [1, 2], + opacity: 1 +}); + +// $ExpectType VideoLayer +new AMap.VideoLayer(); +// $ExpectType VideoLayer +new AMap.VideoLayer({}); +// $ExpectType VideoLayer +const testVideoLayer = new AMap.VideoLayer({ + bounds +}); + +// $ExpectType void +testVideoLayer.setMap(null); +// $ExpectType void +testVideoLayer.setMap(map); + +// $ExpectType Map | null | undefined +testVideoLayer.getMap(); + +// $ExpectType void +testVideoLayer.show(); + +// $ExpectType void +testVideoLayer.hide(); + +// $ExpectType number +testVideoLayer.getzIndex(); + +// $ExpectType void +testVideoLayer.setzIndex(10); + +// $ExpectType HTMLVideoElement | null +testVideoLayer.getElement(); + +// $ExpectType void +testVideoLayer.setVideoUrl('url'); + +// $ExpectType string | string[] | undefined +testVideoLayer.getVideoUrl(); + +/** + * layer/wms.ts + */ + +// $ExpectType WMS +new AMap.TileLayer.WMS({ + url: 'url', + params: {} +}); +// $ExpectType WMS +const testWms = new AMap.TileLayer.WMS({ + url: 'url', + blend: true, + params: { + VERSION: 'version', + LAYERS: 'layers', + STYLES: 'styles', + FORMAT: 'format', + TRANSPARENT: 'TRUE', + BGCOLOR: '#000', + EXCEPTIONS: 'exceptions', + TIME: 'time', + ELEVATION: 'elevation' + }, + zooms: [1, 2], + tileSize: 256, + opacity: 1, + zIndex: 10, + visible: true +}); + +// $ExpectType void +testWms.setMap(map); +// $ExpectType void +testWms.setMap(null); + +// $ExpectType Map | null | undefined +testWms.getMap(); + +// $ExpectType void +testWms.show(); + +// $ExpectType void +testWms.hide(); + +// $ExpectType void +testWms.setzIndex(10); + +// $ExpectType number +testWms.getzIndex(); + +// $ExpectType void +testWms.setUrl('url'); + +// $ExpectType string +testWms.getUrl(); + +// $ExpectType void +testWms.setParams({ + VERSION: 'version', + LAYERS: 'layers', + STYLES: 'styles', + FORMAT: 'format', + TRANSPARENT: 'TRUE', + BGCOLOR: '#000', + EXCEPTIONS: 'exceptions', + TIME: 'time', + ELEVATION: 'elevation' +}); + +{ + const params = testWms.getParams(); + // $ExpectType string | undefined + params.VERSION; + // $ExpectType string | undefined + params.LAYERS; + // $ExpectType string | undefined + params.STYLES; + // $ExpectType string | undefined + params.FORMAT; + // $ExpectType "TRUE" | "FALSE" | undefined + params.TRANSPARENT; + // $ExpectType string | undefined + params.BGCOLOR; + // $ExpectType string | undefined + params.EXCEPTIONS; + // $ExpectType string | undefined + params.TIME; + // $ExpectType string | undefined + params.ELEVATION; +} + +/** + * layer/wmts.ts + */ + +// $ExpectType WMTS +new AMap.TileLayer.WMTS({ + url: 'url', + params: {} +}); +// $ExpectType WMTS +const testWmts = new AMap.TileLayer.WMTS({ + url: 'url', + blend: true, + tileSize: 256, + zooms: [1, 2], + opacity: 1, + zIndex: 10, + visible: true, + params: { + Version: 'version', + Layer: 'layers', + Style: 'style', + Format: 'format' + } +}); + +// $ExpectType void +testWmts.setMap(map); +// $ExpectType void +testWmts.setMap(null); + +// $ExpectType Map | null | undefined +testWmts.getMap(); + +// $ExpectType void +testWmts.show(); + +// $ExpectType void +testWmts.hide(); + +// $ExpectType void +testWmts.setzIndex(10); + +// $ExpectType number +testWmts.getzIndex(); + +// $ExpectType void +testWmts.setUrl('url'); + +// $ExpectType string +testWmts.getUrl(); + +// $ExpectType void +testWmts.setParams({ + Version: 'version', + Layer: 'layers', + Style: 'style', + Format: 'format' +}); + +{ + const params = testWmts.getParams(); + // $ExpectType string | undefined + params.Version; + // $ExpectType string | undefined + params.Layer; + // $ExpectType string | undefined + params.Style; + // $ExpectType string | undefined + params.Format; +} + +/** + * overlay/bezierCurve.ts + */ + +interface BezierCurveExtraData { + test: number; +} + +const bezierCurvePath = [ + [1, 2, 3, 4], + [1, 2, 3], + [ + [1, 2, 3], + [1, 2] + ], + [1, 2] +]; + +// $ExpectError +new AMap.BezierCurve(); +// $ExpectError +new AMap.BezierCurve({}); +// $ExpectType BezierCurve +const testBezierCurve = new AMap.BezierCurve({ + map, + path: bezierCurvePath, + strokeColor: '#FF0000', + strokeOpacity: 0.6, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [1, 5], + zIndex: 10, + bubble: false, + showDir: true, + cursor: 'pointer', + isOutline: true, + outlineColor: '#00FF00', + borderWeight: 2 +}); + +// $ExpectType void +testBezierCurve.setPath(bezierCurvePath); + +// $ExpectType void +testBezierCurve.setPath(bezierCurvePath); + +// $ExpectType void +testBezierCurve.setOptions({}); +testBezierCurve.setOptions({ + map, + path: bezierCurvePath, + strokeColor: '#FF0000', + strokeOpacity: 0.6, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [1, 5], + zIndex: 10, + bubble: false, + showDir: true, + cursor: 'pointer', + isOutline: true, + outlineColor: '#00FF00', + borderWeight: 2 +}); + +{ + const options = testBezierCurve.getOptions(); + + // $ExpectType number | undefined + options.borderWeight; + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType string | undefined + options.dirColor; + // $ExpectType string | undefined + options.dirImg; + // $ExpectType {} | BezierCurveExtraData | undefined + options.extData; + // $ExpectType boolean | undefined + options.geodesic; + // $ExpectType boolean | undefined + options.isOutline; + // $ExpectType "round" | "butt" | "square" | undefined + options.lineCap; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType string | undefined + options.outlineColor; + // $ExpectType (LngLat & { controlPoints: LngLat[]; })[] | undefined + options.path; + // $ExpectType boolean | undefined + options.showDir; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType number +testBezierCurve.getLength(); + +// $ExpectType Bounds | null +testBezierCurve.getBounds(); + +// $ExpectType void +testBezierCurve.show(); + +// $ExpectType void +testBezierCurve.hide(); + +// $ExpectType void +testBezierCurve.setMap(null); +testBezierCurve.setMap(map); + +// $ExpectType void +testBezierCurve.setExtData({ test: 1 }); +// $ExpectError +testBezierCurve.setExtData({ test: '123' }); + +// $ExpectType {} | BezierCurveExtraData +testBezierCurve.getExtData(); + +testBezierCurve.on('click', (event: AMap.BezierCurve.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType LngLat + event.lnglat; + // $ExpectType BezierCurve + event.target; +}); + +testBezierCurve.on('show', (event: AMap.BezierCurve.EventMap['show']) => { + // $ExpectType "show" + event.type; + // $ExpectType BezierCurve + event.target; +}); + +testBezierCurve.on('options', (event: AMap.BezierCurve.EventMap['options']) => { + // $ExpectType "options" + event.type; + // $ExpectError + event.target; +}); + +/** + * overlay/circle.ts + */ + +interface CircleExtraData { + test: number; +} + +// $ExpectType Circle +new AMap.Circle(); +new AMap.Circle({}); +// $ExpectType Circle +const testCircle = new AMap.Circle({ + map, + zIndex: 10, + center: lnglat, + bubble: true, + cursor: 'pointer', + radius: 1000, + strokeColor: '#FF0000', + strokeOpacity: 0.8, + strokeWeight: 3, + fillColor: '#00FF00', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [2, 4] +}); + +// $ExpectType void +testCircle.setCenter(lnglat); +// $ExpectType void +testCircle.setCenter(lnglatTuple); + +// $ExpectType LngLat | undefined +testCircle.getCenter(); + +// $ExpectType Bounds | null +testCircle.getBounds(); + +// $ExpectType void +testCircle.setRadius(100); + +// $ExpectType number +testCircle.getRadius(); + +// $ExpectType void +testCircle.setOptions({}); +testCircle.setOptions({ + map, + zIndex: 10, + center: lnglat, + bubble: true, + cursor: 'pointer', + radius: 1000, + strokeColor: '#FF0000', + strokeOpacity: 0.8, + strokeWeight: 3, + fillColor: '#00FF00', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [2, 4] +}); + +{ + const options = testCircle.getOptions(); + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType LngLat | undefined + options.center; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType {} | CircleExtraData | undefined + options.extData; + // $ExpectType string | undefined + options.fillColor; + // $ExpectType number | undefined + options.fillOpacity; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType LngLat[] | undefined + options.path; + // $ExpectType number | undefined + options.radius; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType string | undefined + options.texture; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType Bounds | null +testCircle.getBounds(); + +// $ExpectType void +testCircle.hide(); + +// $ExpectType void +testCircle.show(); + +// $ExpectType void +testCircle.setMap(null); +// $ExpectType void +testCircle.setMap(map); + +// $ExpectType void +testCircle.setExtData({ test: 2 }); +// $ExpectError +testCircle.setExtData({ test: '1' }); + +// $ExpectType {} | CircleExtraData +testCircle.getExtData(); + +// $ExpectType boolean +testCircle.contains(lnglat); +// $ExpectType boolean +testCircle.contains(lnglatTuple); + +testCircle.on('click', (event: AMap.Circle.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Circle + event.target; +}); + +testCircle.on('setCenter', (event: AMap.Circle.EventMap['setCenter']) => { + // $ExpectType "setCenter" + event.type; + // $ExpectError + event.target; +}); + +testCircle.on('change', (event: AMap.Circle.EventMap['change']) => { + // $ExpectType "change" + event.type; + // $ExpectType Circle + event.target; +}); + +/** + * overlay/contextMenu.ts + */ + +interface ContextMenuExtraData { + test: number; +} +// $ExpectType ContextMenu +new AMap.ContextMenu(); +// $ExpectType ContextMenu +new AMap.ContextMenu({}); +// $ExpectType ContextMenu +const testContextMenu = new AMap.ContextMenu({ + content: '

content
', +}); + +// $ExpectType void +testContextMenu.addItem('item', function() { + // $ExpectType HTMLLIElement + this; +}); +// $ExpectType void +testContextMenu.addItem('item', () => { }, 1); + +// $ExpectType void +testContextMenu.removeItem('item', () => {}); + +// $ExpectType void +testContextMenu.open(map, lnglatTuple); +// $ExpectType void +testContextMenu.open(map, lnglat); + +// $ExpectType void +testContextMenu.close(); + +testContextMenu.on('items', (event: AMap.ContextMenu.EventMap['items']) => { + // $ExpectType "items" + event.type; +}); + +testContextMenu.on('open', (event: AMap.ContextMenu.EventMap['open']) => { + // $ExpectType "open" + event.type; + // $ExpectType ContextMenu + event.target; +}); + +/** + * overlay/ellipse.ts + */ + +interface EllipseExtraData { + test: number; +} +// $ExpectType Ellipse +new AMap.Ellipse(); +// $ExpectType Ellipse +new AMap.Ellipse({}); +// $ExpectType Ellipse +const testEllipse = new AMap.Ellipse({ + map, + zIndex: 10, + center: lnglat, + radius: [10000, 15000], + bubble: false, + cursor: 'pointer', + strokeColor: '#FF0000', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +// $ExpectType LngLat | undefined +testEllipse.getCenter(); + +// $ExpectType void +testEllipse.setCenter(lnglat); +// $ExpectType void +testEllipse.setCenter(lnglatTuple); + +// $ExpectType Bounds | null +testEllipse.getBounds(); + +// $ExpectType void +testEllipse.setOptions({ + map, + zIndex: 10, + center: lnglat, + radius: [10000, 15000], + bubble: false, + cursor: 'pointer', + strokeColor: '#FF0000', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'dashed', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +{ + const options = testEllipse.getOptions(); + + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType LngLat | undefined + options.center; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType {} | EllipseExtraData | undefined + options.extData; + // $ExpectType string | undefined + options.fillColor; + // $ExpectType number | undefined + options.fillOpacity; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType LngLat[] | undefined + options.path; + // $ExpectType [number, number] | undefined + options.radius; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType string | undefined + options.texture; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType void +testEllipse.hide(); + +// $ExpectType void +testEllipse.show(); + +// $ExpectType void +testEllipse.setMap(null); +// $ExpectType void +testEllipse.setMap(map); + +// $ExpectType void +testEllipse.setExtData({ test: 2 }); +// $ExpectType {} | EllipseExtraData +testEllipse.getExtData(); + +// $ExpectType boolean +testEllipse.contains(lnglat); +// $ExpectType boolean +testEllipse.contains(lnglatTuple); + +/** + * overlay/geoJSON.ts + */ + +interface GeoJSONExtraData { + test: number; +} + +const geoJSONObject: AMap.GeoJSON.GeoJSONObject[] = [ + { + type: 'Feature', + properties: {}, + geometry: { + type: 'Point', + coordinates: lnglatTuple + } + }, + { + type: 'Feature', + properties: { test: 1 }, + geometry: { + type: 'LineString', + coordinates: [lnglatTuple, lnglatTuple] + } + } +]; + +// $ExpectType GeoJSON +new AMap.GeoJSON(); +// $ExpectType GeoJSON +new AMap.GeoJSON({}); +// $ExpectType GeoJSON +const testGeoJSON = new AMap.GeoJSON({ + geoJSON: geoJSONObject, + getMarker(obj, lnglat) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat + lnglat; + return marker; + }, + getPolyline(obj, lnglats) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat[] + lnglats; + return testPolyline; + }, + getPolygon(obj, lnglats) { + // $ExpectType GeoJSONObject + obj; + // $ExpectType LngLat[] + lnglats; + return testPolygon; + }, + coordsToLatLng(coord) { + // $ExpectType LngLat + coord; + return coord; + } +}); + +// $ExpectType void +testGeoJSON.importData(geoJSONObject); + +// $ExpectType GeoJSON +testGeoJSON.removeOverlay(marker); +// $ExpectType GeoJSON +testGeoJSON.removeOverlay([marker]); + +// $ExpectType boolean +testGeoJSON.hasOverlay(marker); +// $ExpectType boolean +testGeoJSON.hasOverlay(m => m === marker); + +// $ExpectType GeoJSON +testGeoJSON.addOverlay(marker); +// $ExpectType GeoJSON +testGeoJSON.addOverlay([marker]); + +// $ExpectType GeoJSONObject[] +testGeoJSON.toGeoJSON(); + +// $ExpectType GeoJSON +testGeoJSON.setMap(null); +// $ExpectType GeoJSON +testGeoJSON.setMap(map); + +// $ExpectType GeoJSON +testGeoJSON.hide(); + +// $ExpectType GeoJSON +testGeoJSON.show(); + +testGeoJSON.on('click', (event: AMap.MapsEvent<'click', AMap.Overlay>) => { + // $ExpectType "click" + event.type; + // $ExpectType Overlay + event.target; +}); + +/** + * overlay/icon.ts + */ + +// $ExpectType Icon +new AMap.Icon(); +// $ExpectType Icon +new AMap.Icon({}); +// $ExpectType Icon +new AMap.Icon({ + size, + imageOffset: pixel, + image: 'image uri', + imageSize: size +}); +// $ExpectType Icon +const testIcon = new AMap.Icon({ + size: [1, 2], + imageOffset: pixel, + image: 'image uri', + imageSize: [1, 2] +}); + +// $ExpectType Size +testIcon.getImageSize(); + +// $ExpectType void +testIcon.setImageSize(size); +// $ExpectType void +testIcon.setImageSize([1, 2]); + +/** + * overlay/infoWindow.ts + */ + +interface InfoWindowExtraData { + test: number; +} + +// $ExpectType InfoWindow +new AMap.InfoWindow(); +// $ExpectType InfoWindow +new AMap.InfoWindow({}); +// $ExpectType InfoWindow +const testInfoWindow = new AMap.InfoWindow({ + isCustom: false, + autoMove: false, + closeWhenClickMap: false, + content: 'content', + size: [100, 100], + anchor: 'bottom-center', + offset: new AMap.Pixel(10, 10), + position: lnglat, + showShadow: true +}); + +// $ExpectType void +testInfoWindow.open(map); +// $ExpectType void +testInfoWindow.open(map, lnglat); +// $ExpectType void +testInfoWindow.open(map, lnglatTuple); + +// $ExpectType void +testInfoWindow.close(); + +// $ExpectType boolean +testInfoWindow.getIsOpen(); + +// $ExpectType void +testInfoWindow.setContent('content'); +// $ExpectType void +testInfoWindow.setContent(div); + +// $ExpectType string | HTMLElement | undefined +testInfoWindow.getContent(); + +// $ExpectType void +testInfoWindow.setPosition(lnglat); +// $ExpectType void +testInfoWindow.setPosition(lnglatTuple); + +// $ExpectType LngLat | undefined +testInfoWindow.getPosition(); + +const testInfoWindowAnchor = testInfoWindow.getAnchor(); +if (testInfoWindowAnchor !== undefined) { + // $ExpectType Anchor + testInfoWindowAnchor; +} else { + // $ExpectType undefined + testInfoWindowAnchor; +} + +// $ExpectType void +testInfoWindow.setAnchor(); +// $ExpectType void +testInfoWindow.setAnchor(testInfoWindowAnchor); + +// $ExpectType Size | undefined +testInfoWindow.getSize(); + +testInfoWindow.on('change', (event: AMap.InfoWindow.EventMap['change']) => { + // $ExpectType "change" + event.type; + // $ExpectType InfoWindow + event.target; +}); + +testInfoWindow.on('close', (event: AMap.InfoWindow.EventMap['close']) => { + // $ExpectType "close" + event.type; + // $ExpectType InfoWindow + event.target; +}); + +testInfoWindow.on('open', (event: AMap.InfoWindow.EventMap['open']) => { + // $ExpectType "open" + event.type; + // $ExpectType InfoWindow + event.target; +}); + +/** + * overlay/marker.ts + */ + +interface MarkerExtraData { + test: number; +} + +// $ExpectType Marker +new AMap.Marker(); +// $ExpectType Marker +new AMap.Marker(); +// $ExpectType Marker +new AMap.Marker({}); +// $ExpectType Marker +export const testMarker = new AMap.Marker({ + map, + position: lnglat, + anchor: 'bottom-center', + offset: pixel, + icon: 'iconUrl', + content: 'htmlString', + topWhenClick: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 10, + angle: 10, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: icon, + title: '123', + clickable: true, + shape: markerShape, + extData: { + test: 123 + } +}); + +// $ExpectType void +testMarker.markOnAMAP({ + name: '123', + position: [1, 2] +}); +// $ExpectType void +testMarker.markOnAMAP(); +// $ExpectType void +testMarker.markOnAMAP({}); +// $ExpectType void +testMarker.markOnAMAP({ + position: [1, 2], + name: '123' +}); + +const testMarkerAnchor = testMarker.getAnchor(); +if (testMarkerAnchor) { + // $ExpectType Anchor + testMarkerAnchor; +} else { + // $ExpectType undefined + testMarkerAnchor; +} + +// $ExpectType void +testMarker.setAnchor(testMarkerAnchor); +// $ExpectType void +testMarker.setAnchor(); + +// $ExpectType Pixel +testMarker.getOffset(); + +// $ExpectType void +testMarker.setOffset(pixel); + +// $ExpectType void +testMarker.setAnimation('AMAP_ANIMATION_BOUNCE'); + +// $ExpectType AnimationName +testMarker.getAnimation(); + +// $ExpectType void +testMarker.setClickable(true); + +// $ExpectType boolean +testMarker.getClickable(); + +// $ExpectType LngLat | undefined +testMarker.getPosition(); + +// $ExpectType void +testMarker.setPosition(lnglat); + +// $ExpectType void +testMarker.setAngle(0); + +// $ExpectType void +testMarker.setLabel(); +// $ExpectType void +testMarker.setLabel({}); +// $ExpectType void +testMarker.setLabel({ + content: 'label content', + offset: pixel +}); + +// $ExpectType Label | undefined +testMarker.getLabel(); + +// $ExpectType number +testMarker.getAngle(); + +// $ExpectType void +testMarker.setzIndex(100); + +// $ExpectType number +testMarker.getzIndex(); + +// $ExpectType void +testMarker.setIcon('icon uri'); +// $ExpectType void +testMarker.setIcon(icon); + +// $ExpectType string | Icon | undefined +testMarker.getIcon(); + +// $ExpectType void +testMarker.setDraggable(true); + +// $ExpectType boolean +testMarker.getDraggable(); + +// $ExpectType void +testMarker.setCursor('default'); + +// $ExpectType void +testMarker.setContent('content'); +// $ExpectType void +testMarker.setContent(domEle); + +// $ExpectType string | HTMLElement +testMarker.getContent(); + +// $ExpectType void +testMarker.moveAlong([lnglat], 100); +// $ExpectError +testMarker.moveAlong([[1, 2]], 100); +// $ExpectType void +testMarker.moveAlong([lnglat], 100, t => t, false); + +// $ExpectType void +testMarker.moveTo(lnglat, 100); +// $ExpectType void +testMarker.moveTo([1, 2], 100); +// $ExpectType void +testMarker.moveTo([1, 2], 100, t => t); + +// $ExpectType void +testMarker.stopMove(); + +// $ExpectType boolean +testMarker.pauseMove(); + +// $ExpectType boolean +testMarker.resumeMove(); + +// $ExpectType void +testMarker.setMap(map); + +// $ExpectType void +testMarker.setTitle('title'); +// $ExpectError +testMarker.setTitle(); + +// $ExpectType string | undefined +testMarker.getTitle(); + +// $ExpectType void +testMarker.setTop(true); + +// $ExpectType boolean +testMarker.getTop(); + +// $ExpectType void +testMarker.setShadow(); +// $ExpectType void +testMarker.setShadow(icon); +// $ExpectType void +testMarker.setShadow('shadow url'); + +// $ExpectType string | Icon | undefined +testMarker.getShadow(); + +// $ExpectType void +testMarker.setShape(); +// $ExpectType void +testMarker.setShape(markerShape); + +// $ExpectType MarkerShape | undefined +testMarker.getShape(); + +testMarker.on('click', (event: AMap.Marker.EventMap['click']) => { + // $ExpectType {} | MarkerExtraData + event.target.getExtData(); +}); + +/** + * overlay/markerShape.ts + */ + +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'circle', + coords: [1, 1, 1] +}); +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'rect', + coords: [1, 1, 1, 2] +}); +// $ExpectType MarkerShape +new AMap.MarkerShape({ + type: 'poly', + coords: [1, 2, 3, 4, 5] +}); + +// $ExpectError +new AMap.MarkerShape({ + type: 'circle', + coords: [1, 1] +}); +// $ExpectError +new AMap.MarkerShape({ + type: 'rect', + coords: [1, 1, 1, 2, 2] +}); + +/** + * overlay/overlay.ts + */ + +interface OverlayExtraData { + test: number; +} +declare const testOverlay: AMap.Overlay; + +// $ExpectType void +testOverlay.show(); + +// $ExpectType void +testOverlay.hide(); + +// $ExpectType Map | null | undefined +testOverlay.getMap(); + +// $ExpectType void +testOverlay.setMap(map); +// $ExpectType void +testOverlay.setMap(null); + +// $ExpectError +testOverlay.setExtData({ any: 123 }); + +// $ExpectError OverlayExtraData +testOverlay.getExtData(); + +/** + * overlay/overlayGroup.ts + */ + +// $ExpectType OverlayGroup, any> +const testOverlayGroup2 = new AMap.OverlayGroup(); +// $ExpectType OverlayGroup, any> +new AMap.OverlayGroup(marker); +// $ExpectType OverlayGroup, any> +const testOverlayGroup = new AMap.OverlayGroup([marker]); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.addOverlay(marker); +// $ExpectType OverlayGroup, any> +testOverlayGroup.addOverlay([marker]); +// $ExpectError +testOverlayGroup.addOverlay([testCircle]); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.addOverlays(marker); +// $ExpectType OverlayGroup, any> +testOverlayGroup.addOverlays([marker]); + +// $ExpectType Marker[] +testOverlayGroup.getOverlays(); + +// $ExpectType boolean +testOverlayGroup.hasOverlay(marker); +// $ExpectType boolean +testOverlayGroup.hasOverlay(o => o === marker); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.removeOverlay(marker); +// $ExpectType OverlayGroup, any> +testOverlayGroup.removeOverlay([marker]); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.removeOverlays(marker); +// $ExpectType OverlayGroup, any> +testOverlayGroup.removeOverlays([marker]); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.clearOverlays(); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.eachOverlay(function(overlay, index, overlays) { + // $ExpectType Marker + overlay; + // $ExpectType number + index; + // $ExpectType Marker[] + overlays; + // $ExpectType Marker + this; +}); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.setMap(null); +// $ExpectType OverlayGroup, any> +testOverlayGroup.setMap(map); + +// $ExpectType OverlayGroup, any> +testOverlayGroup2.setOptions({ + test: 1 +}); +// $ExpectType OverlayGroup, any> +testOverlayGroup.setOptions({ + map, + position: lnglat, + offset: pixel, + icon: 'iconUrl', + content: 'htmlString', + topWhenClick: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 10, + angle: 10, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: icon, + title: '123', + clickable: true, + shape: markerShape, + extData: { + test: 123 + } +}); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.show(); + +// $ExpectType OverlayGroup, any> +testOverlayGroup.hide(); + +testOverlayGroup.on('click', (event: AMap.MapsEvent<'click', AMap.Overlay>) => { + // $ExpectType "click" + event.type; + // $ExpectType Overlay + event.target; +}); + +/** + * overlay/polygon.ts + */ + +interface PolygonExtraData { + test: number; +} + +const polygonPath1 = [lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple, lnglatTuple]; +const polygonPath2 = [lnglat, lnglat, lnglat, lnglat, lnglat]; + +// $ExpectType Polygon +new AMap.Polygon(); +// $ExpectType Polygon +new AMap.Polygon({}); +// $ExpectType Polygon +const testPolygon = new AMap.Polygon({ + map, + zIndex: 10, + bubble: true, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.3, + strokeWeight: 5, + fillColor: '#0000FF', + fillOpacity: 0.5, + draggable: true, + extData: { test: 1 }, + strokeStyle: 'dashed', + strokeDasharray: [2, 4], + path: polygonPath1 +}); + +// $ExpectType void +testPolygon.setPath(polygonPath1); +// $ExpectType void +testPolygon.setPath(polygonPath2); +// $ExpectType void +testPolygon.setPath([polygonPath1, polygonPath2]); + +// $ExpectType LngLat[] | LngLat[][] +testPolygon.getPath(); + +// $ExpectType void +testPolygon.setOptions({ + map, + zIndex: 10, + bubble: true, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 5, + fillColor: '#0000FF', + fillOpacity: 0.5, + draggable: true, + extData: { test: 1 }, + strokeStyle: 'dashed', + strokeDasharray: [4, 2], + path: [polygonPath2, polygonPath1] +}); + +{ + const options = testPolygon.getOptions(); + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType {} | PolygonExtraData | undefined + options.extData; + // $ExpectType string | undefined + options.fillColor; + // $ExpectType number | undefined + options.fillOpacity; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType LngLat[] | LngLat[][] | undefined + options.path; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType string | undefined + options.texture; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType Bounds | null +testPolygon.getBounds(); + +// $ExpectType number +testPolygon.getArea(); + +// $ExpectType void +testPolygon.setMap(null); +// $ExpectType void +testPolygon.setMap(map); + +// $ExpectType void +testPolygon.setExtData({ test: 1 }); + +// $ExpectType {} | PolygonExtraData +testPolygon.getExtData(); + +// $ExpectType boolean +testPolygon.contains(lnglat); +// $ExpectType boolean +testPolygon.contains(lnglatTuple); + +testPolygon.on('click', (event: AMap.Polygon.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Polygon + event.target; +}); + +/** + * overlay/polyline.ts + */ + +interface PolylineExtraData { + test: number; +} + +// $ExpectType Polyline +new AMap.Polyline(); +// $ExpectType Polyline +new AMap.Polyline({}); +// $ExpectType Polyline +const testPolyline = new AMap.Polyline({ + map, + zIndex: 10, + bubble: true, + cursor: 'default', + geodesic: true, + isOutline: true, + borderWeight: 1, + outlineColor: '#AA0000', + path: [lnglat], + strokeColor: '#0000AA', + strokeOpacity: 0.5, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [20, 10, 20], + lineJoin: 'bevel', + lineCap: 'butt', + draggable: true, + extData: { test: 1 }, + showDir: true +}); +// Polyline + +// $ExpectType void +testPolyline.setPath([lnglat]); +// $ExpectType void +testPolyline.setPath([lnglatTuple]); + +// $ExpectType void +testPolyline.setOptions({}); +// $ExpectType void +testPolyline.setOptions({ + map, + zIndex: 10, + bubble: true, + cursor: 'default', + geodesic: true, + isOutline: true, + borderWeight: 1, + outlineColor: '#AA0000', + path: [lnglat, lnglat], + strokeColor: '#0000AA', + strokeOpacity: 0.5, + strokeWeight: 10, + strokeStyle: 'dashed', + strokeDasharray: [20, 10, 20], + lineJoin: 'bevel', + lineCap: 'butt', + draggable: true, + extData: { test: 1 }, + showDir: true +}); + +{ + const options = testPolyline.getOptions(); + // $ExpectType number | undefined + options.borderWeight; + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType string | undefined + options.dirColor; + // $ExpectType string | undefined + options.dirImg; + // $ExpectType {} | PolylineExtraData | undefined + options.extData; + // $ExpectType boolean | undefined + options.geodesic; + // $ExpectType boolean | undefined + options.isOutline; + // $ExpectType "round" | "butt" | "square" | undefined + options.lineCap; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType string | undefined + options.outlineColor; + // $ExpectType LngLat[] | undefined + options.path; + // $ExpectType boolean | undefined + options.showDir; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType number +testPolyline.getLength(); + +// $ExpectType Bounds | null +testPolyline.getBounds(); + +// $ExpectType void +testPolyline.hide(); + +// $ExpectType void +testPolyline.show(); + +// $ExpectType void +testPolyline.setMap(null); +// $ExpectType void +testPolyline.setMap(map); + +// $ExpectType void +testPolyline.setExtData({ test: 1 }); + +// $ExpectType {} | PolylineExtraData +testPolyline.getExtData(); + +testPolyline.on('click', (event: AMap.Polyline.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Polyline + event.target; +}); + +/** + * overlay/rectangle.ts + */ + +interface RectangleExtraData { + test: number; +} + +// $ExpectType Rectangle +new AMap.Rectangle(); +// $ExpectType Rectangle +new AMap.Rectangle({}); +// $ExpectType Rectangle +const testRectangle = new AMap.Rectangle({ + map, + zIndex: 10, + bounds, + bubble: false, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'solid', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +// $ExpectType Bounds | undefined +testRectangle.getBounds(); + +// $ExpectType void +testRectangle.setBounds(bounds); + +// $ExpectType void +testRectangle.setOptions({}); +// $ExpectType void +testRectangle.setOptions({ + map, + zIndex: 10, + bounds, + bubble: false, + cursor: 'pointer', + strokeColor: '#00FF00', + strokeOpacity: 0.8, + strokeWeight: 2, + fillColor: '#0000FF', + fillOpacity: 0.5, + strokeStyle: 'solid', + extData: { test: 1 }, + strokeDasharray: [1, 5] +}); + +{ + const options = testRectangle.getOptions(); + // $ExpectType Bounds | undefined + options.bounds; + // $ExpectType boolean | undefined + options.bubble; + // $ExpectType boolean | undefined + options.clickable; + // $ExpectType {} | RectangleExtraData | undefined + options.extData; + // $ExpectType string | undefined + options.fillColor; + // $ExpectType number | undefined + options.fillOpacity; + // $ExpectType "miter" | "round" | "bevel" | undefined + options.lineJoin; + // $ExpectType Map | undefined + options.map; + // $ExpectType LngLat[] | undefined + options.path; + // $ExpectType string | undefined + options.strokeColor; + // $ExpectType number[] | undefined + options.strokeDasharray; + // $ExpectType number | undefined + options.strokeOpacity; + // $ExpectType "dashed" | "solid" | undefined + options.strokeStyle; + // $ExpectType number | undefined + options.strokeWeight; + // $ExpectType string | undefined + options.texture; + // $ExpectType number | undefined + options.zIndex; +} + +// $ExpectType void +testRectangle.hide(); + +// $ExpectType void +testRectangle.show(); + +// $ExpectType void +testRectangle.setExtData({test: 2}); + +// $ExpectType {} | RectangleExtraData +testRectangle.getExtData(); + +// $ExpectType boolean +testRectangle.contains(lnglat); +// $ExpectType boolean +testRectangle.contains(lnglatTuple); + +testRectangle.on('click', (event: AMap.Rectangle.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Rectangle + event.target; +}); + +testRectangle.on('setBounds', (event: AMap.Rectangle.EventMap['setBounds']) => { + // $ExpectType "setBounds" + event.type; + // $ExpectError + event.target; +}); + +/** + * overlay/text.ts + */ + +interface TextExtraData { + test: number; +} + +// $ExpectType Text +new AMap.Text(); +// $ExpectType Text +new AMap.Text({}); +// $ExpectType Text +const testText = new AMap.Text({ + text: 'content', + textAlign: 'center', + verticalAlign: 'top', + map, + position: lnglat, + anchor: 'bottom-center', + offset: pixel, + topWhenClick: true, + bubble: true, + draggable: true, + raiseOnDrag: true, + cursor: 'default', + visible: true, + zIndex: 100, + angle: 45, + autoRotation: true, + animation: 'AMAP_ANIMATION_BOUNCE', + shadow: 'https://webapi.amap.com/theme/v1.3/markers/0.png', + title: 'title', + clickable: true, + extData: { test: 1 } +}); + +const testTextAnchor = testText.getAnchor(); +if (testTextAnchor) { + // $ExpectType Anchor + testTextAnchor; +} else { + // $ExpectType undefined + testTextAnchor; +} + +// $ExpectType void +testText.setAnchor(testTextAnchor); +// $ExpectType void +testText.setAnchor(); + +// $ExpectType string +testText.getText(); + +// $ExpectType void +testText.setText('123'); + +// $ExpectType void +testText.setStyle({ + background: 'red', + width: '200px' +}); + +// $ExpectType void +testText.markOnAMAP({ + name: '123', + position: lnglatTuple +}); + +// $ExpectType Pixel +testText.getOffset(); + +// $ExpectType void +testText.setOffset(pixel); + +// $ExpectType void +testText.setAnimation('AMAP_ANIMATION_BOUNCE'); + +// $ExpectType AnimationName +testText.getAnimation(); + +// $ExpectType void +testText.setClickable(true); + +// $ExpectType boolean +testText.getClickable(); + +// $ExpectType LngLat | undefined +testText.getPosition(); + +// $ExpectType void +testText.setAngle(10); + +// $ExpectType number +testText.getAngle(); + +// $ExpectType void +testText.setzIndex(1); + +// $ExpectType number +testText.getzIndex(); + +// $ExpectType void +testText.setDraggable(true); + +// $ExpectType boolean +testText.getDraggable(); + +// $ExpectType void +testText.hide(); + +// $ExpectType void +testText.show(); + +// $ExpectType void +testText.setCursor('default'); + +// $ExpectType void +testText.moveAlong([lnglat], 100); + +// $ExpectType void +testText.moveAlong([lnglat], 100); +// $ExpectError +testText.moveAlong([[1, 2]], 100); +// $ExpectType void +testText.moveAlong([lnglat], 100, t => t, false); + +// $ExpectType void +testText.moveTo(lnglat, 100); +// $ExpectType void +testText.moveTo([1, 2], 100); +// $ExpectType void +testText.moveTo([1, 2], 100, t => t); + +// $ExpectType void +testText.stopMove(); + +// $ExpectType boolean +testText.pauseMove(); + +// $ExpectType boolean +testText.resumeMove(); + +// $ExpectType void +testText.setMap(map); + +// $ExpectType void +testText.setTitle('title'); +// $ExpectError +testText.setTitle(); + +// $ExpectType string | undefined +testText.getTitle(); + +// $ExpectType void +testText.setTop(true); + +// $ExpectType boolean +testText.getTop(); + +// $ExpectType void +testText.setShadow(); +// $ExpectType void +testText.setShadow(icon); +// $ExpectType void +testText.setShadow('shadow url'); + +// $ExpectType void +testText.setExtData({ test: 1 }); + +// $ExpectType {} | TextExtraData +testText.getExtData(); + +testText.on('click', (event: AMap.Text.EventMap['click']) => { + // $ExpectType "click" + event.type; + // $ExpectType Text + event.target; +}); diff --git a/types/amap-js-api/array-bounds.d.ts b/types/amap-js-api/array-bounds.d.ts new file mode 100644 index 0000000000..3e0145e049 --- /dev/null +++ b/types/amap-js-api/array-bounds.d.ts @@ -0,0 +1,15 @@ +declare namespace AMap { + class ArrayBounds { + constructor(bounds: LocationValue[]); + bounds: LngLat[]; + /** + * 判断传入的点是否在ArrayBounds内 + * @param point 目标点 + */ + contains(point: LocationValue): boolean; + + // internal + toBounds(): Bounds; + getCenter(): LngLat; + } +} diff --git a/types/amap-js-api/bounds.d.ts b/types/amap-js-api/bounds.d.ts new file mode 100644 index 0000000000..f594969292 --- /dev/null +++ b/types/amap-js-api/bounds.d.ts @@ -0,0 +1,39 @@ +declare namespace AMap { + class Bounds { + /** + * 地物对象的经纬度矩形范围。 + * @param southWest 西南角经纬度 + * @param northEast 东北角经纬度 + */ + constructor(southWest: LngLat, northEast: LngLat); + /** + * 指定点坐标是否在矩形范围内 + * @param point 制定坐标 + */ + contains(point: LocationValue): boolean; + /** + * 获取当前Bounds的中心点经纬度坐标 + */ + getCenter(): LngLat; + /** + * 获取西南角坐标 + */ + getSouthWest(): LngLat; + /** + * 获取东南角坐标 + */ + getSouthEast(): LngLat; + /** + * 获取东北角坐标 + */ + getNorthEast(): LngLat; + /** + * 获取西北角坐标 + */ + getNorthWest(): LngLat; + /** + * 以字符串形式返回地物对象的矩形范围 + */ + toString(): string; + } +} diff --git a/types/amap-js-api/browser.d.ts b/types/amap-js-api/browser.d.ts new file mode 100644 index 0000000000..26b3956aa1 --- /dev/null +++ b/types/amap-js-api/browser.d.ts @@ -0,0 +1,192 @@ +declare namespace AMap { + namespace Browser { + /** + * 当前浏览器userAgent + */ + const ua: string; + /** + * 是否移动设备 + */ + const mobile: boolean; + /** + * 平台类型,如:'windows'、'mac'、'ios'、'android'、'other' + */ + const plat: 'android' | 'ios' | 'windows' | 'mac' | 'other'; + /** + * 是否mac设备 + */ + const mac: boolean; + /** + * 是否windows设备 + */ + const windows: boolean; + /** + * 是否iOS设备 + */ + const ios: boolean; + /** + * 是否iPad + */ + const iPad: boolean; + /** + * 是否iPhone + */ + const iPhone: boolean; + /** + * 是否安卓设备 + */ + const android: boolean; + /** + * 是否安卓4以下系统 + */ + const android23: boolean; + /** + * 是否Chrome浏览器 + */ + const chrome: boolean; + /** + * 是否火狐浏览器 + */ + const firefox: boolean; + /** + * 是否Safari浏览器 + */ + const safari: boolean; + /** + * 是否微信 + */ + const wechat: boolean; + /** + * 是否UC浏览器 + */ + const uc: boolean; + /** + * 是否QQ或者QQ浏览器 + */ + const qq: boolean; + /** + * 是否IE + */ + const ie: boolean; + /** + * 是否IE6 + */ + const ie6: boolean; + /** + * 是否IE7 + */ + const ie7: boolean; + /** + * 是否IE8 + */ + const ie8: boolean; + /** + * 是否IE9 + */ + const ie9: boolean; + /** + * 是否IE10 + */ + const ie10: boolean; + /** + * 是否IE11 + */ + const ie11: boolean; + /** + * 是否Edge浏览器 + */ + const edge: boolean; + /** + * 是否IE9以下 + */ + const ielt9: boolean; + /** + * 是否百度浏览器 + */ + const baidu: boolean; + /** + * 是否支持LocaStorage + */ + const isLocalStorage: boolean; + /** + * 是否支持Geolocation + */ + const isGeolocation: boolean; + /** + * 是否Webkit移动浏览器 + */ + const mobileWebkit: boolean; + /** + * 是否支持Css3D的Webkit移动端浏览器 + */ + const mobileWebkit3d: boolean; + /** + * 是否Opera移动浏览器 + */ + const mobileOpera: boolean; + /** + * 是否高清屏幕,devicePixelRatio>1 + */ + const retina: boolean; + /** + * 是否触屏 + */ + const touch: boolean; + /** + * 是否msPointer设备 + */ + const msPointer: boolean; + /** + * 是否pointer设备 + */ + const pointer: boolean; + /** + * 是否webkit浏览器 + */ + const webkit: boolean; + /** + * 是否支持Css3D的ie浏览器 + */ + const ie3d: boolean; + /** + * 是否支持Css3D的Webkit浏览器 + */ + const webkit3d: boolean; + /** + * 是否支持Css3D的gecko浏览器 + */ + const gecko3d: boolean; + /** + * 是否支持Css3D的opera浏览器 + */ + const opera3d: boolean; + /** + * 是否支持Css3D的浏览器 + */ + const any3d: boolean; + /** + * 是否支持canvas + */ + const isCanvas: boolean; + /** + * 是否支持svg + */ + const isSvg: boolean; + /** + * 是否支持vml + */ + const isVML: boolean; + /** + * 是否支持WebWorker + */ + const isWorker: boolean; + /** + * 是否支持WebSocket + */ + const isWebsocket: boolean; + /** + * 判断是否支持webgl + */ + function isWebGL(): boolean; + } +} diff --git a/types/amap-js-api/common.d.ts b/types/amap-js-api/common.d.ts new file mode 100644 index 0000000000..8b442ad0a3 --- /dev/null +++ b/types/amap-js-api/common.d.ts @@ -0,0 +1,31 @@ +declare namespace AMap { + type SizeValue = Size | [number, number]; + type LocationValue = LngLat | [number, number]; + type Lang = 'zh_cn' | 'en' | 'zh_en'; + + type Event = { type: N } & + (V extends HTMLElement ? { value: V } + : V extends object ? V + : V extends undefined ? {} + : { value: V }); + type MapsEvent = Event; + + type StrokeLineJoin = 'miter' | 'round' | 'bevel'; + type StrokeLineCap = 'butt' | 'round' | 'square'; + type StrokeStyle = 'dashed' | 'solid'; + + type AnimationName = 'AMAP_ANIMATION_NONE' | 'AMAP_ANIMATION_DROP' | 'AMAP_ANIMATION_BOUNCE'; +} diff --git a/types/amap-js-api/convert-from.d.ts b/types/amap-js-api/convert-from.d.ts new file mode 100644 index 0000000000..61f83f9b94 --- /dev/null +++ b/types/amap-js-api/convert-from.d.ts @@ -0,0 +1,27 @@ +declare namespace AMap { + namespace convertFrom { + interface Result { + /** + * 成功状态文字描述 + */ + info: string; // 'ok' + /** + * 高德坐标集合 + */ + locations: LngLat[]; + } + type Type = 'gps' | 'baidu' | 'mapbar'; + type SearchStatus = 'complete' | 'error'; + } + /** + * 为坐标转换类,支持将其他坐标系的坐标点转换为高德坐标系。 + * @param lnglat 待转换坐标 + * @param type 用于说明是哪个服务商的坐标 + * @param callback 转换完成后的回调函数 + */ + function convertFrom( + lnglat: LocationValue | LocationValue[], + type: convertFrom.Type | null, + callback: (status: convertFrom.SearchStatus, result: string | convertFrom.Result) => void + ): void; +} diff --git a/types/amap-js-api/dom-util.d.ts b/types/amap-js-api/dom-util.d.ts new file mode 100644 index 0000000000..e39793f006 --- /dev/null +++ b/types/amap-js-api/dom-util.d.ts @@ -0,0 +1,78 @@ +declare namespace AMap { + namespace DomUtil { + /** + * 获取DOM元素的大小 + * @param dom DOM元素 + */ + function getViewport(dom: HTMLElement): Size; + /** + * 获取DOM元素距离窗口左上角的距离 + * @param dom DOM元素 + */ + function getViewportOffset(dom: HTMLElement): Pixel; + /** + * 在parentNode内部创建一个className类名的tagName元素 + * @param tagName 标签名称 + * @param parent 父节点 + * @param className 类名 + */ + function create( + tagName: K, + parent?: HTMLElement, + className?: string + ): HTMLElementTagNameMap[K]; + /** + * 给DOM元素设置为className样式 + * @param dom DOM元素 + * @param className 类名 + */ + function setClass(dom: HTMLElement, className?: string): void; + /** + * DOM元素是否包含className + * @param dom DOM元素 + * @param className 类名 + */ + function hasClass(dom: HTMLElement, className: string): boolean; + /** + * 给DOM元素添加一个className + * @param dom DOM元素 + * @param className 类名 + */ + function addClass(dom: HTMLElement, className: string): void; + /** + * 给DOM元素删除一个className + * @param dom DOM元素 + * @param className 类名 + */ + function removeClass(dom: HTMLElement, className: string): void; + /** + * 给DOM元素设定一个透明度 + * @param dom DOM元素 + * @param opacity 透明度(0-1) + */ + function setOpacity(dom: HTMLElement, opacity: number): void; + /** + * 给DOM元素旋转一个角度,以center为中心,center以元素左上角为坐标原点 + * @param dom DOM元素 + * @param deg 旋转角度 + * @param origin 旋转中心 + */ + function rotate(dom: HTMLElement, deg: number, origin?: { x: number, y: number }): void; + /** + * 给DOM元素删除一组样式,Object同样式表 + * @param dom DOM元素 + * @param style 样式 + */ + function setCss(dom: HTMLElement | HTMLElement[], style: Partial): typeof DomUtil; // this + /** + * 清空DOM元素 + * @param dom DOM元素 + */ + function empty(dom: HTMLElement): void; + /** + * 将DOM元素从父节点删除 + * @param dom DOM元素 + */ + function remove(dom: HTMLElement): void; + } +} diff --git a/types/amap-js-api/event.d.ts b/types/amap-js-api/event.d.ts new file mode 100644 index 0000000000..d90ee4c720 --- /dev/null +++ b/types/amap-js-api/event.d.ts @@ -0,0 +1,102 @@ +declare namespace AMap { + abstract class EventEmitter { + /** + * 注册事件 + * @param eventName 事件名称 + * @param handler 事件回调函数 + * @param context 事件回调中的上下文 + * @param once 触发一次 + * @param unshift 更改事件顺序 + */ + on( + eventName: string, + // tslint:disable-next-line:no-unnecessary-generics + handler: (this: C, event: E) => void, + context?: C, + once?: boolean, + unshift?: boolean + ): this; + /** + * 移除事件绑定 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ + off( + eventName: string, + // tslint:disable-next-line + handler: ((this: C, event: E) => void) | 'mv', + context?: C + ): this; + /** + * 触发事件 + * @param eventName 事件名称 + * @param data 事件数据 + */ + emit(eventName: string, data?: any): this; + } + + namespace event { + interface EventListener { + type: T; + } + /** + * 注册DOM对象事件 + * @param instance 需注册事件的DOM对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ + function addDomListener( + // tslint:disable-next-line: no-unnecessary-generics + instance: HTMLElementTagNameMap[N], + eventName: E, + handler: (this: C, event: HTMLElementEventMap[E]) => void, + context?: C + ): EventListener<0>; + /** + * 给对象注册事件 + * @param instance 需注册事件的对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ + function addListener( + // tslint:disable-next-line: no-unnecessary-generics + instance: I, + eventName: string, + // tslint:disable-next-line: no-unnecessary-generics + handler: (this: C, event: E) => void, + // tslint:disable-next-line: no-unnecessary-generics + context?: C + ): EventListener<1>; + /** + * 给对象注册一次性事件 + * @param instance 需注册事件的对象 + * @param eventName 事件名称 + * @param handler 事件功能函数 + * @param context 事件上下文 + */ + function addListenerOnce( + // tslint:disable-next-line: no-unnecessary-generics + instance: I, + eventName: string, + // tslint:disable-next-line: no-unnecessary-generics + handler: (this: C, event: E) => void, + // tslint:disable-next-line: no-unnecessary-generics + context?: C + ): EventListener<1>; + /** + * 删除事件 + * @param listener 侦听器 + */ + function removeListener(listener: EventListener<0 | 1>): void; + /** + * 触发非DOM事件 + * @param instance 触发对象 + * @param eventName 事件名称 + * @param data 事件数据 + */ + function trigger(instance: EventEmitter, eventName: string, data?: any): void; + } +} diff --git a/types/amap-js-api/geometry-util.d.ts b/types/amap-js-api/geometry-util.d.ts new file mode 100644 index 0000000000..c8a5eae2e9 --- /dev/null +++ b/types/amap-js-api/geometry-util.d.ts @@ -0,0 +1,192 @@ +declare namespace AMap { + namespace GeometryUtil { + /** + * 计算两个经纬度点之间的实际距离 + */ + function distance( + point1: LocationValue, + point2: LocationValue | LocationValue[] + ): number; + /** + * 计算一个经纬度路径围成区域的实际面积 + */ + function ringArea(ring: LocationValue[]): number; + /** + * 判断一个经纬度路径是否为顺时针 + */ + function isClockwise(path: LocationValue[]): boolean; + /** + * 计算一个经纬度路径的实际长度 + */ + function distanceOfLine(line: LocationValue[]): number; + /** + * 计算两个经纬度面的交叉区域 + */ + function ringRingClip( + ring1: LocationValue[], + ring2: LocationValue[] + ): Array<[number, number]>; + /** + * 判断两个经纬度面是否交叉 + */ + function doesRingRingIntersect( + ring1: LocationValue[], + ring2: LocationValue[] + ): boolean; + /** + * 判断经纬度路径和经纬度面是否交叉 + */ + function doesLineRingIntersect( + line: LocationValue[], + ring: LocationValue[] + ): boolean; + /** + * 判断两个经纬度路径是否相交 + */ + function doesLineLineIntersect( + line1: LocationValue[], + line2: LocationValue[] + ): boolean; + /** + * 判断线段和多个环是否相交 + */ + function doesSegmentPolygonIntersect( + point1: LocationValue, + point2: LocationValue, + polygon: LocationValue[][] + ): boolean; + /** + * 判断线段和一个环是否相交 + */ + function doesSegmentRingIntersect( + point1: LocationValue, + point2: LocationValue, + ring: LocationValue[] + ): boolean; + /** + * 判断线段和一个路径是否相交 + */ + function doesSegmentLineIntersect( + point1: LocationValue, + point2: LocationValue, + line: LocationValue[] + ): boolean; + /** + * 判断两个线段是否相交 + */ + function doesSegmentsIntersect( + point1: LocationValue, + point2: LocationValue, + point3: LocationValue, + point4: LocationValue + ): boolean; + /** + * 判断点是否在环内 + */ + function isPointInRing(point: LocationValue, ring: LocationValue[]): boolean; + /** + * 判断环是否在另一个环内 + */ + function isRingInRing(ring1: LocationValue[], ring2: LocationValue[]): boolean; + /** + * 判断点是否在多个环组成区域内 + */ + function isPointInPolygon(point: LocationValue, polygon: LocationValue[][]): boolean; + /** + * 判断点是否在多个环组成区域内 + */ + function makesureClockwise(path: Array<[number, number]>): Array<[number, number]>; + /** + * 将一个路径变为逆时针 + */ + function makesureAntiClockwise(path: Array<[number, number]>): Array<[number, number]>; + /** + * 计算P2P3上距离P1最近的点 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + */ + function closestOnSegment( + point1: LocationValue, + point2: LocationValue, + point3: LocationValue + ): [number, number]; + /** + * 计算line上距离P最近的点 + */ + function closestOnLine(point: LocationValue, line: LocationValue[]): [number, number]; + /** + * 计算P2P3到P1的距离 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + */ + function distanceToSegment( + point1: LocationValue, + point2: LocationValue, + point3: LocationValue + ): number; + /** + * 计算P到line的距离 + */ + function distanceToLine(point: LocationValue, line: LocationValue[]): number; + /** + * 判断P1是否在P2P3上 + * @param point1 P1 + * @param point2 P2 + * @param point3 P3 + * @param tolerance 误差范围 + */ + function isPointOnSegment( + point1: LocationValue, + point2: LocationValue, + point3: LocationValue, + tolerance?: number + ): boolean; + /** + * 判断P是否在line上 + * @param point 点P + * @param line 线 + * @param tolerance 误差范围 + */ + function isPointOnLine( + point: LocationValue, + line: LocationValue[], + tolerance?: number + ): boolean; + /** + * 判断P是否在ring的边上 + * @param point 点P + * @param ring 环 + * @param tolerance 误差范围 + */ + function isPointOnRing( + point: LocationValue, + ring: LocationValue[], + tolerance?: number + ): boolean; + /** + * 判断P是否在多个ring的边上 + * @param point 点P + * @param polygon 多边形 + * @param tolerance 误差范围 + */ + function isPointOnPolygon( + point: LocationValue, + polygon: LocationValue[][], + tolerance?: number + ): boolean; + + function doesPolygonPolygonIntersect( + polygon1: LocationValue[], + polygon2: LocationValue[] + ): boolean; + + function distanceToPolygon(point: LocationValue, polygon: LocationValue[]): number; + + function triangulateShape( + shape1: LngLat[] | Pixel[] | [number, number], + shape2: LngLat[] | Pixel[] | [number, number] + ): number[]; + } +} diff --git a/types/amap-js-api/index.d.ts b/types/amap-js-api/index.d.ts new file mode 100644 index 0000000000..5b8c1a5b94 --- /dev/null +++ b/types/amap-js-api/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for non-npm package amap-js-api 1.4 +// Project: https://lbs.amap.com/api/javascript-api/summary +// Definitions by: breeze9527 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/types/amap-js-api/layer/building.d.ts b/types/amap-js-api/layer/building.d.ts new file mode 100644 index 0000000000..1b7426e28d --- /dev/null +++ b/types/amap-js-api/layer/building.d.ts @@ -0,0 +1,54 @@ +declare namespace AMap { + namespace Buildings { + interface Options extends Layer.Options { + /** + * 可见级别范围 + */ + zooms?: [number, number]; + /** + * 不透明度 + */ + opacity?: number; + /** + * 高度比例系数,可控制3D视图下的楼块高度 + */ + heightFactor?: number; + /** + * 是否可见 + */ + visible?: boolean; + /** + * 层级 + */ + zIndex?: number; + + // inner + merge?: boolean; + sort?: boolean; + } + interface AreaStyle { + color1: string; + path: LocationValue[]; + color2?: string; + visible?: boolean; + rejectTexture?: boolean; + } + interface Style { + hideWithoutStyle?: boolean; + areas: AreaStyle[]; + } + } + + class Buildings extends Layer { + /** + * 楼块图层,单独展示矢量化的楼块图层 + * @param opts 图层选项 + */ + constructor(opts?: Buildings.Options); + /** + * 按区域设置楼块的颜色 + * @param style 颜色设置 + */ + setStyle(style: Buildings.Style): void; + } +} diff --git a/types/amap-js-api/layer/flexible.d.ts b/types/amap-js-api/layer/flexible.d.ts new file mode 100644 index 0000000000..d91970dc31 --- /dev/null +++ b/types/amap-js-api/layer/flexible.d.ts @@ -0,0 +1,38 @@ +declare namespace AMap { + namespace TileLayer { + namespace Flexible { + interface Options extends TileLayer.Options { + /** + * 创建切片回调 + * @param x 横坐标 + * @param y 纵坐标 + * @param z 层级 + * @param success 成功回调 + * @param fail 失败回调 + */ + createTile?( + x: number, + y: number, + z: number, + success: (tile: HTMLImageElement | HTMLCanvasElement) => void, + fail: () => void + ): void; + /** + * 内存中缓存的切片的数量上限 + */ + cacheSize?: number; + /** + * 是否显示 + */ + visible?: boolean; + } + } + class Flexible extends TileLayer { + /** + * 灵活切片图层 + * @param options 图层选项 + */ + constructor(options?: Flexible.Options); + } + } +} diff --git a/types/amap-js-api/layer/layer.d.ts b/types/amap-js-api/layer/layer.d.ts new file mode 100644 index 0000000000..64714bc68f --- /dev/null +++ b/types/amap-js-api/layer/layer.d.ts @@ -0,0 +1,56 @@ +declare namespace AMap { + namespace Layer { + interface Options { + /** + * 所属的地图对象 + */ + map?: Map; + } + } + + abstract class Layer extends EventEmitter { + /** + * 图层获取DOM节点 + */ + getContainer(): HTMLDivElement | undefined; + /** + * 获取图层缩放范围 + */ + getZooms(): [number, number]; + /** + * 设置透明度 + * @param alpha 透明度 + */ + setOpacity(alpha: number): void; + /** + * 设置透明度 + */ + getOpacity(): number; + /** + * 显示图层 + */ + show(): void; + /** + * 隐藏图层 + */ + hide(): void; + /** + * 设置图层所属地图 + * @param map map对象 + */ + setMap(map?: Map | null): void; + /** + * 获取图层所属地图 + */ + getMap(): Map | null | undefined; + /** + * 设置图层的层级 + * @param index 层级 + */ + setzIndex(index: number): void; + /** + * 获取图层的层级 + */ + getzIndex(): number; + } +} diff --git a/types/amap-js-api/layer/layerGroup.d.ts b/types/amap-js-api/layer/layerGroup.d.ts new file mode 100644 index 0000000000..6a07c8fc72 --- /dev/null +++ b/types/amap-js-api/layer/layerGroup.d.ts @@ -0,0 +1,56 @@ +declare namespace AMap { + class LayerGroup extends Layer { + /** + * 图层集合 + * @param layers 集合中的图层 + */ + constructor(layers: L | L[]); + /** + * 添加单个图层到集合中,不支持添加重复的图层 + * @param layer 图层 + */ + addLayer(layer: L | L[]): this; + /** + * 添加图层数组到集合中,不支持添加重复的图层 + * @param layers 图层数组 + */ + addLayers(layers: L | L[]): this; + /** + * 返回当前集合中所有的图层 + */ + getLayers(): L[]; + getLayer(finder: (this: null, item: L, index: number, list: L[]) => boolean): L | null; + /** + * 判断传入的图层实例是否在集合中 + * @param layer 目标图层 + */ + hasLayer(layer: L | ((this: null, item: L, index: number, list: L[]) => boolean)): boolean; + /** + * 从集合中删除传入的图层实例 + * @param layer 图层 + */ + removeLayer(layer: L | L[]): this; + /** + * 从集合中删除传入的图层实例数组 + * @param layers 图层数组 + */ + removeLayers(layers: L | L[]): this; + /** + * 清空集合 + */ + clearLayers(): this; + /** + * 对集合中的图层做迭代操作 + * @param iterator 迭代回调 + * @param context 执行上下文 + */ + eachLayer(iterator: (this: C, layer: L, index: number, list: L[]) => void, context?: C): void; + + // overwrite + setMap(map?: Map): this; + hide(): this; + show(): this; + reload(): this; + setOptions(options: any): this; + } +} diff --git a/types/amap-js-api/layer/massMarks.d.ts b/types/amap-js-api/layer/massMarks.d.ts new file mode 100644 index 0000000000..963f7e2ec6 --- /dev/null +++ b/types/amap-js-api/layer/massMarks.d.ts @@ -0,0 +1,99 @@ +declare namespace AMap { + namespace MassMarks { + interface EventMap { + click: UIEvent<'click', I>; + dblclick: UIEvent<'dblclick', I>; + mousedown: UIEvent<'mousedown', I>; + mouseup: UIEvent<'mouseup', I>; + mouseover: UIEvent<'mouseover', I>; + mouseout: UIEvent<'mouseout', I>; + touchstart: UIEvent<'touchstart', I>; + touchend: UIEvent<'touchend', I>; + } + + interface Style { + /** + * 图标显示位置偏移量,以图标的左上角为基准点(0,0)点 + */ + anchor: Pixel; + /** + * 图标的地址 + */ + url: string; + /** + * 图标的尺寸 + */ + size: Size; + /** + * 旋转角度 + */ + rotation?: number; + } + + type UIEvent = Event ? D : Data; + }>; + + interface Options extends Layer.Options { + /** + * 显示层级 + */ + zIndex?: number; + /** + * 指针样式 + */ + cursor?: string; + /** + * 是否在拖拽缩放过程中实时重绘 + */ + alwayRender?: boolean; + /** + * 设置点的样式 + */ + style: Style | Style[]; + // rejectMapMask + } + interface Data { + lnglat: LocationValue; + style?: number; + } + } + + class MassMarks extends Layer { + /** + * 海量点类,利用该类可同时在地图上展示万级别的点 + * @param data 点对象数组或url + * @param opts 选项 + */ + constructor(data: D[] | string, opts: MassMarks.Options); + /** + * 设置显示样式 + * @param style 样式设置 + */ + setStyle(style: MassMarks.Style | MassMarks.Style[]): void; + /** + * 获取显示样式 + */ + getStyle(): MassMarks.Style | MassMarks.Style[]; + /** + * 设置数据集 + * @param data 数据集 + */ + setData(data: D[] | string): void; + /** + * 获取数据集 + */ + getData(): Array> & { lnglat: LngLat }>; + /** + * 清除海量点 + */ + clear(): void; + } +} diff --git a/types/amap-js-api/layer/mediaLayer.d.ts b/types/amap-js-api/layer/mediaLayer.d.ts new file mode 100644 index 0000000000..43fee214bb --- /dev/null +++ b/types/amap-js-api/layer/mediaLayer.d.ts @@ -0,0 +1,94 @@ +declare namespace AMap { + namespace MediaLayer { + interface Options extends Layer.Options { + /** + * 显示范围 + */ + bounds?: Bounds; + /** + * 是否可见 + */ + visible?: boolean; + /** + * 缩放范围 + */ + zooms?: [number, number]; + /** + * 透明度 + */ + opacity?: number; + } + } + + abstract class MediaLayer extends Layer { + /** + * @param options 图层选项 + */ + constructor(options?: MediaLayer.Options); + /** + * 设置显示范围 + * @param bounds 显示范围 + */ + setBounds(bounds: Bounds): void; + /** + * 获取显示的范围 + */ + getBounds(): Bounds; + /** + * 设置图层选项 + * @param options 图层选项 + */ + setOptions(options: Partial): void; + /** + * 获取图层选项 + */ + getOptions(): Partial; + /** + * 获取元素 + */ + getElement(): E | null; + } + + /** + * 图片图层 + */ + class ImageLayer extends MediaLayer { + /** + * 修改Image的Url + * @param url url + */ + setImageUrl(url: string): void; + /** + * 返回Image的Url + */ + getImageUrl(): string | undefined; + } + + class VideoLayer extends MediaLayer { + /** + * 修改Video的Url + * @param source url + */ + setVideoUrl(source: string | string[]): void; + /** + * 返回Video的Url + */ + getVideoUrl(): string | string[] | undefined; + } + + class CanvasLayer extends MediaLayer { + /** + * 修改显示的Canvas + * @param canvas Canvas对象 + */ + setCanvas(canvas: HTMLCanvasElement): void; + /** + * 返回Canvas对象 + */ + getCanvas(): HTMLCanvasElement | undefined; + /** + * 当canvas的内容发生改变是用于刷新图层 + */ + reFresh(): void; + } +} diff --git a/types/amap-js-api/layer/tileLayer.d.ts b/types/amap-js-api/layer/tileLayer.d.ts new file mode 100644 index 0000000000..1a146b964c --- /dev/null +++ b/types/amap-js-api/layer/tileLayer.d.ts @@ -0,0 +1,91 @@ +declare namespace AMap { + namespace TileLayer { + interface EventMap { + complete: Event<'complete'>; + } + + interface Options extends Layer.Options { + /** + * 切片大小 + */ + tileSize?: number; + /** + * 切片取图地址(自1.3版本起,该属性与getTileUrl属性合并) + */ + tileUrl?: string; + /** + * 取图错误时的代替地址 + */ + errorUrl?: string; + /** + * 获取图块取图地址 + */ + getTileUrl?: string | ((x: number, y: number, level: number) => string); + /** + * 图层叠加的顺序值 + */ + zIndex?: number; + /** + * 图层的透明度 + */ + opacity?: number; + /** + * 支持的缩放级别范围 + */ + zooms?: [number, number]; + /** + * 是否在高清屏下进行清晰度适配 + */ + detectRetina?: boolean; + } + /** + * 卫星图层 + */ + class Satellite extends TileLayer { } + /** + * 路网图层 + */ + class RoadNet extends TileLayer { } + + namespace Traffic { + interface Options extends TileLayer.Options { + /** + * 是否设置可以自动刷新实时路况信息 + */ + autoRefresh?: boolean; + /** + * 设置刷新间隔时长 + */ + interval?: number; + } + } + class Traffic extends TileLayer { + /** + * 实时交通图层 + * @param options 图层选项 + */ + constructor(options?: Traffic.Options); + } + } + + class TileLayer extends Layer { + /** + * 切片图层 + * @param options 图层选项 + */ + constructor(options?: TileLayer.Options); + /** + * 获取当前图层所有切片号 + */ + getTiles(): string[]; + /** + * 重新加载此图层 + */ + reload(): void; + /** + * 设置图层的取图地址 + * @param url 取图地址 + */ + setTileUrl(url: string | ((x: number, y: number, level: number) => string)): void; + } +} diff --git a/types/amap-js-api/layer/wms.d.ts b/types/amap-js-api/layer/wms.d.ts new file mode 100644 index 0000000000..043975d856 --- /dev/null +++ b/types/amap-js-api/layer/wms.d.ts @@ -0,0 +1,56 @@ +declare namespace AMap { + namespace TileLayer { + namespace WMS { + interface Params { + VERSION?: string; + LAYERS?: string; + STYLES?: string; + FORMAT?: string; + TRANSPARENT?: 'TRUE' | 'FALSE'; + BGCOLOR?: string; + EXCEPTIONS?: string; + TIME?: string; + ELEVATION?: string; + } + interface Options extends Flexible.Options { + /** + * wms服务的url地址 + */ + url: string; + /** + * OGC标准的WMS地图服务的GetMap接口的参数 + */ + params: Params; + /** + * 地图级别切换时,不同级别的图片是否进行混合 + */ + blend?: boolean; + } + } + class WMS extends Flexible { + /** + * WMS图层 + * @param options 图层选项 + */ + constructor(options: WMS.Options); + /** + * 设置wms服务地址 + * @param url 服务地址 + */ + setUrl(url: string): void; + /** + * 返回wms服务地址 + */ + getUrl(): string; + /** + * 设置OGC标准的WMS getMap接口的参数 + * @param params 接口参数 + */ + setParams(params: WMS.Params): void; + /** + * 返回OGC标准的WMS getMap接口的参数 + */ + getParams(): WMS.Params; + } + } +} diff --git a/types/amap-js-api/layer/wmts.d.ts b/types/amap-js-api/layer/wmts.d.ts new file mode 100644 index 0000000000..7a122dd6b9 --- /dev/null +++ b/types/amap-js-api/layer/wmts.d.ts @@ -0,0 +1,52 @@ +declare namespace AMap { + namespace TileLayer { + namespace WMTS { + interface Params { + Version?: string; + Layer?: string; + Style?: string; + Format?: string; + } + interface Options extends Flexible.Options { + /** + * wmts服务的url地址 + */ + url: string; + /** + * OGC标准的WMTS地图服务的GetTile接口的参数 + */ + params: Params; + /** + * 地图级别切换时,不同级别的图片是否进行混合 + */ + blend?: boolean; + } + } + + class WMTS extends Flexible { + /** + * WMTS图层 + * @param options 图层选项 + */ + constructor(options: WMTS.Options); + /** + * 设置wmts服务地址 + * @param url 服务地址 + */ + setUrl(url: string): void; + /** + * 返回wmts服务地址 + */ + getUrl(): string; + /** + * 设置OGC标准的WMTS getTile接口的参数 + * @param params 接口参数 + */ + setParams(params: WMTS.Params): void; + /** + * 返回OGC标准的WMTS getTile接口的参数 + */ + getParams(): WMTS.Params; + } + } +} diff --git a/types/amap-js-api/lngLat.d.ts b/types/amap-js-api/lngLat.d.ts new file mode 100644 index 0000000000..f649a78de8 --- /dev/null +++ b/types/amap-js-api/lngLat.d.ts @@ -0,0 +1,45 @@ +declare namespace AMap { + class LngLat { + /** + * 构造一个地理坐标对象 + * @param lng 经度 + * @param lat 纬度 + * @param noAutofix 是否自动修正 + */ + constructor(lng: number, lat: number, noAutofix?: boolean); + /** + * 移动当前经纬度坐标得到新的坐标 + * @param east 移动经度,向右为正值 + * @param north 移动维度,向上为正值 + */ + offset(east: number, north: number): LngLat; + /** + * 当前经纬度和传入经纬度或者经纬度数组连线之间的地面距离,单位为米 + * @param lnglat 对比目标 + */ + distance(lnglat: LngLat | LngLat[]): number; + /** + * 获取经度值 + */ + getLng(): number; + /** + * 获取纬度值 + */ + getLat(): number; + /** + * 判断当前坐标对象与传入坐标对象是否相等 + * @param lnglat 判断目标 + */ + equals(lnglat: LngLat): boolean; + /** + * 以字符串的形式返回 + */ + toString(): string; + + // internal + add(lnglat: LngLat, noAutofix?: boolean): LngLat; + subtract(lnglat: LngLat, noAutofix?: boolean): LngLat; + divideBy(num: number, noAutofix?: boolean): LngLat; + multiplyBy(num: number, noAutofix?: boolean): LngLat; + } +} diff --git a/types/amap-js-api/map.d.ts b/types/amap-js-api/map.d.ts new file mode 100644 index 0000000000..e7937966b1 --- /dev/null +++ b/types/amap-js-api/map.d.ts @@ -0,0 +1,568 @@ +declare namespace AMap { + namespace Map { + type Feature = 'bg' | 'point' | 'road' | 'building'; + type ViewMode = '2D' | '3D'; + interface Options { + /** + * 地图视口,用于控制影响地图静态显示的属性 + */ + view?: View2D; + /** + * 地图图层数组,数组可以是图层 中的一个或多个,默认为普通二维地图 + */ + layers?: Layer[]; + /** + * 地图显示的缩放级别 + */ + zoom?: number; + /** + * 地图中心点坐标值 + */ + center?: LocationValue; + /** + * 地图标注显示顺序 + */ + labelzIndex?: number; + /** + * 地图显示的缩放级别范围 + */ + zooms?: [number, number]; + /** + * 地图语言类型 + */ + lang?: Lang; + /** + * 地图默认鼠标样式 + */ + defaultCursor?: string; + /** + * 地图显示的参考坐标系 + */ + crs?: 'EPSG3857' | 'EPSG3395' | 'EPSG4326'; + /** + * 地图平移过程中是否使用动画 + */ + animateEnable?: boolean; + /** + * 是否开启地图热点和标注的hover效果 + */ + isHotspot?: boolean; + /** + * 当前地图中默认显示的图层 + */ + defaultLayer?: TileLayer; + /** + * 地图是否可旋转 + */ + rotateEnable?: boolean; + /** + * 是否监控地图容器尺寸变化 + */ + resizeEnable?: boolean; + /** + * 是否在有矢量底图的时候自动展示室内地图 + */ + showIndoorMap?: boolean; + /** + * 在展示矢量图的时候自动展示室内地图图层 + */ + // indoorMap?: IndorMap + /** + * 是否支持可以扩展最大缩放级别 + */ + expandZoomRange?: boolean; + /** + * 地图是否可通过鼠标拖拽平移 + */ + dragEnable?: boolean; + /** + * 地图是否可缩放 + */ + zoomEnable?: boolean; + /** + * 地图是否可通过双击鼠标放大地图 + */ + doubleClickZoom?: boolean; + /** + * 地图是否可通过键盘控制 + */ + keyboardEnable?: boolean; + /** + * 地图是否使用缓动效果 + */ + jogEnable?: boolean; + /** + * 地图是否可通过鼠标滚轮缩放浏览 + */ + scrollWheel?: boolean; + /** + * 地图在移动终端上是否可通过多点触控缩放浏览地图 + */ + touchZoom?: boolean; + /** + * 当touchZoomCenter=1的时候,手机端双指缩放的以地图中心为中心,否则默认以双指中间点为中心 + */ + touchZoomCenter?: number; + /** + * 设置地图的显示样式 + */ + mapStyle?: string; + /** + * 设置地图上显示的元素种类 + */ + features?: Feature[] | 'all' | Feature; + /** + * 设置地图显示3D楼块效果 + */ + showBuildingBlock?: boolean; + /** + * 视图模式 + */ + viewMode?: ViewMode; + /** + * 俯仰角度 + */ + pitch?: number; + /** + * 是否允许设置俯仰角度 + */ + pitchEnable?: boolean; + /** + * 楼块出现和消失的时候是否显示动画过程 + */ + buildingAnimation?: boolean; + /** + * 调整天空颜色 + */ + skyColor?: string; + /** + * 设置地图的预加载模式 + */ + preloadMode?: boolean; + /** + * 为 Map 实例指定掩模的路径,各图层将只显示路径范围内图像 + */ + mask?: Array<[number, number]> | Array> | Array>>; + maxPitch?: number; + rotation?: number; + forceVector?: boolean; + + // internal + baseRender?: 'vw' | 'd' | 'dv' | 'v'; + overlayRender?: 'c' | 'd'; + showLabel?: boolean; + gridMapForeign?: boolean; + logoUrl?: string; + logoUrlRetina?: string; + copyright?: string; + turboMode?: boolean; + workerMode?: boolean; + // continuousZoomEnable?: boolean; + // showFog: boolean; + // yaw: number; + // scale: number; + // detectRetina: number; + } + interface Status { + /** + * 是否开启动画 + */ + animateEnable: boolean; + /** + * 是否双击缩放 + */ + doubleClickZoom: boolean; + /** + * 是否支持拖拽 + */ + dragEnable: boolean; + isHotspot: boolean; + /** + * 是否开启缓动效果 + */ + jogEnable: boolean; + /** + * 是否支持键盘 + */ + keyboardEnable: boolean; + /** + * 是否支持调整俯仰角 + */ + pitchEnable: boolean; + resizeEnable: boolean; + /** + * 是否支持旋转 + */ + rotateEnable: boolean; + /** + * 是否支持滚轮缩放 + */ + scrollWheel: boolean; + /** + * 是否支持触摸缩放 + */ + touchZoom: boolean; + /** + * 是否支持缩放 + */ + zoomEnable: boolean; + } + type HotspotEvent = Event; + interface EventMap { + click: MapsEvent<'click', Map>; + dblclick: MapsEvent<'dblclick', Map>; + rightclick: MapsEvent<'rightclick', Map>; + rdblclick: MapsEvent<'rdblclick', Map>; + mouseup: MapsEvent<'mouseup', Map>; + mousedown: MapsEvent<'mousedown', Map>; + mousemove: MapsEvent<'mousemove', Map>; + mousewheel: MapsEvent<'mousewheel', Map>; + mouseover: MapsEvent<'mouseover', Map>; + mouseout: MapsEvent<'mouseout', Map>; + touchstart: MapsEvent<'touchstart', Map>; + touchmove: MapsEvent<'touchmove', Map>; + touchend: MapsEvent<'touchend', Map>; + contextmenu: MapsEvent<'contextmenu', Map>; + + hotspotclick: HotspotEvent<'hotspotclick'>; + hotspotover: HotspotEvent<'hotspotover'>; + hotspotout: HotspotEvent<'hotspotout'>; + + complete: Event<'complete'>; + mapmove: Event<'mapmove'>; + movestart: Event<'movestart'>; + moveend: Event<'moveend'>; + zoomchange: Event<'zoomchange'>; + zoomstart: Event<'zoomstart'>; + zoomend: Event<'zoomend'>; + dragstart: Event<'dragstart'>; + dragging: Event<'dragging'>; + dragend: Event<'dragend'>; + resize: Event<'resize'>; + } + } + + class Map extends EventEmitter { + /** + * 构造一个地图对象 + * @param container 地图容器的id或者是DOM元素 + * @param opts 选项 + */ + constructor(container: string | HTMLElement, opts?: Map.Options); + /** + * 唤起高德地图客户端marker页 + * @param obj 唤起参数 + */ + poiOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void; + /** + * 唤起高德地图客户端marker详情页 + * @param obj 唤起参数 + */ + detailOnAMAP(obj: { id: string; location?: LocationValue; name?: string }): void; + /** + * 获取当前地图缩放级别 + */ + getZoom(): number; + /** + * 获取地图图层数组 + */ + getLayers(): Layer[]; + /** + * 获取地图中心点经纬度坐标值 + */ + getCenter(): LngLat; + /** + * 返回地图对象的容器 + */ + getContainer(): HTMLElement | null; + /** + * 获取地图中心点所在区域 + */ + getCity(callback: (cityData: { + /** + * 市名称 + */ + city: string; + /** + * 市代码 + */ + citycode: string; + /** + * 区名称 + */ + district: string; + /** + * 省 + */ + province: string | never[]; // province is empty array when getCity fail + }) => void): void; + /** + * 获取当前地图视图范围,获取当前可视区域 + */ + getBounds(): Bounds; + /** + * 获取当前地图标注的显示顺序 + */ + getLabelzIndex(): number; + /** + * 获取Map的限制区域 + */ + getLimitBounds(): Bounds; + /** + * 获取地图语言类型 + */ + getLang(): Lang; + /** + * 获取地图容器像素大小 + */ + getSize(): Size; + /** + * 获取地图顺时针旋转角度 + */ + getRotation(): number; + /** + * 获取当前地图状态信息 + */ + getStatus(): Map.Status; + /** + * 获取地图默认鼠标指针样式 + */ + getDefaultCursor(): string; + /** + * 获取指定位置的地图分辨率 + * @param point 指定经纬度 + */ + getResolution(point?: LocationValue): number; + /** + * 获取当前地图比例尺 + * @param dpi dpi + */ + getScale(dpi?: number): number; + /** + * 设置地图显示的缩放级别 + * @param level 缩放级别 + */ + setZoom(level: number): void; + /** + * 设置地图标注显示的顺序 + * @param index 显示顺序 + */ + setLabelzIndex(index: number): void; + /** + * 设置地图图层数组 + * @param layers 图层数组 + */ + setLayers(layers: Layer[]): void; + /** + * 添加覆盖物/图层 + * @param overlay 覆盖物/图层 + */ + add(overlay: Overlay | Overlay[]): void; + /** + * 删除覆盖物/图层 + * @param overlay 覆盖物/图层 + */ + remove(overlay: Overlay | Overlay[]): void; + /** + * 返回添加的覆盖物对象 + * @param type 覆盖物类型 + */ + getAllOverlays(type?: 'marker' | 'circle' | 'polyline' | 'polygon'): Overlay[]; + /** + * 设置地图显示的中心点 + * @param center 中心点经纬度 + */ + setCenter(center: LocationValue): void; + /** + * 地图缩放至指定级别并以指定点为地图显示中心点 + * @param zoomLevel 缩放等级 + * @param center 缩放中心 + */ + setZoomAndCenter(zoomLevel: number, center: LocationValue): void; + /** + * 按照行政区名称或adcode来设置地图显示的中心点。 + * @param city 城市名称或城市编码 + * @param callback 回调 + */ + setCity(city: string, callback: (this: this, coord: [string, string], zoom: number) => void): void; + /** + * 指定当前地图显示范围 + * @param bound 显示范围 + */ + setBounds(bound: Bounds): Bounds; + /** + * 设置Map的限制区域 + * @param bound 限制区域 + */ + setLimitBounds(bound: Bounds): void; + /** + * 清除限制区域 + */ + clearLimitBounds(): void; + /** + * 设置地图语言类型 + * @param lang 语言类型 + */ + setLang(lang: Lang): void; + /** + * 设置地图顺时针旋转角度,旋转原点为地图容器中心点 + * @param rotation 旋转角度 + */ + setRotation(rotation: number): void; + /** + * 设置当前地图显示状态 + * @param status 状态 + */ + setStatus(status: Partial): void; + /** + * 设置鼠标指针默认样式 + * @param cursor 指针样式 + */ + setDefaultCursor(cursor: string): void; + /** + * 地图放大一级显示 + */ + zoomIn(): void; + /** + * 地图缩小一级显示 + */ + zoomOut(): void; + /** + * 地图中心点平移至指定点位置 + * @param position 目标位置经纬度 + */ + panTo(position: LocationValue): void; + /** + * 以像素为单位,沿x方向和y方向移动地图 + * @param x 横向移动像素,向右为正 + * @param y 纵向移动像素,向下为正 + */ + panBy(x: number, y: number): void; + /** + * 根据地图上添加的覆盖物分布情况,自动缩放地图到合适的视野级别 + * @param overlayList 覆盖物数组 + * @param immediately 是否需要动画过程 + * @param avoid 上下左右的像素避让宽度 + * @param maxZoom 最大缩放级别 + */ + setFitView( + overlayList?: Overlay | Overlay[], + immediately?: boolean, + avoid?: [number, number, number, number], + maxZoom?: number + ): Bounds | false | undefined; + /** + * 删除地图上所有的覆盖物 + */ + clearMap(): void; + /** + * 注销地图对象,并清空地图容器 + */ + destroy(): void; + /** + * 加载插件, + * tips: 插件的类型定义不在本类型定义中给出,需要另行安装例如 + * 3d地图:@types/amap-js-api-map3d + * 地区搜索:@types/amap-js-api-place-search + * @param name 插件名称 + * @param callback 插件加载完成后的回调函数 + */ + plugin(name: string | string[], callback: () => void): this; + /** + * 添加控件 + * @param control 控件 + */ + addControl(control: {}): void; // TODO + /** + * 移除控件 + * @param control 控件 + */ + removeControl(control: {}): void; // TODO + /** + * 清除地图上的信息窗体。 + */ + clearInfoWindow(): void; + /** + * 平面地图像素坐标转换为地图经纬度坐标 + * @param pixel 像素坐标 + * @param level 缩放等级 + */ + pixelToLngLat(pixel: Pixel, level?: number): LngLat; + /** + * 地图经纬度坐标转换为平面地图像素坐标 + * @param lnglat 经纬度坐标 + * @param level 缩放等级 + */ + lnglatToPixel(lnglat: LocationValue, level?: number): Pixel; + /** + * 地图容器像素坐标转为地图经纬度坐标 + * @param pixel 地图像素坐标 + */ + containerToLngLat(pixel: Pixel): LngLat; + /** + * 地图经纬度坐标转为地图容器像素坐标 + * @param lnglat 经纬度坐标 + */ + lngLatToContainer(lnglat: LocationValue): Pixel; + /** + * 地图经纬度坐标转为地图容器像素坐标 + * @param lnglat 经纬度坐标 + */ + lnglatTocontainer(lnglat: LocationValue): Pixel; + /** + * 设置地图的显示样式 + * @param style 地图样式 + */ + setMapStyle(style: string): void; + /** + * 获取地图显示样式 + */ + getMapStyle(): string; + /** + * 设置地图上显示的元素种类 + * @param feature 元素 + */ + setFeatures(feature: Map.Feature | Map.Feature[] | 'all'): void; + /** + * 获取地图显示元素种类 + */ + getFeatures(): Map.Feature | Map.Feature[] | 'all'; + /** + * 修改底图图层 + * @param layer 图层 + */ + setDefaultLayer(layer: TileLayer): void; + /** + * 设置俯仰角 + * @param pitch 俯仰角 + */ + setPitch(pitch: number): void; + /** + * 获取俯仰角 + */ + getPitch(): number; + + getViewMode_(): Map.ViewMode; + lngLatToGeodeticCoord(lnglat: LocationValue): Pixel; + geodeticCoordToLngLat(pixel: Pixel): LngLat; + } +} diff --git a/types/amap-js-api/overlay/bezierCurve.d.ts b/types/amap-js-api/overlay/bezierCurve.d.ts new file mode 100644 index 0000000000..b861440a92 --- /dev/null +++ b/types/amap-js-api/overlay/bezierCurve.d.ts @@ -0,0 +1,35 @@ +declare namespace AMap { + namespace BezierCurve { + interface EventMap extends Polyline.EventMap { } + type Options = Merge, { + /** + * 贝瑟尔曲线的路径 + */ + path: Array>>; + // internal + tolerance?: number; + interpolateNumLimit?: [number | number]; + }>; + + interface GetOptionsResult extends Polyline.GetOptionsResult { + /** + * 贝瑟尔曲线的路径 + */ + path: Array; + } + } + class BezierCurve extends Polyline { + /** + * 贝瑟尔曲线 + * @param options 覆盖物选项 + */ + constructor(options: BezierCurve.Options); + /** + * 获取覆盖物选项 + */ + getOptions(): Partial>; + // internal + getInterpolateLngLats(): LngLat[]; + getSerializedPath(): number[][]; + } +} diff --git a/types/amap-js-api/overlay/circle.d.ts b/types/amap-js-api/overlay/circle.d.ts new file mode 100644 index 0000000000..bb3caf4e60 --- /dev/null +++ b/types/amap-js-api/overlay/circle.d.ts @@ -0,0 +1,84 @@ +declare namespace AMap { + namespace Circle { + interface EventMap extends ShapeOverlay.EventMap { + setCenter: Event<'setCenter'>; + setRadius: Event<'setRadius'>; + } + + interface Options { + map?: Map; + zIndex?: number; + center?: LocationValue; + bubble?: boolean; + cursor?: string; + radius?: number; + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + fillColor?: string; + fillOpacity?: number; + strokeStyle?: StrokeStyle; + extData?: ExtraData; + strokeDasharray?: number[]; + + // internal + visible?: boolean; + unit?: 'meter' | 'px'; // 'might be typo' + } + + type GetOptionsResult = Merge, { + path: LngLat[]; + center: LngLat; + radius: number; + }>; + } + + class Circle extends ShapeOverlay { + /** + * 圆形覆盖物 + * @param options 覆盖物选项 + */ + constructor(options?: Circle.Options); + /** + * 设置圆中心点 + * @param center 中心点经纬度 + * @param preventEvent 阻止触发事件 + */ + setCenter(center: LocationValue, preventEvent?: boolean): void; + /** + * 获取圆中心点 + */ + getCenter(): LngLat | undefined; + /** + * 获取圆外切矩形范围 + */ + getBounds(): Bounds | null; + /** + * 设置圆形的半径 + * @param radius 半径 + * @param preventEvent 阻止触发事件 + */ + setRadius(radius: number, preventEvent?: boolean): void; + /** + * 获取圆形的半径 + */ + getRadius(): number; + /** + * 修改选项 + * @param options 选项 + */ + setOptions(options?: Circle.Options): void; + /** + * 获取选项 + */ + getOptions(): Partial>; + /** + * 判断指定点坐标是否在圆内 + * @param point 坐标 + */ + contains(point: LocationValue): boolean; + + // internal + getPath(count?: number): LngLat[]; + } +} diff --git a/types/amap-js-api/overlay/circleMarker.d.ts b/types/amap-js-api/overlay/circleMarker.d.ts new file mode 100644 index 0000000000..0b67d7f13e --- /dev/null +++ b/types/amap-js-api/overlay/circleMarker.d.ts @@ -0,0 +1,7 @@ +declare namespace AMap { + // tslint:disable-next-line; + /** + * 圆点标记 + */ + class CircleMarker extends Circle {} +} diff --git a/types/amap-js-api/overlay/contextMenu.d.ts b/types/amap-js-api/overlay/contextMenu.d.ts new file mode 100644 index 0000000000..eacb6673c8 --- /dev/null +++ b/types/amap-js-api/overlay/contextMenu.d.ts @@ -0,0 +1,50 @@ +declare namespace AMap { + namespace ContextMenu { + interface Options { + /** + * 右键菜单内容 + */ + content?: string | HTMLElement; + + // internal + visible?: boolean; + } + + interface EventMap { + items: Event<'items'>; + open: Event<'open', { target: I }>; + close: Event<'close', { target: I }>; + } + } + + class ContextMenu extends Overlay { + /** + * 地图右键菜单 + * @param options 选项 + */ + constructor(options?: ContextMenu.Options); + /** + * 右键菜单中添加菜单项 + * @param text 菜单显示内容 + * @param fn 该菜单下需进行的操作 + * @param num 当前菜单项在右键菜单中的排序位置,以0开始 + */ + addItem(text: string, fn: (this: HTMLLIElement) => void, num?: number): void; + /** + * 删除一个菜单项 + * @param text 菜单显示内容 + * @param fn 该菜单下需进行的操作 + */ + removeItem(text: string, fn: (this: HTMLLIElement) => void): void; + /** + * 在地图的指定位置打开右键菜单。 + * @param map 目标地图 + * @param position 打开位置经纬度 + */ + open(map: Map, position: LocationValue): void; + /** + * 关闭右键菜单 + */ + close(): void; + } +} diff --git a/types/amap-js-api/overlay/ellipse.d.ts b/types/amap-js-api/overlay/ellipse.d.ts new file mode 100644 index 0000000000..de9da22e0c --- /dev/null +++ b/types/amap-js-api/overlay/ellipse.d.ts @@ -0,0 +1,49 @@ +declare namespace AMap { + namespace Ellipse { + interface EventMap extends ShapeOverlay.EventMap { + setPath: Event<'setPath'>; + setCenter: Event<'setCenter'>; + } + + interface Options extends Polygon.Options { + /** + * 椭圆的中心 + */ + center?: LocationValue; + /** + * 椭圆半径 + */ + radius?: [number, number]; + } + type GetOptionsResult = Merge, { + radius: [number, number]; + }>; + } + + class Ellipse extends Polygon { + /** + * 椭圆 + * @param options 选项 + */ + constructor(options?: Ellipse.Options); + /** + * 获取椭圆的中心点 + */ + getCenter(): LngLat | undefined; + /** + * 设置椭圆的中心点 + * @param center 中心点 + * @param preventEvent 阻止触发事件 + */ + setCenter(center: LocationValue, preventEvent?: boolean): void; + /** + * 修改椭圆属性 + * @param options 属性 + */ + setOptions(options: Ellipse.Options): void; + + // internal + setRadius(radius: [number, number], preventEvent?: boolean): void; + getRadius(): [number, number]; + } +} diff --git a/types/amap-js-api/overlay/geoJSON.d.ts b/types/amap-js-api/overlay/geoJSON.d.ts new file mode 100644 index 0000000000..aa3554cb04 --- /dev/null +++ b/types/amap-js-api/overlay/geoJSON.d.ts @@ -0,0 +1,72 @@ +declare namespace AMap { + namespace GeoJSON { + type Geometry = { + type: 'Point'; + coordinates: [number, number]; + } | { + type: 'MultiPoint' | 'LineString' | 'Polygon'; + coordinates: Array<[number, number]>; + } | { + type: 'MultiLineString' | 'MultiPolygon'; + coordinates: Array>; + } | { + type: 'GeometryCollection'; + geometries: Geometry[]; + }; + + type GeoJSONObject = { + type: 'Feature'; + properties: any; + geometry: Geometry; + } | { + type: 'FeatureCollection', + properties: any; + features: GeoJSONObject[]; + }; + interface Options { + /** + * 要加载的标准GeoJSON对象 + */ + geoJSON?: GeoJSONObject | GeoJSONObject[]; + /** + * 指定点要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglat 点的位置 + */ + getMarker?(obj: GeoJSONObject, lnglat: LngLat): Marker; + /** + * 指定线要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglats 线的路径 + */ + getPolyline?(obj: GeoJSONObject, lnglats: LngLat[]): Polyline; + /** + * 指定面要素的绘制方式 + * @param obj GeoJSON对象 + * @param lnglats 面的路径 + */ + getPolygon?(obj: GeoJSONObject, lnglats: LngLat[]): Polygon; + coordsToLatLng?(lnglat: LngLat): LngLat; + + // internal + coordsToLatLngs?(lnglats: LngLat[]): LngLat[]; + } + } + + class GeoJSON extends OverlayGroup { + /** + * GeoJSON + * @param options 选项 + */ + constructor(options?: GeoJSON.Options); + /** + * 加载新的GeoJSON对象,转化为覆盖物,旧的覆盖物将移除 + * @param obj GeoJSON对象 + */ + importData(obj: GeoJSON.GeoJSONObject | GeoJSON.GeoJSONObject[]): void; + /** + * 将当前对象包含的覆盖物转换为GeoJSON对象 + */ + toGeoJSON(): GeoJSON.GeoJSONObject[]; + } +} diff --git a/types/amap-js-api/overlay/icon.d.ts b/types/amap-js-api/overlay/icon.d.ts new file mode 100644 index 0000000000..18d75921bf --- /dev/null +++ b/types/amap-js-api/overlay/icon.d.ts @@ -0,0 +1,39 @@ +declare namespace AMap { + namespace Icon { + interface Options { + /** + * 图标尺寸 + */ + size?: SizeValue; + /** + * 图标取图偏移量 + */ + imageOffset?: Pixel; + /** + * 图标的取图地址 + */ + image?: string; + /** + * 图标所用图片大小 + */ + imageSize?: SizeValue; + } + } + + class Icon extends EventEmitter { + /** + * 点标记的图标 + * @param options 选项 + */ + constructor(options?: Icon.Options); + /** + * 设置图标图片大小 + * @param size 大小 + */ + setImageSize(size: SizeValue): void; + /** + * 获取图标图片大小 + */ + getImageSize(): Size; + } +} diff --git a/types/amap-js-api/overlay/infoWindow.d.ts b/types/amap-js-api/overlay/infoWindow.d.ts new file mode 100644 index 0000000000..7b51076351 --- /dev/null +++ b/types/amap-js-api/overlay/infoWindow.d.ts @@ -0,0 +1,113 @@ +declare namespace AMap { + namespace InfoWindow { + interface EventMap { + change: Event<'change', { target: I }>; + open: Event<'open', { target: I }>; + close: Event<'close', { target: I }>; + } + + type Anchor = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; + + interface Options extends Overlay.Options { + /** + * 是否自定义窗体 + */ + isCustom?: boolean; + /** + * 是否自动调整窗体到视野内 + */ + autoMove?: boolean; + /** + * 控制是否在鼠标点击地图后关闭信息窗体 + */ + closeWhenClickMap?: boolean; + /** + * 显示内容 + */ + content?: string | HTMLElement; + /** + * 信息窗体尺寸 + */ + size?: SizeValue; + /** + * 信息窗体锚点 + */ + anchor?: Anchor; + /** + * 信息窗体显示位置偏移量 + */ + offset?: Pixel; + /** + * 信息窗体显示基点位置 + */ + position?: LocationValue; + /** + * 是否显示信息窗体阴影 + */ + showShadow?: boolean; + // internal + height?: number; + } + } + + class InfoWindow extends Overlay { + /** + * 信息展示窗体 + * @param options 选项 + */ + constructor(options?: InfoWindow.Options); + /** + * 在地图的指定位置打开信息窗体 + * @param map 地图 + * @param position 打开的位置 + */ + open(map: Map, position?: LocationValue): void; + /** + * 关闭信息窗体 + */ + close(): void; + /** + * 获取信息窗体是否打开 + */ + getIsOpen(): boolean; + /** + * 设置信息窗体内容 + * @param content 窗体内容 + */ + setContent(content: string | HTMLElement): void; + /** + * 获取信息窗体内容 + */ + getContent(): string | HTMLElement | undefined; + /** + * 设置信息窗体显示基点位置 + * @param lnglat 位置经纬度 + */ + setPosition(lnglat: LocationValue): void; + /** + * 获取信息窗体显示基点位置 + */ + getPosition(): LngLat | undefined; + /** + * 获取锚点 + */ + getAnchor(): InfoWindow.Anchor | undefined; + /** + * 设置锚点 + * @param anchor 锚点 + */ + setAnchor(anchor?: InfoWindow.Anchor): void; + /** + * 设置信息窗体大小 + * @param size 大小 + */ + setSize(size: SizeValue): void; + /** + * 获取信息窗体大小 + */ + getSize(): Size | undefined; + + // internal + setOffset(offset: Pixel): void; + } +} diff --git a/types/amap-js-api/overlay/marker.d.ts b/types/amap-js-api/overlay/marker.d.ts new file mode 100644 index 0000000000..6e8183911c --- /dev/null +++ b/types/amap-js-api/overlay/marker.d.ts @@ -0,0 +1,307 @@ +declare namespace AMap { + namespace Marker { + interface EventMap { + click: MapsEvent<'click', I>; + dblclick: MapsEvent<'dblclick', I>; + rightclick: MapsEvent<'rightclick', I>; + mousemove: MapsEvent<'mousemove', I>; + mouseover: MapsEvent<'mouseover', I>; + mouseout: MapsEvent<'mouseout', I>; + mousedown: MapsEvent<'mousedown', I>; + mouseup: MapsEvent<'mouseup', I>; + dragstart: MapsEvent<'dragstart', I>; + dragging: MapsEvent<'dragging', I>; + dragend: MapsEvent<'dragend', I>; + moving: Event<'moving', { passwdPath: LngLat[]; }>; + moveend: Event<'moveend'>; + movealong: Event<'movealong'>; + touchstart: MapsEvent<'touchstart', I>; + touchmove: MapsEvent<'touchmove', I>; + touchend: MapsEvent<'touchend', I>; + } + + interface Label { + content?: string; + offset?: Pixel; + } + + type Anchor = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; + + interface Options extends Overlay.Options { + /** + * 点标记在地图上显示的位置 + */ + position?: LocationValue; + /** + * 标记锚点 + */ + anchor?: Anchor; + /** + * 点标记显示位置偏移量 + */ + offset?: Pixel; + /** + * 需在点标记中显示的图标 + */ + icon?: string | Icon; + /** + * 点标记显示内容 + */ + content?: string | HTMLElement; + /** + * 鼠标点击时marker是否置顶 + */ + topWhenClick?: boolean; + /** + * 是否将覆盖物的鼠标或touch等事件冒泡到地图上 + */ + bubble?: boolean; + /** + * 点标记是否可拖拽移动 + */ + draggable?: boolean; + /** + * 拖拽点标记时是否开启点标记离开地图的效果 + */ + raiseOnDrag?: boolean; + /** + * 鼠标悬停时的鼠标样式 + */ + cursor?: string; + /** + * 点标记是否可见 + */ + visible?: boolean; + /** + * 点标记的叠加顺序 + */ + zIndex?: number; + /** + * 点标记的旋转角度 + */ + angle?: number; + /** + * 是否自动旋转 + */ + autoRotation?: boolean; + /** + * 点标记的动画效果 + */ + animation?: AnimationName; + /** + * 点标记阴影 + */ + shadow?: Icon | string; + /** + * 鼠标滑过点标记时的文字提示 + */ + title?: string; + /** + * 可点击区域 + */ + shape?: MarkerShape; + /** + * 文本标注 + */ + label?: Label; + + // internal + zooms?: [number, number]; + topWhenMouseOver?: boolean; + height?: number; + } + } + + class Marker extends Overlay { + /** + * 点标记 + * @param options 选项 + */ + constructor(options?: Marker.Options); + /** + * 唤起高德地图客户端标注页 + * @param obj 唤起参数 + */ + markOnAMAP(obj?: { name?: string, position?: LocationValue }): void; + /** + * 获取锚点 + */ + getAnchor(): Marker.Anchor | undefined; + /** + * 设置锚点 + */ + setAnchor(anchor?: Marker.Anchor): void; + /** + * 获取偏移量 + */ + getOffset(): Pixel; + /** + * 设置偏移量 + * @param offset 偏移量 + */ + setOffset(offset: Pixel): void; + /** + * 设置点标记的动画效果 + * @param animate 动画效果类型 + */ + setAnimation(animate: AnimationName, prevent?: boolean): void; + /** + * 获取点标记的动画效果类型 + */ + getAnimation(): AnimationName; + /** + * 设置点标记是支持鼠标单击事件 + * @param cilckable 是否支持点击 + */ + setClickable(cilckable: boolean): void; + /** + * 获取点标记是否支持鼠标单击事件 + */ + getClickable(): boolean; + /** + * 获取点标记的位置 + */ + getPosition(): LngLat | undefined; + /** + * 设置点标记位置 + * @param position 位置经纬度 + */ + setPosition(position: LocationValue): void; + /** + * 设置点标记的旋转角度 + * @param angle 旋转角度 + */ + setAngle(angle: number): void; + /** + * 设置点标记文本标签内容 + * @param label 标签内容 + */ + setLabel(label?: Marker.Label): void; + /** + * 获取点标记文本标签内容 + */ + getLabel(): Marker.Label | undefined; + /** + * 获取点标记的旋转角度 + */ + getAngle(): number; + /** + * 设置点标记的叠加顺序 + * @param index 层级 + */ + setzIndex(index: number): void; + /** + * 获取点标记的叠加顺序 + */ + getzIndex(): number; + /** + * 设置点标记的显示图标 + * @param content 图标 + */ + setIcon(content: string | Icon): void; + /** + * 获取Icon内容 + */ + getIcon(): string | Icon | undefined; + /** + * 设置点标记对象是否可拖拽移动 + * @param draggable 是否可拖拽移动 + */ + setDraggable(draggable: boolean): void; + /** + * 获取点标记对象是否可拖拽移动 + */ + getDraggable(): boolean; + /** + * 设置鼠标悬停时的光标 + * @param cursor 光标 + */ + setCursor(cursor: string): void; + /** + * 设置点标记显示内容,可以是HTML要素字符串或者HTML DOM对象 + * @param content 显示内容 + */ + setContent(content: string | HTMLElement): void; + /** + * 获取点标记内容 + */ + getContent(): string | HTMLElement; + /** + * 以指定的速度,点标记沿指定的路径移动 + * @param path 移动轨迹 + * @param speed 速度 + * @param timingFunction 缓动函数 + * @param circleable 是否循环 + */ + moveAlong( + path: LngLat[], + speed: number, + timingFunction?: (t: number) => number, + circleable?: boolean + ): void; + /** + * 以给定速度移动点标记到指定位置 + * @param lnglat 目标位置 + * @param speed 速度 + * @param timingFunction 缓动函数 + */ + moveTo( + lnglat: LocationValue, + speed: number, + timingFunction?: (t: number) => number + ): void; + /** + * 点标记停止动画 + */ + stopMove(): void; + /** + * 暂定点标记的动画效果 + */ + pauseMove(): boolean; + /** + * 重新开始点标记的动画效果 + */ + resumeMove(): boolean; + /** + * 指定目标显示地图 + * @param map 地图 + */ + setMap(map: null | Map): void; + /** + * 鼠标滑过点标时的文字提示 + * @param title 提示文字 + */ + setTitle(title: string): void; + /** + * 获取点标记的文字提示 + */ + getTitle(): string | undefined; + /** + * 设置是否展示在最顶层 + * @param isTop 是否展示在最顶层 + */ + setTop(isTop: boolean): void; + /** + * 获取是否展示在最顶层 + */ + getTop(): boolean; + /** + * 设置阴影效果 + * @param icon 阴影效果 + */ + setShadow(icon?: Icon | string): void; + /** + * 获取阴影图标 + */ + getShadow(): Icon | undefined | string; + /** + * 设置可点击区域 + * @param shape 可点击区域 + */ + setShape(shape?: MarkerShape): void; + /** + * 获取可点击区域 + */ + getShape(): MarkerShape | undefined; + } +} diff --git a/types/amap-js-api/overlay/markerShape.d.ts b/types/amap-js-api/overlay/markerShape.d.ts new file mode 100644 index 0000000000..19264f26cf --- /dev/null +++ b/types/amap-js-api/overlay/markerShape.d.ts @@ -0,0 +1,25 @@ +declare namespace AMap { + namespace MarkerShape { + interface CircleOptions { + type: 'circle'; + coords: [number, number, number]; + } + interface PolyOptions { + type: 'poly'; + coords: number[]; + } + interface RectOptions { + type: 'rect'; + coords: [number, number, number, number]; + } + type Options = CircleOptions | PolyOptions | RectOptions; + } + + class MarkerShape extends EventEmitter { + /** + * Marker点击范围 + * @param options 选项 + */ + constructor(options: MarkerShape.Options); + } +} diff --git a/types/amap-js-api/overlay/overlay.d.ts b/types/amap-js-api/overlay/overlay.d.ts new file mode 100644 index 0000000000..f90bdb57ed --- /dev/null +++ b/types/amap-js-api/overlay/overlay.d.ts @@ -0,0 +1,75 @@ +declare namespace AMap { + namespace Overlay { + interface EventMap { + touchstart: MapsEvent<'touchstart', I>; + touchmove: MapsEvent<'touchmove', I>; + touchend: MapsEvent<'touchend', I>; + click: MapsEvent<'click', I>; + rightclick: MapsEvent<'rightclick', I>; + dblclick: MapsEvent<'dblclick', I>; + mousemove: MapsEvent<'mousemove', I>; + mouseover: MapsEvent<'mouseover', I>; + mousedown: MapsEvent<'mousedown', I>; + mouseup: MapsEvent<'mouseup', I>; + } + interface Options { + /** + * 所属地图 + */ + map?: Map; + /** + * 鼠标悬停时的鼠标样式 + */ + cursor?: string; + /** + * 自定义数据 + */ + extData?: ExtraData; + /** + * 事件是否穿透到地图 + */ + bubble?: boolean; + /** + * 是否支持点击 + */ + clickable?: boolean; + /** + * 是否支持拖拽 + */ + draggable?: boolean; + } + } + abstract class Overlay extends EventEmitter { + constructor(options?: Overlay.Options); + /** + * 显示覆盖物 + */ + show(): void; + /** + * 隐藏覆盖物 + */ + hide(): void; + /** + * 获取所属地图 + */ + getMap(): Map | null | undefined; + /** + * 设置所属地图 + * @param map 地图 + */ + setMap(map: Map | null): void; + /** + * 设置自定义数据 + * @param extData 自定义数据 + */ + setExtData(extData: ExtraData): void; + /** + * 获取自定义数据 + */ + getExtData(): ExtraData | {}; + + // internal + setHeight(height?: number | string): void; + getHeight(): number | string; + } +} diff --git a/types/amap-js-api/overlay/overlayGroup.d.ts b/types/amap-js-api/overlay/overlayGroup.d.ts new file mode 100644 index 0000000000..a219e38fcd --- /dev/null +++ b/types/amap-js-api/overlay/overlayGroup.d.ts @@ -0,0 +1,82 @@ +type ReferOverlayOptions = + O extends AMap.BezierCurve ? AMap.BezierCurve.Options + : O extends AMap.Polyline ? AMap.Polyline.Options + : O extends AMap.Circle ? AMap.Circle.Options + : O extends AMap.Ellipse ? AMap.Ellipse.Options + : O extends AMap.Polygon ? AMap.Polygon.Options + : O extends AMap.Text ? AMap.Text.Options + : O extends AMap.Marker ? AMap.Marker.Options + : O extends AMap.Rectangle ? AMap.Rectangle.Options + : any; + +declare namespace AMap { + class OverlayGroup extends Overlay { + /** + * 覆盖物集合 + * @param overlays 覆盖物 + */ + constructor(overlays?: O | O[]); + /** + * 添加单个覆盖物到集合中,不支持添加重复的覆盖物 + * @param overlay 覆盖物 + */ + addOverlay(overlay: O | O[]): this; + /** + * 添加覆盖物数组到集合中,不支持添加重复的覆盖物 + * @param overlay 覆盖物数组 + */ + addOverlays(overlay: O | O[]): this; + /** + * 返回当前集合中所有的覆盖物 + */ + getOverlays(): O[]; + /** + * 判断传入的覆盖物实例是否在集合中 + * @param overlay 覆盖物 + */ + hasOverlay(overlay: O | ((this: null, item: O, index: number, list: O[]) => boolean)): boolean; + /** + * 从集合中删除传入的覆盖物实例 + * @param overlay 覆盖物 + */ + removeOverlay(overlay: O | O[]): this; + /** + * 从集合中删除传入的覆盖物实例数组 + * @param overlay 覆盖物数组 + */ + removeOverlays(overlay: O | O[]): this; + /** + * 清空集合 + */ + clearOverlays(): this; + /** + * 对集合中的覆盖物做迭代操作 + * @param iterator 迭代回调 + * @param context 执行上下文 + */ + eachOverlay(iterator: (this: C, overlay: O, index: number, overlays: O[]) => void, context?: C): this; + /** + * 指定集合中里覆盖物的显示地图 + * @param map 地图 + */ + setMap(map: null | Map): this; + /** + * 修改覆盖物属性 + * @param options 属性 + */ + setOptions(options: ReferOverlayOptions): this; + /** + * 在地图上显示集合中覆盖物 + */ + show(): this; + /** + * 在地图上隐藏集合中覆盖物 + */ + hide(): this; + /** + * 查找集合中的覆盖物 + * @param finder 查找回调 + */ + getOverlay(finder: ((this: null, item: O, index: number, list: O[]) => boolean) | O): O | null; + } +} diff --git a/types/amap-js-api/overlay/pathOverlay.d.ts b/types/amap-js-api/overlay/pathOverlay.d.ts new file mode 100644 index 0000000000..d46b23a1c3 --- /dev/null +++ b/types/amap-js-api/overlay/pathOverlay.d.ts @@ -0,0 +1,50 @@ +declare namespace AMap { + namespace PathOverlay { + interface EventMap extends ShapeOverlay.EventMap { } + interface Options extends Overlay.Options { + /** + * 是否可见 + */ + visible?: boolean; + /** + * 覆盖物层级 + */ + zIndex?: number; + /** + * 描边线条颜色 + */ + strokeColor?: string; + /** + * 描边线条透明度 + */ + strokeOpacity?: number; + /** + * 描边宽度 + */ + strokeWeight?: number; + /** + * 描边样式 + */ + strokeStyle?: StrokeStyle; + /** + * 虚线间隔 + */ + strokeDasharray?: number[]; + /** + * 折线拐点的绘制样式 + */ + lineJoin?: StrokeLineJoin; + /** + * 折线两端线帽的绘制样式 + */ + lineCap?: StrokeLineCap; + } + } + abstract class PathOverlay extends ShapeOverlay { + constructor(options?: PathOverlay.Options); + /** + * 获取范围 + */ + getBounds(): Bounds | (this extends Rectangle ? undefined : null); + } +} diff --git a/types/amap-js-api/overlay/polygon.d.ts b/types/amap-js-api/overlay/polygon.d.ts new file mode 100644 index 0000000000..20a9c3595e --- /dev/null +++ b/types/amap-js-api/overlay/polygon.d.ts @@ -0,0 +1,78 @@ +declare namespace AMap { + namespace Polygon { + interface EventMap extends PathOverlay.EventMap { } + interface Options extends PathOverlay.Options { + /** + * 多边形轮廓线的节点坐标数组 + */ + path?: LocationValue[] | LocationValue[][]; + /** + * 多边形填充颜色 + */ + fillColor?: string; + /** + * 边形填充透明度 + */ + fillOpacity?: number; + } + + interface GetOptionsResult extends ShapeOverlay.GetOptionsResult { + /** + * 多边形填充颜色 + */ + fillColor: string; + /** + * 边形填充透明度 + */ + fillOpacity: number; + /** + * 多边形轮廓线的节点坐标数组 + */ + path: LngLat[] | LngLat[][]; + /** + * 折线拐点的绘制样式 + */ + lineJoin: StrokeLineJoin; + texture: string; + } + } + + class Polygon extends PathOverlay { + /** + * 多边形 + * @param options 选项 + */ + constructor(options?: Polygon.Options); + /** + * 设置多边形轮廓线节点数组 + * @param path 轮廓线节点 + */ + setPath(path: LocationValue[] | LocationValue[][]): void; + /** + * 获取多边形轮廓线节点数组 + */ + getPath(): LngLat[] | LngLat[][]; + /** + * 修改多边形属性 + * @param options 属性 + */ + setOptions(options: Polygon.Options): void; + /** + * 获取多边形的属性 + */ + getOptions(): Partial< + this extends Omit ? Ellipse.GetOptionsResult : + this extends Omit ? Rectangle.GetOptionsResult : + Polygon.GetOptionsResult + >; + /** + * 获取多边形的面积 + */ + getArea(): number; + /** + * 判断指定点坐标是否在多边形范围内 + * @param point 坐标 + */ + contains(point: LocationValue): boolean; + } +} diff --git a/types/amap-js-api/overlay/polyline.d.ts b/types/amap-js-api/overlay/polyline.d.ts new file mode 100644 index 0000000000..c7abfa6331 --- /dev/null +++ b/types/amap-js-api/overlay/polyline.d.ts @@ -0,0 +1,119 @@ +declare namespace AMap { + namespace Polyline { + interface EventMap extends PathOverlay.EventMap { } + interface GetOptionsResult extends ShapeOverlay.GetOptionsResult { + /** + * 线条是否带描边 + */ + isOutline: boolean; + /** + * 线条描边颜色 + */ + outlineColor: string; + /** + * 是否绘制成大地线 + */ + geodesic: boolean; + /** + * 折线的节点数组 + */ + path: LngLat[]; + /** + * 折线拐点的绘制样式 + */ + lineJoin: StrokeLineJoin; + /** + * 折线两端线帽的绘制样式 + */ + lineCap: StrokeLineCap; + /** + * 描边的宽度 + */ + borderWeight: number; + /** + * 是否延路径显示方向箭头 + */ + showDir: boolean; + /** + * 方向箭头颜色 + */ + dirColor: string; + /** + * 方向箭头图片 + */ + dirImg: string; + } + + interface Options extends PathOverlay.Options { + /** + * 线条是否带描边 + */ + isOutline?: boolean; + /** + * 线条描边颜色 + */ + outlineColor?: string; + /** + * 是否绘制成大地线 + */ + geodesic?: boolean; + /** + * 方向箭头颜色 + */ + dirColor?: string; + /** + * 描边的宽度 + */ + borderWeight?: number; + /** + * 是否延路径显示方向箭头 + */ + showDir?: boolean; + + // internal + /** + * 折线的节点数组 + */ + path?: LocationValue[]; + } + } + + class Polyline extends PathOverlay { + /** + * 折线 + * @param options 选项 + */ + constructor(options?: BezierCurve.Options | Polyline.Options); + /** + * 设置组成该折线的节点数组 + * @param path 节点数组 + */ + setPath( + path: this extends Omit ? + Array>> + : LocationValue[] + ): void; + /** + * 获取折线路径的节点数组 + */ + getPath(): this extends Omit ? + Array + : LngLat[]; + /** + * 获取折线的总长度(单位:米) + */ + getLength(): number; + /** + * 设置线的属性 + * @param options 属性 + */ + setOptions(options: this extends Omit ? + Partial> + : Polyline.Options + ): void; + /** + * 获取线的属性 + */ + getOptions(): Partial>; + } +} diff --git a/types/amap-js-api/overlay/rectangle.d.ts b/types/amap-js-api/overlay/rectangle.d.ts new file mode 100644 index 0000000000..833a46d3dc --- /dev/null +++ b/types/amap-js-api/overlay/rectangle.d.ts @@ -0,0 +1,43 @@ +declare namespace AMap { + namespace Rectangle { + interface EventMap extends Polygon.EventMap { + setBounds: Event<'setBounds'>; + } + + interface Options extends Polygon.Options { + /** + * 矩形的范围 + */ + bounds?: Bounds; + } + type GetOptionsResult = Merge, { + /** + * 路径节点数组 + */ + path: LngLat[]; + /** + * 矩形的范围 + */ + bounds: Bounds; + texture: string; + }>; + } + class Rectangle extends Polygon { + /** + * 矩形 + * @param options 选项 + */ + constructor(options?: Rectangle.Options); + /** + * 获取矩形范围 + * @param bounds 矩形的范围 + * @param preventEvent 阻止触发事件 + */ + setBounds(bounds: Bounds, preventEvent?: boolean): void; + /** + * 修改矩形属性 + * @param options 属性 + */ + setOptions(options: Partial): void; + } +} diff --git a/types/amap-js-api/overlay/shapeOverlay.d.ts b/types/amap-js-api/overlay/shapeOverlay.d.ts new file mode 100644 index 0000000000..ab07fa3d88 --- /dev/null +++ b/types/amap-js-api/overlay/shapeOverlay.d.ts @@ -0,0 +1,80 @@ +declare namespace AMap { + namespace ShapeOverlay { + interface EventMap extends Overlay.EventMap { + show: Event<'show', { target: I }>; + hide: Event<'hide', { target: I }>; + options: Event<'options'>; + change: Event<'change', { target: I }>; + } + interface GetOptionsResult { + /** + * 所属地图 + */ + map: Map; + /** + * 层级 + */ + zIndex: number; + /** + * 线条颜色 + */ + strokeColor: string; + /** + * 线条透明度 + */ + strokeOpacity: number; + /** + * 线条宽度 + */ + strokeWeight: number; + /** + * 线条样式,虚线或者实线 + */ + strokeStyle: StrokeStyle; + /** + * 虚线的分段 + */ + strokeDasharray: number[]; + /** + * 自定义属性 + */ + extData: ExtraData | {}; + /** + * 事件是否穿透到地图 + */ + bubble: boolean; + /** + * 是否支持点击 + */ + clickable: boolean; + } + } + abstract class ShapeOverlay extends Overlay { + /** + * 设置覆盖物属性 + * @param options 属性 + */ + abstract setOptions(options: {}): void; + /** + * 获得属性 + */ + abstract getOptions(): {}; + /** + * 获得层级 + */ + getzIndex(): number; + /** + * 设置层级 + * @param zIndex 层级 + */ + setzIndex(zIndex: number): void; + /** + * 返回可见 + */ + getVisible(): boolean; + /** + * 设置是否可以拖拽 + */ + setDraggable(draggable: boolean): void; + } +} diff --git a/types/amap-js-api/overlay/text.d.ts b/types/amap-js-api/overlay/text.d.ts new file mode 100644 index 0000000000..50f9249ad9 --- /dev/null +++ b/types/amap-js-api/overlay/text.d.ts @@ -0,0 +1,41 @@ +declare namespace AMap { + namespace Text { + type TextAlign = 'left' | 'right' | 'center'; + type VerticalAlign = 'top' | 'middle' | 'bottom'; + interface EventMap extends Marker.EventMap { } + interface Options extends Marker.Options { + /** + * 文本内容 + */ + text?: string; + /** + * 对齐方式 + */ + textAlign?: TextAlign; + + verticalAlign?: VerticalAlign; + } + } + + class Text extends Marker { + /** + * 纯文本标记 + * @param options 选项 + */ + constructor(options?: Text.Options); + /** + * 标记显示的文本内容 + */ + getText(): string; + /** + * 修改文本内容 + * @param text 文本内容 + */ + setText(text: string): void; + /** + * 设置文本样式 + * @param style 文本样式 + */ + setStyle(style: object): void; + } +} diff --git a/types/amap-js-api/pixel.d.ts b/types/amap-js-api/pixel.d.ts new file mode 100644 index 0000000000..b211e1d88a --- /dev/null +++ b/types/amap-js-api/pixel.d.ts @@ -0,0 +1,36 @@ +declare namespace AMap { + class Pixel { + /** + * 像素坐标,确定地图上的一个像素点 + * @param x 横轴坐标 + * @param y 纵轴坐标 + * @param round 是否四舍五入 + */ + constructor(x: number, y: number, round?: boolean); + /** + * 获得X方向像素坐标 + */ + getX(): number; + /** + * 获得Y方向像素坐标 + */ + getY(): number; + /** + * 当前像素坐标与传入像素坐标是否相等 + * @param point 目标像素坐标 + */ + equals(point: Pixel): boolean; + /** + * 以字符串形式返回像素坐标对象 + */ + toString(): string; + + // internal + add(offset: {x: number; y: number}, round?: boolean): Pixel; + round(): Pixel; + floor(): Pixel; + length(): number; + direction(): null | number; + toFixed(decimals?: number): this; + } +} diff --git a/types/amap-js-api/size.d.ts b/types/amap-js-api/size.d.ts new file mode 100644 index 0000000000..f13c2fff0b --- /dev/null +++ b/types/amap-js-api/size.d.ts @@ -0,0 +1,25 @@ +declare namespace AMap { + class Size { + /** + * 地物对象的像素尺寸 + * @param width 宽度像素 + * @param height 长度像素 + */ + constructor(width: number, height: number); + /** + * 获得宽度 + */ + getWidth(): number; + /** + * 获得高度 + */ + getHeight(): number; + /** + * 以字符串形式返回尺寸大小对象 + */ + toString(): string; + + // internal + contains(size: { x: number; y: number }): boolean; + } +} diff --git a/types/amap-js-api/tsconfig.json b/types/amap-js-api/tsconfig.json new file mode 100644 index 0000000000..a26facba9e --- /dev/null +++ b/types/amap-js-api/tsconfig.json @@ -0,0 +1,66 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "array-bounds.d.ts", + "bounds.d.ts", + "browser.d.ts", + "common.d.ts", + "convert-from.d.ts", + "dom-util.d.ts", + "event.d.ts", + "geometry-util.d.ts", + "index.d.ts", + "layer/building.d.ts", + "layer/flexible.d.ts", + "layer/layer.d.ts", + "layer/layerGroup.d.ts", + "layer/massMarks.d.ts", + "layer/mediaLayer.d.ts", + "layer/tileLayer.d.ts", + "layer/wms.d.ts", + "layer/wmts.d.ts", + "lngLat.d.ts", + "map.d.ts", + "overlay/bezierCurve.d.ts", + "overlay/circle.d.ts", + "overlay/circleMarker.d.ts", + "overlay/contextMenu.d.ts", + "overlay/ellipse.d.ts", + "overlay/geoJSON.d.ts", + "overlay/icon.d.ts", + "overlay/infoWindow.d.ts", + "overlay/marker.d.ts", + "overlay/markerShape.d.ts", + "overlay/overlay.d.ts", + "overlay/overlayGroup.d.ts", + "overlay/pathOverlay.d.ts", + "overlay/polygon.d.ts", + "overlay/polyline.d.ts", + "overlay/rectangle.d.ts", + "overlay/shapeOverlay.d.ts", + "overlay/text.d.ts", + "pixel.d.ts", + "size.d.ts", + "type-util.d.ts", + "util.d.ts", + "view2D.d.ts", + "amap-js-api-tests.ts" + ] +} diff --git a/types/amap-js-api/tslint.json b/types/amap-js-api/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/amap-js-api/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/amap-js-api/type-util.d.ts b/types/amap-js-api/type-util.d.ts new file mode 100644 index 0000000000..5edb14c615 --- /dev/null +++ b/types/amap-js-api/type-util.d.ts @@ -0,0 +1,12 @@ +declare namespace AMap { + type Omit = { + [K in Exclude]: T[K] + }; + + type OptionalKey = { [K in keyof T]-?: undefined extends T[K] ? K : never }[keyof T]; + + type Merge = + { [K in Exclude>]-?: O[K]; } & + { [K in Extract, OptionalKey>]?: O[K]; } & + T; +} diff --git a/types/amap-js-api/util.d.ts b/types/amap-js-api/util.d.ts new file mode 100644 index 0000000000..ee275d66b5 --- /dev/null +++ b/types/amap-js-api/util.d.ts @@ -0,0 +1,76 @@ +declare namespace AMap { + namespace Util { + /** + * 将颜色名转换为16进制RGB颜色值 + * @param colorName 颜色名 + */ + function colorNameToHex(colorName: string): string; + /** + * 将16进制RGB转为rgba(R,G,B,A) + * @param hex 16进制RGB + */ + function rgbHex2Rgba(hex: string): string; + /** + * 将16进制RGBA转为rgba(R,G,B,A) + * @param hex 16进制RGBA + */ + function argbHex2Rgba(hex: string): string; + /** + * 判断一个对象是都为空 + * @param obj 目标对象 + */ + function isEmpty(obj: object): boolean; + /** + * 从数组删除元素 + * @param array 数组 + * @param item 元素 + */ + function deleteItemFromArray(array: T[], item: T): T[]; + /** + * 按索引删除数组元素 + * @param array 数组 + * @param index 索引 + */ + function deleteItemFromArrayByIndex(array: T[], index: number): T[]; + /** + * 返回元素索引 + * @param array 数组 + * @param item 元素 + */ + function indexOf(array: T[], item: T): number; + /** + * 保留小数点后指定位 + * @param floatNumber 数值 + * @param digits 小数点位数 + */ + function format(floatNumber: number, digits?: number): number; + /** + * 判断是否数组 + * @param data 判断对象 + */ + function isArray(data: any): data is any[]; + /** + * 判断参数是否为DOM元素 + * @param data 判断对象 + */ + function isDOM(data: any): data is HTMLElement; + /** + * 判断数组是否包含某个元素 + * @param array 数组 + * @param item 元素 + */ + function includes(array: T[], item: T): boolean; + + function requestIdleCallback(callback: (...args: any[]) => any, options?: { timeout?: number }): number; + + function cancelIdleCallback(handle: number): void; + + function requestAnimFrame(callback: (this: C, ...args: any[]) => any, context?: C): number; + + function cancelAnimFrame(handle: number): void; + + function color2RgbaArray(color: string | number[]): [number, number, number, number]; + + function color2Rgba(color: string | number[]): string; + } +} diff --git a/types/amap-js-api/view2D.d.ts b/types/amap-js-api/view2D.d.ts new file mode 100644 index 0000000000..f246c5c67f --- /dev/null +++ b/types/amap-js-api/view2D.d.ts @@ -0,0 +1,29 @@ +declare namespace AMap { + namespace View2D { + interface Options { + /** + * 地图中心点坐标值 + */ + center?: LocationValue; + /** + * 地图顺时针旋转角度 + */ + rotation?: number; + /** + * 地图显示的缩放级别 + */ + zoom?: number; + /** + * 地图显示的参考坐标系 + */ + crs?: 'EPGS3857' | 'EPGS3395' | 'EPGS4326'; + } + } + class View2D extends EventEmitter { + /** + * 二维地图显示视口,用于定义二维地图静态显示属性 + * @param options 选项 + */ + constructor(options?: View2D.Options); + } +} diff --git a/types/amazon-product-api/tslint.json b/types/amazon-product-api/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amazon-product-api/tslint.json +++ b/types/amazon-product-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amplitude-js/tslint.json b/types/amplitude-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amplitude-js/tslint.json +++ b/types/amplitude-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amqp-rpc/tslint.json b/types/amqp-rpc/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/amqp-rpc/tslint.json +++ b/types/amqp-rpc/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/amqplib/amqplib-tests.ts b/types/amqplib/amqplib-tests.ts index ef448d5b36..a42d2f717d 100644 --- a/types/amqplib/amqplib-tests.ts +++ b/types/amqplib/amqplib-tests.ts @@ -14,6 +14,14 @@ amqp.connect('amqp://localhost') amqp.connect('amqp://localhost') .then(connection => { + connection.serverProperties.copyright; // $ExpectType string | undefined + connection.serverProperties.platform; // $ExpectType string + connection.serverProperties.information; // $ExpectType string + connection.serverProperties.host; // $ExpectType string + connection.serverProperties.product; // $ExpectType string + connection.serverProperties.version; // $ExpectType string + connection.serverProperties.customField; // $ExpectType string | undefined + return connection.createChannel() .tap(channel => channel.checkQueue('myQueue')) .then(channel => { @@ -37,6 +45,14 @@ import amqpcb = require('amqplib/callback_api'); amqpcb.connect('amqp://localhost', (err, connection) => { if (!err) { + connection.serverProperties.copyright; // $ExpectType string | undefined + connection.serverProperties.platform; // $ExpectType string + connection.serverProperties.information; // $ExpectType string + connection.serverProperties.host; // $ExpectType string + connection.serverProperties.product; // $ExpectType string + connection.serverProperties.version; // $ExpectType string + connection.serverProperties.customField; // $ExpectType string | undefined + connection.createChannel((err, channel) => { if (!err) { channel.assertQueue('myQueue', {}, (err, ok) => { diff --git a/types/amqplib/callback_api.d.ts b/types/amqplib/callback_api.d.ts index 9fca3972e4..56842abc26 100644 --- a/types/amqplib/callback_api.d.ts +++ b/types/amqplib/callback_api.d.ts @@ -1,11 +1,12 @@ import events = require('events'); -import { Replies, Options, Message } from './properties'; +import { Replies, Options, Message, ServerProperties } from './properties'; export * from './properties'; export interface Connection extends events.EventEmitter { close(callback?: (err: any) => void): void; createChannel(callback: (err: any, channel: Channel) => void): void; createConfirmChannel(callback: (err: any, confirmChannel: ConfirmChannel) => void): void; + serverProperties: ServerProperties; } export interface Channel extends events.EventEmitter { diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index 7087d74edc..77e5d19ca9 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -8,13 +8,14 @@ import * as Promise from 'bluebird'; import * as events from 'events'; -import { Replies, Options, Message, GetMessage, ConsumeMessage } from './properties'; +import { Replies, Options, Message, GetMessage, ConsumeMessage, ServerProperties } from './properties'; export * from './properties'; export interface Connection extends events.EventEmitter { close(): Promise; createChannel(): Promise; createConfirmChannel(): Promise; + serverProperties: ServerProperties; } export interface Channel extends events.EventEmitter { diff --git a/types/amqplib/properties.d.ts b/types/amqplib/properties.d.ts index 97dc8ac393..4c7a210c6f 100644 --- a/types/amqplib/properties.d.ts +++ b/types/amqplib/properties.d.ts @@ -210,3 +210,13 @@ export interface XDeath { "original-expiration"?: any; "routing-keys": string[]; } + +export interface ServerProperties { + host: string; + product: string; + version: string; + platform: string; + copyright?: string; + information: string; + [key: string]: string | undefined; +} diff --git a/types/angular-agility/tslint.json b/types/angular-agility/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-agility/tslint.json +++ b/types/angular-agility/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-animate/tslint.json b/types/angular-animate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-animate/tslint.json +++ b/types/angular-animate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-bootstrap-calendar/tslint.json b/types/angular-bootstrap-calendar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-bootstrap-calendar/tslint.json +++ b/types/angular-bootstrap-calendar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-bootstrap-lightbox/tslint.json b/types/angular-bootstrap-lightbox/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-bootstrap-lightbox/tslint.json +++ b/types/angular-bootstrap-lightbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-breadcrumb/tslint.json b/types/angular-breadcrumb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-breadcrumb/tslint.json +++ b/types/angular-breadcrumb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-clipboard/tslint.json b/types/angular-clipboard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-clipboard/tslint.json +++ b/types/angular-clipboard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-cookie/tslint.json b/types/angular-cookie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-cookie/tslint.json +++ b/types/angular-cookie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-cookies/tslint.json b/types/angular-cookies/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-cookies/tslint.json +++ b/types/angular-cookies/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-deferred-bootstrap/tslint.json b/types/angular-deferred-bootstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-deferred-bootstrap/tslint.json +++ b/types/angular-deferred-bootstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-dialog-service/tslint.json b/types/angular-dialog-service/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-dialog-service/tslint.json +++ b/types/angular-dialog-service/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-dynamic-locale/tslint.json b/types/angular-dynamic-locale/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-dynamic-locale/tslint.json +++ b/types/angular-dynamic-locale/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-environment/tslint.json b/types/angular-environment/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-environment/tslint.json +++ b/types/angular-environment/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-es/tslint.json b/types/angular-es/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-es/tslint.json +++ b/types/angular-es/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-feature-flags/tslint.json b/types/angular-feature-flags/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-feature-flags/tslint.json +++ b/types/angular-feature-flags/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-file-saver/tslint.json b/types/angular-file-saver/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-file-saver/tslint.json +++ b/types/angular-file-saver/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-formly/index.d.ts b/types/angular-formly/index.d.ts index 55c4743fc9..0e73056eaf 100644 --- a/types/angular-formly/index.d.ts +++ b/types/angular-formly/index.d.ts @@ -83,9 +83,10 @@ declare namespace AngularFormly { } interface ISelectOption { - name: string; + name?: string; value?: string; group?: string; + [key: string]: any; } /** @@ -149,14 +150,37 @@ declare namespace AngularFormly { */ interface IWatcher { deep?: boolean; //Defaults to false - expression?: string | { (field: string, scope: ITemplateScope): boolean }; - listener: (field: string, newValue: any, oldValue: any, scope: ITemplateScope, stopWatching: Function) => void; + expression?: string | { (field: IFieldRuntimeObject, scope: ITemplateScope): boolean }; + listener: (field: IFieldRuntimeObject, newValue: any, oldValue: any, scope: ITemplateScope, stopWatching: Function) => void; type?: string; //Defaults to $watch but can be set to $watchCollection or $watchGroup } + interface IFieldRuntimeObject extends IFieldObject { + model: { + [key: string]: any; + }; + } + + interface IFieldConfigurationObject extends IFieldObject { + /** + * By default, the model passed to the formly-field directive is the same as the model passed to the + * formly-form. However, if the field has a model specified, then it is used for that field (and that + * field only). In addition, a deep watch is added to the formly-field directive's scope to run the + * expressionProperties when the specified model changes. + * + * Note, the formly-form directive will allow you to specify a string which is an (almost) formly + * expression which allows you to define the model as relative to the scope of the form. + * + * see http://docs.angular-formly.com/docs/field-configuration-object#model-object--string + */ + model?: string | { + [key: string]: any; + }; + } + // see http://docs.angular-formly.com/docs/field-configuration-object - interface IFieldConfigurationObject { + interface IFieldObject { /** @@ -279,22 +303,6 @@ declare namespace AngularFormly { link?: ng.IDirectiveLinkFn; - /** - * By default, the model passed to the formly-field directive is the same as the model passed to the - * formly-form. However, if the field has a model specified, then it is used for that field (and that - * field only). In addition, a deep watch is added to the formly-field directive's scope to run the - * expressionProperties when the specified model changes. - * - * Note, the formly-form directive will allow you to specify a string which is an (almost) formly - * expression which allows you to define the model as relative to the scope of the form. - * - * see http://docs.angular-formly.com/docs/field-configuration-object#model-object--string - */ - model?: string | { - [key: string]: any; - }; - - /** * Allows you to take advantage of ng-model-options directive. Formly's built-in templateManipulator (see * below) will add this attribute to your ng-model element automatically if this property exists. Note, @@ -617,7 +625,7 @@ declare namespace AngularFormly { //The index of the field the form is on (in ng-repeat) index: number; //the model of the form (or the model specified by the field if it was specified). - model?: string | { + model?: { [key: string]: any; }; //Shortcut to options.validation.errorExistsAndShouldBeVisible diff --git a/types/angular-formly/tslint.json b/types/angular-formly/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-formly/tslint.json +++ b/types/angular-formly/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-fullscreen/tslint.json b/types/angular-fullscreen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-fullscreen/tslint.json +++ b/types/angular-fullscreen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-gettext/tslint.json b/types/angular-gettext/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-gettext/tslint.json +++ b/types/angular-gettext/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-google-analytics/tslint.json b/types/angular-google-analytics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-google-analytics/tslint.json +++ b/types/angular-google-analytics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-growl-v2/tslint.json b/types/angular-growl-v2/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-growl-v2/tslint.json +++ b/types/angular-growl-v2/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-http-auth/tslint.json b/types/angular-http-auth/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-http-auth/tslint.json +++ b/types/angular-http-auth/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-httpi/tslint.json b/types/angular-httpi/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-httpi/tslint.json +++ b/types/angular-httpi/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-idle/tslint.json b/types/angular-idle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-idle/tslint.json +++ b/types/angular-idle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-jwt/tslint.json b/types/angular-jwt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-jwt/tslint.json +++ b/types/angular-jwt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-load/tslint.json b/types/angular-load/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-load/tslint.json +++ b/types/angular-load/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-loading-bar/tslint.json b/types/angular-loading-bar/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-loading-bar/tslint.json +++ b/types/angular-loading-bar/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-local-storage/tslint.json b/types/angular-local-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-local-storage/tslint.json +++ b/types/angular-local-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-localforage/tslint.json b/types/angular-localforage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-localforage/tslint.json +++ b/types/angular-localforage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-locker/tslint.json b/types/angular-locker/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-locker/tslint.json +++ b/types/angular-locker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index f29de44222..6deaa605d0 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -419,3 +419,14 @@ myApp.controller('StickyController', ($scope: TestScope, $mdSticky: ng.material. $mdSticky($scope, stickyElement); $mdSticky($scope, stickyElement, cloneStickyElement); }); + +function mdUtil($mdUtil: ng.material.IUtilService) { + // $ExpectType void + $mdUtil.enableScrolling(); + + // $ExpectType () => void + $mdUtil.debounce(() => {}); + + // $ExpectType () => string + $mdUtil.debounce((): string => ""); +} diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index 6b012d5677..11ec689cf1 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -512,5 +512,16 @@ declare module 'angular' { } type IStickyService = (scope: IScope, element: JQuery, elementClone?: JQuery) => void; + + interface IInteractionService { + getLastInteractionType(): string|null; + isUserInvoked(checkDelay?: number): boolean; + } + + interface IUtilService { + // tslint:disable-next-line:ban-types debounce takes in a user provided function + debounce(func: T, wait?: number, scope?: any, invokeApply?: boolean): T; + enableScrolling(): void; + } } } diff --git a/types/angular-media-queries/tslint.json b/types/angular-media-queries/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-media-queries/tslint.json +++ b/types/angular-media-queries/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-meteor/tslint.json b/types/angular-meteor/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-meteor/tslint.json +++ b/types/angular-meteor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-modal/tslint.json b/types/angular-modal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-modal/tslint.json +++ b/types/angular-modal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-notifications/tslint.json b/types/angular-notifications/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-notifications/tslint.json +++ b/types/angular-notifications/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-notify/tslint.json b/types/angular-notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-notify/tslint.json +++ b/types/angular-notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-odata-resources/tslint.json b/types/angular-odata-resources/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-odata-resources/tslint.json +++ b/types/angular-odata-resources/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-permission/tslint.json b/types/angular-permission/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-permission/tslint.json +++ b/types/angular-permission/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-promise-tracker/tslint.json b/types/angular-promise-tracker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-promise-tracker/tslint.json +++ b/types/angular-promise-tracker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-q-spread/tslint.json b/types/angular-q-spread/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-q-spread/tslint.json +++ b/types/angular-q-spread/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-route/tslint.json b/types/angular-route/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-route/tslint.json +++ b/types/angular-route/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-sanitize/tslint.json b/types/angular-sanitize/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-sanitize/tslint.json +++ b/types/angular-sanitize/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-scenario/tslint.json b/types/angular-scenario/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-scenario/tslint.json +++ b/types/angular-scenario/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-scroll/tslint.json b/types/angular-scroll/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-scroll/tslint.json +++ b/types/angular-scroll/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-signalr-hub/tslint.json b/types/angular-signalr-hub/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-signalr-hub/tslint.json +++ b/types/angular-signalr-hub/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-spinner/tslint.json b/types/angular-spinner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-spinner/tslint.json +++ b/types/angular-spinner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-storage/tslint.json b/types/angular-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-storage/tslint.json +++ b/types/angular-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-toastr/tslint.json b/types/angular-toastr/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-toastr/tslint.json +++ b/types/angular-toastr/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-toasty/tslint.json b/types/angular-toasty/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-toasty/tslint.json +++ b/types/angular-toasty/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-translate/tslint.json b/types/angular-translate/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-translate/tslint.json +++ b/types/angular-translate/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-bootstrap/tslint.json b/types/angular-ui-bootstrap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-bootstrap/tslint.json +++ b/types/angular-ui-bootstrap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-notification/tslint.json b/types/angular-ui-notification/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-notification/tslint.json +++ b/types/angular-ui-notification/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-router/angular-ui-router-tests.ts b/types/angular-ui-router/angular-ui-router-tests.ts index 889e92bfc9..d7dfcbfbde 100644 --- a/types/angular-ui-router/angular-ui-router-tests.ts +++ b/types/angular-ui-router/angular-ui-router-tests.ts @@ -33,7 +33,7 @@ myApp.config(( $urlMatcherFactory.type("fullType", { decode: (val) => parseInt(val, 10), encode: (val) => val && val.toString(), - equals: (a, b) => this.is(a) && a === b, + equals: function (a, b) { return this.is(a) && a === b }, is: (val) => angular.isNumber(val) && isFinite(val) && val % 1 === 0, pattern: /\d+/ }); diff --git a/types/angular-ui-router/tslint.json b/types/angular-ui-router/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-router/tslint.json +++ b/types/angular-ui-router/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-scroll/tslint.json b/types/angular-ui-scroll/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-scroll/tslint.json +++ b/types/angular-ui-scroll/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-sortable/tslint.json b/types/angular-ui-sortable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-ui-sortable/tslint.json +++ b/types/angular-ui-sortable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-ui-tree/tslint.json b/types/angular-ui-tree/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angular-ui-tree/tslint.json +++ b/types/angular-ui-tree/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-wizard/tslint.json b/types/angular-wizard/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/angular-wizard/tslint.json +++ b/types/angular-wizard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular-xeditable/tslint.json b/types/angular-xeditable/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular-xeditable/tslint.json +++ b/types/angular-xeditable/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angular.throttle/tslint.json b/types/angular.throttle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angular.throttle/tslint.json +++ b/types/angular.throttle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angularfire/tslint.json b/types/angularfire/tslint.json index 67293bd146..0a7abf97f8 100644 --- a/types/angularfire/tslint.json +++ b/types/angularfire/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angularlocalstorage/tslint.json b/types/angularlocalstorage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angularlocalstorage/tslint.json +++ b/types/angularlocalstorage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/angulartics/tslint.json b/types/angulartics/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/angulartics/tslint.json +++ b/types/angulartics/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/animation-frame/tslint.json b/types/animation-frame/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/animation-frame/tslint.json +++ b/types/animation-frame/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/animejs/animejs-tests.ts b/types/animejs/animejs-tests.ts index 697c79f738..8ed6fccf8e 100644 --- a/types/animejs/animejs-tests.ts +++ b/types/animejs/animejs-tests.ts @@ -1,4 +1,4 @@ -import * as anime from 'animejs'; +import anime from 'animejs'; const test1 = anime({ targets: 'div', @@ -17,9 +17,9 @@ const test2 = anime({ }, translateY: '40px', color: [ - {value: '#FF0000', duration: 2000}, - {value: '#00FF00', duration: 2000}, - {value: '#0000FF', duration: 2000}, + { value: '#FF0000', duration: 2000 }, + { value: '#00FF00', duration: 2000 }, + { value: '#0000FF', duration: 2000 }, ], duration: () => { return 1000000000000; @@ -69,3 +69,9 @@ const bezier = anime.bezier(0, 0, 100, 100); anime.easings['hello'] = anime.bezier(0, 0, 1900, 3020); const runningAnims = anime.running; anime.remove(".tiny-divvy-div"); + +anime.timeline().add({ + targets: [], + duration: 1000, + easing: "linear", +}, 0); diff --git a/types/animejs/index.d.ts b/types/animejs/index.d.ts index 069187b15e..607872039f 100644 --- a/types/animejs/index.d.ts +++ b/types/animejs/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for animejs 2.0 // Project: http://animejs.com -// Definitions by: Andrew Babin +// Definitions by: Andrew Babin +// supaiku0 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -110,7 +111,7 @@ declare namespace anime { } interface AnimeTimelineInstance extends AnimeInstance { - add(params: AnimeAnimParams): AnimeTimelineInstance; + add(params: AnimeAnimParams, timelineOffset?: string | number): AnimeTimelineInstance; } // Helpers diff --git a/types/animejs/tsconfig.json b/types/animejs/tsconfig.json index 02c5552371..9ed0aa7d69 100644 --- a/types/animejs/tsconfig.json +++ b/types/animejs/tsconfig.json @@ -14,6 +14,7 @@ "../" ], "types": [], + "allowSyntheticDefaultImports": true, "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/ansi-escapes/index.d.ts b/types/ansi-escapes/index.d.ts index 519d429545..d01e74661a 100644 --- a/types/ansi-escapes/index.d.ts +++ b/types/ansi-escapes/index.d.ts @@ -19,10 +19,10 @@ declare namespace Ansi { interface AnsiEscapes { cursorTo(x: number, y?: number): string; cursorMove(x: number, y?: number): string; - cursorUp(count: number): string; - cursorDown(count: number): string; - cursorForward(count: number): string; - cursorBackward(count: number): string; + cursorUp(count?: number): string; + cursorDown(count?: number): string; + cursorForward(count?: number): string; + cursorBackward(count?: number): string; cursorLeft: string; cursorSavePosition: string; diff --git a/types/ansi-styles/tslint.json b/types/ansi-styles/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ansi-styles/tslint.json +++ b/types/ansi-styles/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/ansicolors/tslint.json b/types/ansicolors/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/ansicolors/tslint.json +++ b/types/ansicolors/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/any-db-transaction/tslint.json b/types/any-db-transaction/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/any-db-transaction/tslint.json +++ b/types/any-db-transaction/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/any-db/tslint.json b/types/any-db/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/any-db/tslint.json +++ b/types/any-db/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aphrodite/tslint.json b/types/aphrodite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aphrodite/tslint.json +++ b/types/aphrodite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/api-error-handler/tslint.json b/types/api-error-handler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/api-error-handler/tslint.json +++ b/types/api-error-handler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/apigee-access/tslint.json b/types/apigee-access/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/apigee-access/tslint.json +++ b/types/apigee-access/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/app-root-path/tslint.json b/types/app-root-path/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/app-root-path/tslint.json +++ b/types/app-root-path/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/appframework/tslint.json b/types/appframework/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/appframework/tslint.json +++ b/types/appframework/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/applepayjs/tslint.json b/types/applepayjs/tslint.json index 65c83fb1e3..1c56ba06b6 100644 --- a/types/applepayjs/tslint.json +++ b/types/applepayjs/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { + "npm-naming": false, "dt-header": false } } diff --git a/types/appletvjs/tslint.json b/types/appletvjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/appletvjs/tslint.json +++ b/types/appletvjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/arbiter/tslint.json b/types/arbiter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/arbiter/tslint.json +++ b/types/arbiter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index 4e43778473..536c0ff3f0 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 4.10 +// Type definitions for ArcGIS API for JavaScript 4.11 // Project: http://js.arcgis.com // Definitions by: Esri // Bjorn Svensson @@ -88,7 +88,47 @@ declare namespace __esri { export type ItemTestCallback = (item: T, index: number) => boolean; - interface Collection extends Evented {} + export type CollectionAfterAddEventHandler = (event: CollectionAfterEvent) => void; + + export type CollectionAfterChangesEventHandler = (event: CollectionAfterChangesEvent) => void; + + export type CollectionAfterRemoveEventHandler = (event: CollectionAfterEvent) => void; + + export type CollectionChangeEventHandler = (event: CollectionChangeEvent) => void; + + export type CollectionBeforeAddEventHandler = (event: CollectionBeforeEvent) => void; + + export type CollectionBeforeChangesEventHandler = (event: CollectionBeforeEvent) => void; + + export type CollectionBeforeRemoveEventHandler = (event: CollectionBeforeEvent) => void; + + export interface CollectionAfterEvent { + item: T; + } + + export interface CollectionAfterChangesEvent {} + + export interface CollectionBeforeEvent { + item: T; + preventDefault(): void; + } + + export interface CollectionChangeEvent { + added: T[]; + removed: T[]; + moved: T[]; + } + + interface Collection extends Evented { + on(type: "after-add", listener: CollectionAfterAddEventHandler): IHandle; + on(type: "after-changes", listener: CollectionAfterChangesEventHandler): IHandle; + on(type: "after-remove", listener: CollectionAfterRemoveEventHandler): IHandle; + on(type: "before-add", listener: CollectionBeforeAddEventHandler): IHandle; + on(type: "before-changes", listener: CollectionBeforeChangesEventHandler): IHandle; + on(type: "before-remove", listener: CollectionBeforeRemoveEventHandler): IHandle; + on(type: "change", listener: CollectionChangeEventHandler): IHandle; + on(type: string, listener: (event: any) => void): IHandle; + } type Constructor = new (...params: any[]) => T; @@ -186,6 +226,10 @@ declare namespace __esri { export type FeatureLayerLayerviewDestroyEventHandler = (event: FeatureLayerLayerviewDestroyEvent) => void; + export type GeoJSONLayerLayerviewCreateEventHandler = (event: GeoJSONLayerLayerviewCreateEvent) => void; + + export type GeoJSONLayerLayerviewDestroyEventHandler = (event: GeoJSONLayerLayerviewDestroyEvent) => void; + export type GeoRSSLayerLayerviewCreateEventHandler = (event: GeoRSSLayerLayerviewCreateEvent) => void; export type GeoRSSLayerLayerviewDestroyEventHandler = (event: GeoRSSLayerLayerviewDestroyEvent) => void; @@ -509,7 +553,7 @@ declare namespace __esri { */ 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. + * Takes an array of rgb(a) values, named string, hex string or an hsl(a) string, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object and sets this color instance to the input value. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#setColor) * @@ -562,7 +606,7 @@ declare namespace __esri { interface ColorConstructor { /** - * Creates a new color object by passing either a hex, rgba, or named color value. + * Creates a new color object by passing either a hex, rgb(a), hsl(a) or [named color value](https://www.w3.org/wiki/CSS/Properties/color/keywords). Hex, hsl(a) and named color values can be passed as a string: * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) */ @@ -1068,7 +1112,7 @@ declare namespace __esri { * @param event The event payload. * */ - emit(type: string, event?: any): void; + emit(type: string, event?: any): boolean; /** * Indicates whether there is an event listener on the instance that matches the provided event name. * @@ -1083,11 +1127,11 @@ declare namespace __esri { * * [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 type A event type, or an array of event types, to listen for. * @param listener The function to call when the event is fired. * */ - on(type: string, listener: EventHandler): IHandle; + on(type: string | string[], listener: EventHandler): IHandle; } interface EventedConstructor { @@ -1100,11 +1144,11 @@ declare namespace __esri { interface HandleOwner extends Accessor { /** - * Handle registry. + * Handle registry to help manage `handles`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-HandleOwner.html#handles) */ - handles: void; + handles: Handles; } interface HandleOwnerConstructor { @@ -1115,11 +1159,11 @@ declare namespace __esri { interface HandleOwnerProperties { /** - * Handle registry. + * Handle registry to help manage `handles`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-HandleOwner.html#handles) */ - handles?: void; + handles?: HandlesProperties; } interface Handles extends Accessor { @@ -1169,6 +1213,22 @@ declare namespace __esri { interface HandlesProperties {} + /** + * A handle to a [highlight](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) call result. The handle can be used to remove the installed highlight. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#Handle) + */ + export interface Handle extends Object { + /** + * Removes the handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#Handle) + * + * + */ + remove(): void; + } + 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. @@ -1422,37 +1482,13 @@ declare namespace __esri { error?: any; } - export type Executor = () => void; + export type Executor = (resolve: ResolveCallback, reject: RejectCallback) => 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; - } + export type RejectCallback = (error?: any) => void; - /** - * 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; - } + export type ResolveCallback = (value?: any | IPromise) => void; interface requireUtils { /** @@ -1529,7 +1565,7 @@ declare namespace __esri { remove(): void; } - export type PhaseCallback = (event: PhaseEvent) => void; + export type PhaseCallback = (event?: PhaseEvent) => void; /** * 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. @@ -1834,7 +1870,7 @@ declare namespace __esri { export const watchUtils: watchUtils; - export type EventAttachedCallback = (target: any, propName: string, obj: Accessor, eventName: string) => void; + export type EventAttachedCallback = (target?: any, propName?: string, obj?: Accessor, eventName?: string) => void; /** * Represents a watch created when an object invokes [watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch). @@ -3728,6 +3764,18 @@ declare namespace __esri { * */ rotate(angleX: number, angleY: number, angleZ: number, params?: MeshRotateParams): Mesh; + /** + * Scales the mesh geometry by the specified factor. 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 [scale()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#scale). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#scale) + * + * @param factor The amount to scale the geometry. + * @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. + * @param params.origin The origin point for scaling. If not specified, the mesh will be scaled around the mesh extent center. + * + */ + scale(factor: number, params?: MeshScaleParams): 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. * @@ -3754,8 +3802,9 @@ declare namespace __esri { * * @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.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, unless a unit is specified. * @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.unit The unit of the size (defaults to the unit of the location's spatial reference). **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet * @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. * @@ -3768,13 +3817,26 @@ declare namespace __esri { * * @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.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, unless a specific unit is specified. * @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.unit The unit of the size (defaults to the unit of the location's spatial reference). **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet * @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 glTF model referenced by the `url` parameter. The spatial reference of the resulting mesh is the same as the `location` parameter. For more information on the supported glTF features you can read the [Visualizing points with 3D symbols](https://developers.arcgis.com/javascript/latest/guide/visualizing-points-3d/index.html) guide topic. Animations are currently not supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createFromGLTF) + * + * @param location The location of the origin of the model. If the location doesn't contain a z value, z is assumed to be `0`. + * @param url The URL of the glTF model. The URL should point to a glTF file (.gltf or .glb) which can reference additional binary (.bin) and image files (.jpg, .png). + * @param params Additional parameters. + * @param params.geographic Whether the model coordinates should be relative to the geographic 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. + * + */ + createFromGLTF(location: Point, url: string, params?: MeshCreateFromGLTFParams): IPromise; /** * 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. * @@ -3793,9 +3855,10 @@ declare namespace __esri { * * @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.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, unless a unit is specified. * @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.unit The unit of the size (defaults to the unit of the location's spatial reference). **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet * @param params.material The material to be used for the mesh. * */ @@ -3807,8 +3870,9 @@ declare namespace __esri { * * @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.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, unless a unit is specified. * @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.unit The unit of the size (defaults to the unit of the location's spatial reference). **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet * @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. * @@ -3852,7 +3916,7 @@ declare namespace __esri { 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. + * 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, unless a unit is specified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ @@ -3863,6 +3927,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ geographic?: boolean; + /** + * The unit of the size (defaults to the unit of the location's spatial reference). **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) + */ + unit?: string; /** * The material to be used for the mesh. * @@ -3909,7 +3979,7 @@ declare namespace __esri { 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. + * 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, unless a specific unit is specified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ @@ -3920,6 +3990,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ geographic?: boolean; + /** + * The unit of the size (defaults to the unit of the location's spatial reference). **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) + */ + unit?: string; /** * 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). * @@ -3964,6 +4040,15 @@ declare namespace __esri { height?: number; } + export interface MeshCreateFromGLTFParams extends Object { + /** + * Whether the model coordinates should be relative to the geographic 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#createFromGLTF) + */ + geographic?: boolean; + } + export interface MeshCreateFromPolygonParams extends Object { /** * The material to be used for the mesh. @@ -3984,7 +4069,7 @@ declare namespace __esri { 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. + * 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, unless a unit is specified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ @@ -4001,6 +4086,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ geographic?: boolean; + /** + * The unit of the size (defaults to the unit of the location's spatial reference). **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) + */ + unit?: string; /** * The material to be used for the mesh. * @@ -4035,7 +4126,7 @@ declare namespace __esri { 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. + * 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, unless a unit is specified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ @@ -4046,6 +4137,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ geographic?: boolean; + /** + * The unit of the size (defaults to the unit of the location's spatial reference). **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) + */ + unit?: string; /** * 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). * @@ -4114,6 +4211,21 @@ declare namespace __esri { origin?: Point; } + export interface MeshScaleParams 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#scale) + */ + geographic?: boolean; + /** + * The origin point for scaling. If not specified, the mesh will be scaled around the mesh extent center. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#scale) + */ + 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. @@ -4261,6 +4373,7 @@ declare namespace __esri { longitude: number; /** * The m-coordinate of the point in map units. + * > **M-values** (measure) allow attribute values to be stored at the vertex of a point. A common usage for storing a measurement in the vertices along a linear feature are [linear referencing](https://desktop.arcgis.com/en/arcmap/latest/extensions/roads-and-highways/advanced-linear-referencing-multiple-linear-referencing-methods.htm) applications. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#m) * @@ -4373,6 +4486,7 @@ declare namespace __esri { longitude?: number; /** * The m-coordinate of the point in map units. + * > **M-values** (measure) allow attribute values to be stored at the vertex of a point. A common usage for storing a measurement in the vertices along a linear feature are [linear referencing](https://desktop.arcgis.com/en/arcmap/latest/extensions/roads-and-highways/advanced-linear-referencing-multiple-linear-referencing-methods.htm) applications. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#m) * @@ -4530,7 +4644,7 @@ 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. + * 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 of 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) */ @@ -4784,59 +4898,6 @@ declare namespace __esri { export const projection: projection; - 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; - } - - export const ScreenPoint: ScreenPointConstructor; - - 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; - } - interface SpatialReference extends Accessor, JSONSupport { /** * Indicates if the spatial reference refers to a geographic coordinate system. @@ -5006,7 +5067,7 @@ declare namespace __esri { */ 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`. + * 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. If instead a url to a .png file was provided, it is assumed that transparency is present. In all other cases it defaults to `false`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#transparent) * @@ -5056,7 +5117,7 @@ declare namespace __esri { */ 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`. + * 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. If instead a url to a .png file was provided, it is assumed that transparency is present. In all other cases it defaults to `false`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#transparent) * @@ -5102,11 +5163,11 @@ declare namespace __esri { */ 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)). + * The material determines how the component is visualized. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ - material: MeshComponentMaterial; + material: MeshMaterial; /** * 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: * @@ -5151,11 +5212,11 @@ declare namespace __esri { */ 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)). + * The material determines how the component is visualized. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ - material?: MeshComponentMaterialProperties; + material?: MeshMaterialProperties; /** * 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: * @@ -5171,22 +5232,217 @@ declare namespace __esri { shading?: string; } - export interface MeshComponentMaterialProperties extends Object { + interface MeshMaterial extends Accessor { /** - * the material color. + * Specifies how transparency on the object is handled. If `alphaMode` is set to either `mask` or `auto` this property specifies the cutoff value below which masking happens (that is, the coresponding part of the Mesh is rendered fully transparent). * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#alphaCutoff) + * + * @default 0.5 */ - color?: ValueMeshColorProperties | ImageMeshColorProperties; + alphaCutoff: number; + /** + * Specifies how transparency on the object is handled. See also `alphaCutoff`. + * + * | Type | Description | + * |------|-------------| + * | opaque | Alpha is ignored, and the object is rendered fully opaque. | + * | blend | Alpha values are used for gradual transparency, blending between the object and its background. | + * | mask | Alpha values are used for binary transparency, either displaying the object, or its background. See also `alphaCutoff`. | + * | auto | The implementation mixes the `mask` and `blend` settings, masking below `alphaCutoff` and blending above it. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#alphaMode) + * + * @default "auto" + */ + alphaMode: string; + /** + * Allows to specify a single, uniform color for the mesh component. 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-geometry-support-MeshMaterial.html#color) + */ + color: Color; + /** + * Allows to specify a texture to get color information from. The texture is accessed using the uv coordinate specified for each vertex in the mesh vertex attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#colorTexture) + */ + colorTexture: MeshTexture; + /** + * Specifies whether both sides of each triangle are displayed, or only the front sides. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#doubleSided) + * + * @default true + */ + doubleSided: boolean; + /** + * Allows to specify a texture to get normal information from. The texture is accessed using the uv coordinate specified for each vertex in the mesh vertex attributes. Normal mapping requires also for tangents to be specified in the mesh vertex attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#normalTexture) + */ + normalTexture: MeshTexture; } - export interface MeshComponentMaterial extends AnonymousAccessor { + interface MeshMaterialConstructor { /** - * the material color. + * The material determines how a mesh component is visualized. Among other properties, MeshMaterial specifies a color that may be a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) value, as well as a colorTexture that may be a [MeshTexture](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTexture.html)), which is mapped to the uv coordinate specified for each vertex in the [Mesh.vertexAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes). * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html) */ - color: ValueMeshColor | ImageMeshColor; + + new (properties?: MeshMaterialProperties): MeshMaterial; + } + + export const MeshMaterial: MeshMaterialConstructor; + + interface MeshMaterialProperties { + /** + * Specifies how transparency on the object is handled. If `alphaMode` is set to either `mask` or `auto` this property specifies the cutoff value below which masking happens (that is, the coresponding part of the Mesh is rendered fully transparent). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#alphaCutoff) + * + * @default 0.5 + */ + alphaCutoff?: number; + /** + * Specifies how transparency on the object is handled. See also `alphaCutoff`. + * + * | Type | Description | + * |------|-------------| + * | opaque | Alpha is ignored, and the object is rendered fully opaque. | + * | blend | Alpha values are used for gradual transparency, blending between the object and its background. | + * | mask | Alpha values are used for binary transparency, either displaying the object, or its background. See also `alphaCutoff`. | + * | auto | The implementation mixes the `mask` and `blend` settings, masking below `alphaCutoff` and blending above it. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#alphaMode) + * + * @default "auto" + */ + alphaMode?: string; + /** + * Allows to specify a single, uniform color for the mesh component. 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-geometry-support-MeshMaterial.html#color) + */ + color?: Color | number[] | string; + /** + * Allows to specify a texture to get color information from. The texture is accessed using the uv coordinate specified for each vertex in the mesh vertex attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#colorTexture) + */ + colorTexture?: MeshTextureProperties | HTMLImageElement | HTMLCanvasElement | ImageData | string; + /** + * Specifies whether both sides of each triangle are displayed, or only the front sides. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#doubleSided) + * + * @default true + */ + doubleSided?: boolean; + /** + * Allows to specify a texture to get normal information from. The texture is accessed using the uv coordinate specified for each vertex in the mesh vertex attributes. Normal mapping requires also for tangents to be specified in the mesh vertex attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshMaterial.html#normalTexture) + */ + normalTexture?: MeshTextureProperties | HTMLImageElement | HTMLCanvasElement | ImageData | string; + } + + interface MeshTexture 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-MeshTexture.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. If instead a url to a .png file was provided, it is assumed that transparency is present. In all other cases it defaults to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTexture.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-MeshTexture.html#url) + */ + url: string; + /** + * Specifies how uv coordinates outside the [0, 1] range are handled. One of "repeat", "clamp" or "mirror". Can also be specified separately for the two texture axes using an object: + * ```js + * { + * vertical: "clamp", + * horizontal: "repeat" + * } + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTexture.html#wrap) + * + * @default "repeat" + */ + wrap: string | any; + + /** + * Creates a deep clone. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTexture.html#clone) + * + * + */ + clone(): MeshTexture; + } + + interface MeshTextureConstructor { + /** + * MeshTexture represents image data to be used for a MeshMaterial. It is mapped to the mesh by its uv vertex attributes. MeshTexture instances can be used with the [MeshComponent.material.colorTexture](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) and [MeshComponent.material.normalTexture](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) properties. 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-MeshTexture.html) + */ + + new (properties?: MeshTextureProperties): MeshTexture; + } + + export const MeshTexture: MeshTextureConstructor; + + interface MeshTextureProperties { + /** + * 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-MeshTexture.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. If instead a url to a .png file was provided, it is assumed that transparency is present. In all other cases it defaults to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTexture.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-MeshTexture.html#url) + */ + url?: string; + /** + * Specifies how uv coordinates outside the [0, 1] range are handled. One of "repeat", "clamp" or "mirror". Can also be specified separately for the two texture axes using an object: + * ```js + * { + * vertical: "clamp", + * horizontal: "repeat" + * } + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshTexture.html#wrap) + * + * @default "repeat" + */ + wrap?: string | any; } interface meshUtils { @@ -5208,7 +5464,7 @@ declare namespace __esri { 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. + * 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 unit of the source data defaults to the unit of the `location`'s spatial reference. If the coordinate system is WGS84, metric units are used as the default. The unit of the source data may be specified in the additional `params` in which case a linear unit scale will automatically be applied to bring the source data in the unit of the spatial reference. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#georeference) * @@ -5216,6 +5472,7 @@ declare namespace __esri { * @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. + * @param params.unit Indicates the unit of the source data. A linear scale will be applied to the position attributes to convert the source data to the unit of the spatial reference at which the mesh is being georeferenced. By default the unit of the source data is assumed to be the same as the target spatial reference. **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet * */ georeference( @@ -5233,7 +5490,7 @@ declare namespace __esri { */ 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. + * 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 unit of the resulting data defaults to the unit of the `location`'s spatial reference. If the coordinate system is WGS84, metric units are used as the default. The unit of the resulting data may be specified in the additional `params` in which case a linear unit scale will automatically be applied. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#ungeoreference) * @@ -5241,6 +5498,7 @@ declare namespace __esri { * @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. + * @param params.unit Indicates the unit of the resulting data. A linear scale will be applied to the position attributes to convert the source data to the specified unit. By default the unit of the resulting data will be the same as the source spatial reference. **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet * */ ungeoreference( @@ -5285,6 +5543,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#georeference) */ geographic?: boolean; + /** + * Indicates the unit of the source data. A linear scale will be applied to the position attributes to convert the source data to the unit of the spatial reference at which the mesh is being georeferenced. By default the unit of the source data is assumed to be the same as the target spatial reference. **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#georeference) + */ + unit?: string; } export interface meshUtilsUngeoreferenceParams extends Object { @@ -5294,6 +5558,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#ungeoreference) */ geographic?: boolean; + /** + * Indicates the unit of the resulting data. A linear scale will be applied to the position attributes to convert the source data to the specified unit. By default the unit of the resulting data will be the same as the source spatial reference. **Possible Values:** millimeters | centimeters | decimeters | meters | kilometers | inches | feet | yards | miles | nautical-miles | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#ungeoreference) + */ + unit?: string; } /** @@ -5556,9 +5826,10 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) * + * @param defaultPopupTemplateEnabled Whether support for default popup templates is enabled. When true, a default popup template may be created automatically if neither the graphic nor its layer have a popup template defined. * */ - getEffectivePopupTemplate(): PopupTemplate; + getEffectivePopupTemplate(defaultPopupTemplateEnabled?: boolean): PopupTemplate; /** * Sets a new value to the specified attribute. * @@ -5902,7 +6173,7 @@ declare namespace __esri { userId: string; /** - * Destroys the credential. When the credential is destroyed, you should remove any map layers that are using this credential. + * Destroys the credential. When the credential is destroyed, you should remove any map layers that are using this credential. Any tokens generated via OAuth will automatically be revoked. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#destroy) * @@ -6024,7 +6295,7 @@ declare namespace __esri { */ checkSignInStatus(resUrl: string): IPromise; /** - * Destroys all credentials. + * Destroys all credentials. It is good practice to call this method if working with an application that contains sign-out functionality as any tokens generated via OAuth will automatically be revoked. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#destroyCredentials) * @@ -6044,12 +6315,12 @@ declare namespace __esri { /** * 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-IdentityManager.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. * @@ -7049,6 +7320,15 @@ declare namespace __esri { */ readonly sublayers: Collection; + /** + * Loads the layer and all of its sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#loadAll) + * + * + */ + loadAll(): IPromise; + on(name: "layerview-create", eventHandler: BuildingSceneLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BuildingSceneLayerLayerviewDestroyEventHandler): IHandle; @@ -7127,7 +7407,21 @@ declare namespace __esri { */ definitionExpression: string; /** - * Indicates whether to display popups when features in the layer are clicked. + * 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. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#listMode) + * + * @default show + */ + listMode: "show" | "hide"; + /** + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupEnabled) * @@ -7135,7 +7429,7 @@ declare namespace __esri { */ 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. + * 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. A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupTemplate) */ @@ -7152,6 +7446,18 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#type) */ readonly type: "building-component"; + + /** + * Creates a default popup template for the layer, populated with all the fields of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#createPopupTemplate) + * + * @param options Options for creating the popup template. + * @param options.maximumFields The maximum number of fields to include in the popup template. + * @param options.ignoreFieldTypes Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + */ + createPopupTemplate(options?: BuildingComponentSublayerCreatePopupTemplateOptions): PopupTemplate; } interface BuildingComponentSublayerConstructor { @@ -7170,7 +7476,21 @@ declare namespace __esri { */ definitionExpression?: string; /** - * Indicates whether to display popups when features in the layer are clicked. + * 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. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#listMode) + * + * @default show + */ + listMode?: "show" | "hide"; + /** + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupEnabled) * @@ -7178,7 +7498,7 @@ declare namespace __esri { */ 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. + * 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. A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupTemplate) */ @@ -7191,7 +7511,39 @@ declare namespace __esri { renderer?: RendererProperties; } + export interface BuildingComponentSublayerCreatePopupTemplateOptions extends Object { + /** + * The maximum number of fields to include in the popup template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#createPopupTemplate) + * + * @default 75 + */ + maximumFields?: number; + /** + * Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#createPopupTemplate) + */ + ignoreFieldTypes?: string[]; + } + interface BuildingGroupSublayer extends BuildingSublayer { + /** + * 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 | Hide the children layers from the table of contents. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html#listMode) + * + * @default show + */ + listMode: "show" | "hide" | "hide-children"; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of sublayers. * @@ -7204,6 +7556,15 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html#type) */ readonly type: "building-group"; + + /** + * Loads all contained sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html#loadAll) + * + * + */ + loadAll(): IPromise; } interface BuildingGroupSublayerConstructor { @@ -7214,7 +7575,23 @@ declare namespace __esri { export const BuildingGroupSublayer: BuildingGroupSublayerConstructor; - interface BuildingGroupSublayerProperties extends BuildingSublayerProperties {} + interface BuildingGroupSublayerProperties extends BuildingSublayerProperties { + /** + * 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 | Hide the children layers from the table of contents. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html#listMode) + * + * @default show + */ + listMode?: "show" | "hide" | "hide-children"; + } interface BuildingSublayer extends Accessor { /** @@ -7286,7 +7663,7 @@ declare namespace __esri { visible?: boolean; } - interface CSVLayer extends Layer { + interface CSVLayer extends Layer, PortalLayer, ScaleRangeLayer, TemporalLayer { /** * Copyright information for the layer. * @@ -7333,7 +7710,7 @@ declare namespace __esri { */ fields: Field[]; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * 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. 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) @@ -7355,14 +7732,6 @@ declare namespace __esri { * [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". * @@ -7370,21 +7739,11 @@ declare namespace __esri { */ 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. + * The name of an `oid` [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#fields) containing a unique value or identifier for each feature in the layer. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) - * - * @default 0 + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#objectIdField) */ - 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; + objectIdField: string; /** * An array of field names to include in the CSVLayer. If not specified, the layer will include all fields. * @@ -7392,7 +7751,7 @@ declare namespace __esri { */ outFields: string[]; /** - * Indicates whether to display popups when features in the layer are clicked. + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupEnabled) * @@ -7400,7 +7759,7 @@ declare namespace __esri { */ 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). + * 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). A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupTemplate) */ @@ -7436,6 +7795,17 @@ declare namespace __esri { */ url: string; + /** + * Creates a popup template for the layer, populated with all the fields of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#createPopupTemplate) + * + * @param options Options for creating the popup template. + * @param options.maximumFields The maximum number of fields to include in the popup template. + * @param options.ignoreFieldTypes Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + */ + createPopupTemplate(options?: CSVLayerCreatePopupTemplateOptions): PopupTemplate; /** * Creates query parameters that can be used to fetch features that satisfy the layer's current filters, and definitions. * @@ -7522,11 +7892,17 @@ declare namespace __esri { */ new (properties?: CSVLayerProperties): CSVLayer; + + fromJSON(json: any): CSVLayer; } export const CSVLayer: CSVLayerConstructor; - interface CSVLayerProperties extends LayerProperties { + interface CSVLayerProperties + extends LayerProperties, + PortalLayerProperties, + ScaleRangeLayerProperties, + TemporalLayerProperties { /** * Copyright information for the layer. * @@ -7573,7 +7949,7 @@ declare namespace __esri { */ fields?: FieldProperties[]; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * 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. 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) @@ -7595,14 +7971,6 @@ declare namespace __esri { * [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". * @@ -7610,21 +7978,11 @@ declare namespace __esri { */ 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. + * The name of an `oid` [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#fields) containing a unique value or identifier for each feature in the layer. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) - * - * @default 0 + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#objectIdField) */ - 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; + objectIdField?: string; /** * An array of field names to include in the CSVLayer. If not specified, the layer will include all fields. * @@ -7632,7 +7990,7 @@ declare namespace __esri { */ outFields?: string[]; /** - * Indicates whether to display popups when features in the layer are clicked. + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupEnabled) * @@ -7640,7 +7998,7 @@ declare namespace __esri { */ 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). + * 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). A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupTemplate) */ @@ -7677,6 +8035,23 @@ declare namespace __esri { url?: string; } + export interface CSVLayerCreatePopupTemplateOptions extends Object { + /** + * The maximum number of fields to include in the popup template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#createPopupTemplate) + * + * @default 75 + */ + maximumFields?: number; + /** + * Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#createPopupTemplate) + */ + ignoreFieldTypes?: 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. @@ -7742,111 +8117,6 @@ declare namespace __esri { view: View; } - 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; - /** - * 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; - } - - interface DynamicLayerConstructor { - new (): DynamicLayer; - } - - export const DynamicLayer: DynamicLayerConstructor; - - 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; - } - interface ElevationLayer extends Layer, ArcGISCachedService, PortalLayer { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. @@ -8053,7 +8323,7 @@ declare namespace __esri { demResolution: number; } - interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { + interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer, TemporalLayer { /** * Describes the layer's supported capabilities. * @@ -8061,7 +8331,7 @@ declare namespace __esri { */ readonly capabilities: FeatureLayerCapabilities; /** - * The copyright text as defined by the map service. + * Copyright information for the layer. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#copyright) */ @@ -8084,6 +8354,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#dynamicDataSource) */ dynamicDataSource: DynamicMapLayer | DynamicDataLayer; + /** + * The editor tracking fields, which record who adds or edits the data through the feature service and when edits are made. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#editFieldsInfo) + */ + readonly editFieldsInfo: EditFieldsInfo; /** * 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. * @@ -8109,19 +8385,11 @@ declare namespace __esri { */ readonly gdbVersion: string; /** - * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). 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 + * 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 | multipatch | 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. * @@ -8145,9 +8413,16 @@ declare namespace __esri { */ 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). + * Returns `true` if the layer is loaded from a non-spatial table in a service. Non-spatial table does not have a spatial column that represents geographic features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#isTable) + * + * @default false + */ + isTable: boolean; + /** + * 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. 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) @@ -8189,13 +8464,15 @@ declare namespace __esri { */ 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. + * An array of field names from the service to include with each feature. To fetch the values from all fields in the layer, use `["*"]`. Fields specified in `outFields` will be requested alongside with required fields for [rendering](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), [labeling](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) and setting the [elevation info](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for the layer. The required fields and `outFields` are used populate [FeatureLayerView.availableFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields). Set this property to include the fields that will be used for client-side [filtering](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter) and [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) if the fields are not part of required fields mentioned above. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) + * + * @default null */ outFields: string[]; /** - * Indicates whether to display popups when features in the layer are clicked. + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupEnabled) * @@ -8203,7 +8480,7 @@ declare namespace __esri { */ 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). + * 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). A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) */ @@ -8263,12 +8540,6 @@ declare namespace __esri { * [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). * @@ -8282,7 +8553,7 @@ declare namespace __esri { */ 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. + * The URL of the REST endpoint of the layer, non-spatial table 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) */ @@ -8317,7 +8588,18 @@ declare namespace __esri { */ applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; /** - * Creates query parameters that can be used to fetch features that satisfy the layer's current filters, and definitions. + * Creates a popup template for the layer, populated with all the fields of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createPopupTemplate) + * + * @param options Options for creating the popup template. + * @param options.maximumFields The maximum number of fields to include in the popup template. + * @param options.ignoreFieldTypes Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + */ + createPopupTemplate(options?: FeatureLayerCreatePopupTemplateOptions): PopupTemplate; + /** + * Creates query parameter object that can be used to fetch features that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression), [gdbVersion](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#gdbVersion), and [historicMoment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#historicMoment). It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities). It sets the query parameter's [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) property to `["*"]`. The results will include geometries of features and values for all [available fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields) for [client-side queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) or all fields in the layer for [server side queries](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#createQuery) * @@ -8343,6 +8625,15 @@ declare namespace __esri { * */ getFeatureType(feature: Graphic): FeatureType; + /** + * Returns the [Field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html) instance for a field name. This method first looks for the field by its `name`, and if not found does a case-insensitive search for it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getField) + * + * @param fieldName Name of the field. + * + */ + getField(fieldName: string): Field; /** * 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). * @@ -8436,7 +8727,7 @@ declare namespace __esri { interface FeatureLayerConstructor { /** - * A FeatureLayer is a single layer that can be created from a [Map Service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm) or [Feature Service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-feature-service-.htm); ArcGIS Online or ArcGIS Enterprise portal items; or from an array of client-side 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. + * 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. The layer can be either a spatial (has geographic features) or non-spatial (table). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) */ @@ -8452,9 +8743,10 @@ declare namespace __esri { extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, - RefreshableLayerProperties { + RefreshableLayerProperties, + TemporalLayerProperties { /** - * The copyright text as defined by the map service. + * Copyright information for the layer. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#copyright) */ @@ -8496,7 +8788,7 @@ declare namespace __esri { */ 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 + * 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 | multipatch | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ @@ -8508,9 +8800,16 @@ declare namespace __esri { */ 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). + * Returns `true` if the layer is loaded from a non-spatial table in a service. Non-spatial table does not have a spatial column that represents geographic features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#isTable) + * + * @default false + */ + isTable?: boolean; + /** + * 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. 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) @@ -8552,13 +8851,15 @@ declare namespace __esri { */ 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. + * An array of field names from the service to include with each feature. To fetch the values from all fields in the layer, use `["*"]`. Fields specified in `outFields` will be requested alongside with required fields for [rendering](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), [labeling](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) and setting the [elevation info](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for the layer. The required fields and `outFields` are used populate [FeatureLayerView.availableFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields). Set this property to include the fields that will be used for client-side [filtering](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter) and [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) if the fields are not part of required fields mentioned above. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) + * + * @default null */ outFields?: string[]; /** - * Indicates whether to display popups when features in the layer are clicked. + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupEnabled) * @@ -8566,7 +8867,7 @@ declare namespace __esri { */ 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). + * 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). A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) */ @@ -8627,13 +8928,45 @@ declare namespace __esri { */ 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. + * The URL of the REST endpoint of the layer, non-spatial table 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 fields that record who adds or edits data in the feature service and when the edit is made. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#EditFieldsInfo) + */ + export interface EditFieldsInfo extends Object { + /** + * The name of the field that stores the name of the user who created the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#EditFieldsInfo) + */ + creatorField: string; + /** + * The name of the field that stores the date and time the feature was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#EditFieldsInfo) + */ + creationDateField: string; + /** + * The name of the field that stores the name of the user who last edited the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#EditFieldsInfo) + */ + editorField: string; + /** + * The name of the field that stores the date and time the feature was last edited. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#EditFieldsInfo) + */ + editDateField: string; + } + /** * FeatureEditResult represents the result of adding, updating or deleting a feature. * @@ -8862,6 +9195,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDistinct: boolean; + /** + * Indicates if the query operation supports `disjoint` [spatial relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship). This is valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ + supportsDisjointSpatialRelationship: 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. * @@ -8869,7 +9208,7 @@ declare namespace __esri { */ 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. + * Indicates if the layer's query response contains geometry attributes, including shape area and length attributes. This operation is supported in ArcGIS Online hosted feature services created since December 2016 and ArcGIS Enterprise feature services since version 10.7. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ @@ -8892,6 +9231,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsPagination: boolean; + /** + * Indicates if the query response includes the [query geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#queryGeometry). This is valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ + supportsQueryGeometry: boolean; /** * Indicates if the query operation supports the projection of geometries onto a virtual grid. Requires an ArcGIS Server service 10.6.1 or greater. * @@ -8957,6 +9302,23 @@ declare namespace __esri { supportsPagination: boolean; } + export interface FeatureLayerCreatePopupTemplateOptions extends Object { + /** + * The maximum number of fields to include in the popup template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createPopupTemplate) + * + * @default 75 + */ + maximumFields?: number; + /** + * Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createPopupTemplate) + */ + ignoreFieldTypes?: string[]; + } + 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. @@ -9046,6 +9408,782 @@ declare namespace __esri { message: string; } + interface GeoJSONLayer extends Layer, ScaleRangeLayer, TemporalLayer { + /** + * Describes the layer's supported capabilities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + readonly capabilities: GeoJSONLayerCapabilities; + /** + * Copyright information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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). 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-GeoJSONLayer.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-GeoJSONLayer.html#displayField) + */ + displayField: 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-GeoJSONLayer.html#elevationInfo) + */ + elevationInfo: GeoJSONLayerElevationInfo; + /** + * 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-GeoJSONLayer.html#featureReduction) + */ + featureReduction: GeoJSONLayerFeatureReduction; + /** + * An array of fields in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#fields) + */ + fields: Field[]; + /** + * The geometry type of features in the layer. All features must be of the same type. **Possible Values:** point | multipoint | polyline | polygon + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#geometryType) + */ + geometryType: string; + /** + * 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-GeoJSONLayer.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 layer's [capabilities.data](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) object to verify if `Z` values are supported on the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#hasZ) + * + * @default undefined + */ + readonly hasZ: boolean; + /** + * 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. 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-GeoJSONLayer.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-GeoJSONLayer.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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.html#legendEnabled) + * + * @default true + */ + legendEnabled: boolean; + /** + * The name of an `oid` [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#fields) containing a unique value or identifier for each feature in the layer. `id` property of the feature object in the GeoJSON will be used as ObjectID. If `id` property is not present and `objectIDField` is not specified, `ObjectID` field will be generated for each feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#objectIdField) + */ + objectIdField: string; + /** + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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). A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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. If not specified, a default renderer will be generated based on the geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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) + * > **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-GeoJSONLayer.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 GeoJSON 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#spatialReference) + * + * @default SpatialReference.WGS84 + */ + spatialReference: SpatialReference; + /** + * An array of feature templates defined in the 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-GeoJSONLayer.html#templates) + */ + templates: FeatureTemplate[]; + /** + * The URL of the GeoJSON file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#url) + */ + url: string; + + /** + * Applies edits to features in a layer. New features can be created and existing features can be updated or deleted on the cilent side. Feature geometries and/or attributes may be modified. If client-side features are added, removed or updated at runtime using [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#applyEdits) then use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#queryFeatures) to return updated features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#objectIdField). When an array of objects is used, each object must have a valid `objectId` property. + * + */ + applyEdits(edits: GeoJSONLayerApplyEditsEdits): IPromise; + /** + * Creates a popup template for the layer, populated with all the fields of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#createPopupTemplate) + * + * @param options Options for creating the popup template. + * @param options.maximumFields The maximum number of fields to include in the popup template. + * @param options.ignoreFieldTypes Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + */ + createPopupTemplate(options?: GeoJSONLayerCreatePopupTemplateOptions): PopupTemplate; + /** + * Creates query parameter object that can be used to fetch features that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#definitionExpression). It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities). It sets the query parameter's [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) property to `["*"]`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#createQuery) + * + * + */ + createQuery(): Query; + /** + * Returns the [Field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html) instance for a field name. This method first looks for the field by its `name`, and if not found does a case-insensitive search for it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#getField) + * + * @param fieldName Name of the field. + * + */ + getField(fieldName: string): Field; + /** + * Returns the Domain associated with the given field name. The domain can be either a CodedValueDomain or RangeDomain. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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?: GeoJSONLayerGetFieldDomainOptions): Domain; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the layer 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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 layer 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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 layer 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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 layer 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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; + + on(name: "layerview-create", eventHandler: GeoJSONLayerLayerviewCreateEventHandler): IHandle; + + on(name: "layerview-destroy", eventHandler: GeoJSONLayerLayerviewDestroyEventHandler): IHandle; + } + + interface GeoJSONLayerConstructor { + /** + * The GeoJSONLayer class is used to create a layer based on [GeoJSON](http://geojson.org/). GeoJSON is a format for encoding a variety of geographic data structures. The GeoJSON data must comply with the [RFC 7946 specification](https://tools.ietf.org/html/rfc7946) which states that the coordinates are in SpatialReference.WGS84. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html) + */ + + new (properties?: GeoJSONLayerProperties): GeoJSONLayer; + } + + export const GeoJSONLayer: GeoJSONLayerConstructor; + + interface GeoJSONLayerProperties extends LayerProperties, ScaleRangeLayerProperties, TemporalLayerProperties { + /** + * Copyright information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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). 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-GeoJSONLayer.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-GeoJSONLayer.html#displayField) + */ + displayField?: 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-GeoJSONLayer.html#elevationInfo) + */ + elevationInfo?: GeoJSONLayerElevationInfo; + /** + * 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-GeoJSONLayer.html#featureReduction) + */ + featureReduction?: GeoJSONLayerFeatureReduction; + /** + * An array of fields in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#fields) + */ + fields?: FieldProperties[]; + /** + * The geometry type of features in the layer. All features must be of the same type. **Possible Values:** point | multipoint | polyline | polygon + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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. 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-GeoJSONLayer.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-GeoJSONLayer.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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.html#legendEnabled) + * + * @default true + */ + legendEnabled?: boolean; + /** + * The name of an `oid` [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#fields) containing a unique value or identifier for each feature in the layer. `id` property of the feature object in the GeoJSON will be used as ObjectID. If `id` property is not present and `objectIDField` is not specified, `ObjectID` field will be generated for each feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#objectIdField) + */ + objectIdField?: string; + /** + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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). A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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. If not specified, a default renderer will be generated based on the geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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) + * > **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-GeoJSONLayer.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 GeoJSON 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#spatialReference) + * + * @default SpatialReference.WGS84 + */ + spatialReference?: SpatialReferenceProperties; + /** + * An array of feature templates defined in the 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-GeoJSONLayer.html#templates) + */ + templates?: FeatureTemplateProperties[]; + /** + * The URL of the GeoJSON file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#url) + */ + url?: string; + } + + export interface GeoJSONLayerApplyEditsEdits 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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#applyEdits) + */ + deleteFeatures?: Graphic[] | any[]; + } + + export interface GeoJSONLayerCapabilities extends Object { + /** + * Describes characteristics of the data in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + data: GeoJSONLayerCapabilitiesData; + /** + * 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-GeoJSONLayer.html#capabilities) + */ + editing: GeoJSONLayerCapabilitiesEditing; + /** + * Describes operations that can be performed on features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + operations: GeoJSONLayerCapabilitiesOperations; + /** + * 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-GeoJSONLayer.html#capabilities) + */ + query: GeoJSONLayerCapabilitiesQuery; + /** + * 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-GeoJSONLayer.html#capabilities) + */ + queryRelated: GeoJSONLayerCapabilitiesQueryRelated; + } + + export interface GeoJSONLayerCapabilitiesData extends Object { + /** + * Indicates if the attachment is enabled on the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#capabilities) + */ + supportsZ: boolean; + } + + export interface GeoJSONLayerCapabilitiesEditing extends Object { + /** + * Indicates if anonymous users can delete features created by others. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#applyEdits). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#capabilities) + */ + supportsUploadWithItemId: boolean; + } + + export interface GeoJSONLayerCapabilitiesOperations extends Object { + /** + * Indicates if new features can be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#applyEdits) to the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + supportsAdd: boolean; + /** + * Indicates if features can be [deleted](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#applyEdits) from the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + supportsDelete: boolean; + /** + * Indicates if features in the layer can be [updated](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#applyEdits). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + supportsUpdate: boolean; + /** + * Indicates if features in the layer can be [edited](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#capabilities) + */ + supportsCalculate: boolean; + /** + * Indicates if features in the layer can be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#queryFeatures). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#capabilities) + */ + supportsValidateSql: boolean; + /** + * Indicates if resized attachments are supported in the 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-GeoJSONLayer.html#capabilities) + */ + supportsResizeAttachments: boolean; + } + + export interface GeoJSONLayerCapabilitiesQuery extends Object { + /** + * 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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#outFields). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + supportsDistinct: boolean; + /** + * Indicates if the query operation supports `disjoint` [spatial relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship). This is valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + supportsDisjointSpatialRelationship: 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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#capabilities) + */ + supportsPagination: boolean; + /** + * Indicates if the query response includes the [query geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#queryGeometry). This is valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#capabilities) + */ + supportsQueryGeometry: boolean; + /** + * 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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#capabilities) + */ + supportsResultType: boolean; + /** + * Indicates if the query operation supports SQL expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#capabilities) + */ + supportsHistoricMoment: boolean; + } + + export interface GeoJSONLayerCapabilitiesQueryRelated 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-GeoJSONLayer.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-GeoJSONLayer.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-GeoJSONLayer.html#capabilities) + */ + supportsPagination: boolean; + } + + export interface GeoJSONLayerCreatePopupTemplateOptions extends Object { + /** + * The maximum number of fields to include in the popup template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#createPopupTemplate) + * + * @default 75 + */ + maximumFields?: number; + /** + * Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#createPopupTemplate) + */ + ignoreFieldTypes?: string[]; + } + + export interface GeoJSONLayerElevationInfo extends Object { + /** + * 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 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-GeoJSONLayer.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-GeoJSONLayer.html#elevationInfo) + */ + offset?: number; + /** + * 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-GeoJSONLayer.html#elevationInfo) + */ + featureExpressionInfo?: GeoJSONLayerElevationInfoFeatureExpressionInfo; + /** + * 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-GeoJSONLayer.html#elevationInfo) + */ + unit?: string; + } + + export interface GeoJSONLayerElevationInfoFeatureExpressionInfo extends Object { + /** + * 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-GeoJSONLayer.html#elevationInfo) + */ + expression?: string; + } + + export interface GeoJSONLayerFeatureReduction 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-GeoJSONLayer.html#featureReduction) + */ + type: string; + } + + export interface GeoJSONLayerGetFieldDomainOptions 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-GeoJSONLayer.html#getFieldDomain) + */ + feature: Graphic; + } + + export interface GeoJSONLayerLayerviewCreateEvent { + layerView: LayerView; + + view: View; + } + + export interface GeoJSONLayerLayerviewDestroyEvent { + layerView: LayerView; + + view: View; + } + interface GeoRSSLayer extends Layer, ScaleRangeLayer { /** * Symbol used to represent line features from the GeoRSS feed. @@ -9250,9 +10388,10 @@ declare namespace __esri { * 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 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. + * relative-to-ground | Graphics are placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing 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 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) */ @@ -9377,7 +10516,7 @@ declare namespace __esri { */ pixelFilter: Function; /** - * Indicates whether to display popups when the layer is clicked. + * Indicates whether to display popups when the layer is clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupEnabled) * @@ -9390,12 +10529,6 @@ declare namespace __esri { * [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. @@ -9437,7 +10570,7 @@ declare namespace __esri { */ pixelFilter?: Function; /** - * Indicates whether to display popups when the layer is clicked. + * Indicates whether to display popups when the layer is clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupEnabled) * @@ -9622,14 +10755,14 @@ declare namespace __esri { * ------|------------ * 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. + * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html), [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html), [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) or [WMSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.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; + listMode: "show" | "hide" | "hide-children"; /** * Indicates whether the layer's resources have loaded. When `true`, all the properties of the object can be accessed. * @@ -9667,6 +10800,15 @@ declare namespace __esri { */ visible: boolean; + /** + * Called by the views, such as [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), when the layer is added to the [Map.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) collection and a layer view must be created for it. **This method is used internally and there is no use case for invoking it directly**. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#createLayerView) + * + * @param view The parent view. + * + */ + createLayerView(view: any): void; /** * Fetches custom attribution data for the layer when it becomes available. * @@ -9731,14 +10873,14 @@ declare namespace __esri { * ------|------------ * 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. + * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html), [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html), [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) or [WMSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.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; + listMode?: "show" | "hide" | "hide-children"; /** * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent transparent and `1` is completely opaque. * @@ -9787,13 +10929,7 @@ declare namespace __esri { portalItem: PortalItem; } - interface MapImageLayer - extends Layer, - SublayersOwner, - ArcGISMapService, - DynamicLayer, - ScaleRangeLayer, - RefreshableLayer { + interface MapImageLayer extends Layer, SublayersOwner, ArcGISMapService, 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). * @@ -9846,12 +10982,24 @@ declare namespace __esri { * @default true */ imageTransparency: boolean; + /** + * 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-MapImageLayer.html#portalItem) + */ + portalItem: PortalItem; /** * 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; + /** + * The URL to the REST endpoint of the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#url) + */ + url: string; /** * 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). @@ -9872,6 +11020,44 @@ declare namespace __esri { height: number, options?: MapImageLayerCreateExportImageParametersOptions ): any; + /** + * This method fetches the image for the specified extent and size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.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?: MapImageLayerFetchImageOptions + ): 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-MapImageLayer.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?: MapImageLayerGetImageUrlOptions + ): IPromise | string; on(name: "layerview-create", eventHandler: MapImageLayerLayerviewCreateEventHandler): IHandle; @@ -9895,7 +11081,6 @@ declare namespace __esri { interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, - DynamicLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { /** @@ -9944,12 +11129,24 @@ declare namespace __esri { * @default true */ imageTransparency?: boolean; + /** + * 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-MapImageLayer.html#portalItem) + */ + portalItem?: PortalItemProperties; /** * 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; + /** + * The URL to the REST endpoint of the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#url) + */ + url?: string; } export interface MapImageLayerLayerviewCreateEvent { @@ -9979,6 +11176,36 @@ declare namespace __esri { pixelRatio?: number; } + export interface MapImageLayerFetchImageOptions 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#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-MapImageLayer.html#fetchImage) + */ + pixelRatio?: number; + } + + export interface MapImageLayerGetImageUrlOptions 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-MapImageLayer.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-MapImageLayer.html#getImageUrl) + */ + rotation?: number; + } + interface MapNotesLayer extends Layer, PortalLayer, ScaleRangeLayer { on(name: "layerview-create", eventHandler: MapNotesLayerLayerviewCreateEventHandler): IHandle; @@ -10157,7 +11384,7 @@ declare namespace __esri { */ 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). + * 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). A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#popupTemplate) */ @@ -10182,6 +11409,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterFields) */ rasterFields: Field[]; + /** + * The renderer assigned to the layer. The renderer defines how to visualize pixels in the layer. Depending on the renderer type, the pixels may be stretched across the color ramp, classified or have different symbols based on values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#renderer) + */ + renderer: Renderer; /** * Specifies the rule for how the requested image should be rendered. * @@ -10207,6 +11440,17 @@ declare namespace __esri { */ readonly version: number; + /** + * Creates a default popup template for the layer, populated with all the fields of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#createPopupTemplate) + * + * @param options Options for creating the popup template. + * @param options.maximumFields The maximum number of fields to include in the popup template. + * @param options.ignoreFieldTypes Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + */ + createPopupTemplate(options?: ArcGISImageServiceCreatePopupTemplateOptions): PopupTemplate; /** * 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). * @@ -10328,7 +11572,7 @@ declare namespace __esri { */ 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). + * 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). A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#popupTemplate) */ @@ -10353,6 +11597,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterFields) */ rasterFields?: FieldProperties[]; + /** + * The renderer assigned to the layer. The renderer defines how to visualize pixels in the layer. Depending on the renderer type, the pixels may be stretched across the color ramp, classified or have different symbols based on values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#renderer) + */ + renderer?: RendererProperties; /** * Specifies the rule for how the requested image should be rendered. * @@ -10367,6 +11617,23 @@ declare namespace __esri { url?: string; } + export interface ArcGISImageServiceCreatePopupTemplateOptions extends Object { + /** + * The maximum number of fields to include in the popup template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#createPopupTemplate) + * + * @default 75 + */ + maximumFields?: number; + /** + * Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#createPopupTemplate) + */ + ignoreFieldTypes?: string[]; + } + interface ArcGISMapService { /** * Indicates the layer's supported capabilities. @@ -10400,12 +11667,6 @@ declare namespace __esri { * [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. * @@ -10557,7 +11818,7 @@ 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. + * Refresh interval of the layer in minutes. Value of `0` indicates no refresh. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refreshInterval) * @@ -10583,7 +11844,7 @@ 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. + * Refresh interval of the layer in minutes. Value of `0` indicates no refresh. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refreshInterval) * @@ -10660,12 +11921,6 @@ declare namespace __esri { * [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. * @@ -10767,6 +12022,34 @@ declare namespace __esri { export const SublayersOwner: SublayersOwnerConstructor; + interface TemporalLayer { + /** + * The time info provides information such as date fields that store [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#startField) and [end](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#endField) time for each feature and the [total time span](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#timeExtent) for the layer. The `timeInfo` and its `startField` and `endField` properties must be set at the time of layer initialization if it is being set for [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) or [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) initialized from [client-side features](esri-layers-FeatureLayer.html#creating-a-featurelayer). The [total time span](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#timeExtent) for the timeInfo is automatically calculated based on `start` and `end` fields. The timeInfo parameters cannot be changed after the layer is [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#load). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-TemporalLayer.html#timeInfo) + * + * @default null + */ + timeInfo: TimeInfo; + } + + interface TemporalLayerConstructor { + new (): TemporalLayer; + } + + export const TemporalLayer: TemporalLayerConstructor; + + interface TemporalLayerProperties { + /** + * The time info provides information such as date fields that store [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#startField) and [end](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#endField) time for each feature and the [total time span](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#timeExtent) for the layer. The `timeInfo` and its `startField` and `endField` properties must be set at the time of layer initialization if it is being set for [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) or [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) initialized from [client-side features](esri-layers-FeatureLayer.html#creating-a-featurelayer). The [total time span](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#timeExtent) for the timeInfo is automatically calculated based on `start` and `end` fields. The timeInfo parameters cannot be changed after the layer is [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#load). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-TemporalLayer.html#timeInfo) + * + * @default null + */ + timeInfo?: TimeInfoProperties; + } + interface OpenStreetMapLayer extends WebTileLayer { on(name: "layerview-create", eventHandler: OpenStreetMapLayerLayerviewCreateEventHandler): IHandle; @@ -10805,7 +12088,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html#type) */ - readonly type: string; + readonly type: "value" | "bitfield" | "return"; } interface PointCloudFilterConstructor { @@ -10841,7 +12124,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html#includedReturns) */ - includedReturns: string[]; + includedReturns: ("firstOfMany" | "last" | "lastOfMany" | "single")[]; + /** + * For PointCloudReturnFilter the type is always `return`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html#type) + */ + readonly type: "return"; } interface PointCloudReturnFilterConstructor { @@ -10868,7 +12157,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html#includedReturns) */ - includedReturns?: string[]; + includedReturns?: ("firstOfMany" | "last" | "lastOfMany" | "single")[]; } interface PointCloudValueFilter extends PointCloudFilter { @@ -10879,7 +12168,13 @@ declare namespace __esri { * * @default "exclude" */ - mode: string; + mode: "include" | "exclude"; + /** + * For PointCloudValueFilter the type is always `value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#type) + */ + readonly type: "value"; /** * An array of numeric values representing the classification codes that the filter should apply. * @@ -10910,7 +12205,7 @@ declare namespace __esri { * * @default "exclude" */ - mode?: string; + mode?: "include" | "exclude"; /** * An array of numeric values representing the classification codes that the filter should apply. * @@ -10937,7 +12232,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#filters) */ - filters: PointCloudFilter[]; + filters: (PointCloudValueFilter | PointCloudReturnFilter)[]; /** * Indicates whether the layer will be included in the legend. * @@ -10990,7 +12285,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#filters) */ - filters?: PointCloudFilterProperties[]; + filters?: (PointCloudValueFilterProperties | PointCloudReturnFilterProperties)[]; /** * Indicates whether the layer will be included in the legend. * @@ -11082,7 +12377,7 @@ declare namespace __esri { */ 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. * > **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) @@ -11111,7 +12406,7 @@ declare namespace __esri { */ objectIdField: string; /** - * Indicates whether to display popups when features in the layer are clicked. + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupEnabled) * @@ -11119,7 +12414,7 @@ declare namespace __esri { */ 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. + * 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. A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) */ @@ -11140,6 +12435,17 @@ declare namespace __esri { */ screenSizePerspectiveEnabled: boolean; + /** + * Creates a default popup template for the layer, populated with all the fields of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#createPopupTemplate) + * + * @param options Options for creating the popup template. + * @param options.maximumFields The maximum number of fields to include in the popup template. + * @param options.ignoreFieldTypes Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + */ + createPopupTemplate(options?: SceneLayerCreatePopupTemplateOptions): PopupTemplate; /** * 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. * @@ -11254,7 +12560,7 @@ declare namespace __esri { */ 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. * > **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) @@ -11283,7 +12589,7 @@ declare namespace __esri { */ objectIdField?: string; /** - * Indicates whether to display popups when features in the layer are clicked. + * Indicates whether to display popups when features in the layer are clicked. The layer needs to have a [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) to define what information should be displayed in the popup. Alternatively, a default popup template may be automatically used if [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupEnabled) * @@ -11291,7 +12597,7 @@ declare namespace __esri { */ 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. + * 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. A default popup template is automatically used if no `popupTemplate` has been defined when [Popup.defaultPopupTemplateEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) is set to `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) */ @@ -11325,6 +12631,23 @@ declare namespace __esri { view: View; } + export interface SceneLayerCreatePopupTemplateOptions extends Object { + /** + * The maximum number of fields to include in the popup template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#createPopupTemplate) + * + * @default 75 + */ + maximumFields?: number; + /** + * Field types to ignore when creating the popup. By default the `geometry`, `blob`, `raster`, `guid` and `xml` field types are ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#createPopupTemplate) + */ + ignoreFieldTypes?: string[]; + } + 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. @@ -11369,13 +12692,13 @@ 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. + * 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. **Use definitionExpression or geometryDefinition instead.** * * [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. + * An extent object used to filter features. Only features intersecting the extent are displayed in the view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#geometryDefinition) */ @@ -11394,7 +12717,7 @@ declare namespace __esri { purgeOptions: StreamLayerPurgeOptions; /** - * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) on the layer. The filter is updated on all views that contain the layer. If the input `filterChanges` object is `undefined` or `null`, the spatial and attribute filters are removed. To update the filter on a single layer view associated with the layer, use the [StreamLayerView.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) method after getting the layer view object. Filter changes only apply to incoming features. Features already displayed in the view will be removed automatically. + * 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. **Use [definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#definitionExpression) or [geometryDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#definitionExpression) instead.** * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) * @@ -11426,13 +12749,13 @@ 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. + * 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. **Use definitionExpression or geometryDefinition instead.** * * [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. + * An extent object used to filter features. Only features intersecting the extent are displayed in the view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#geometryDefinition) */ @@ -11515,6 +12838,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#contentType) */ contentType: string; + /** + * An array of [ExifInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#ExifInfo) for the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#exifInfo) + */ + exifInfo: ExifInfo[]; /** * The identifier for the attachment. * @@ -11564,7 +12893,7 @@ declare namespace __esri { 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`. + * 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.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) */ @@ -11583,6 +12912,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#contentType) */ contentType?: string; + /** + * An array of [ExifInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#ExifInfo) for the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#exifInfo) + */ + exifInfo?: ExifInfo[]; /** * The identifier for the attachment. * @@ -11621,6 +12956,47 @@ declare namespace __esri { url?: string; } + /** + * An array of [Exchangeable image file format](http://www.cipa.jp/std/documents/e/DC-008-Translation-2016-E.pdf) information for the attachment. You must set the attachment query's [returnMetadata](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#returnMetadata) to `true` to get the `exif` info associated with the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#ExifInfo) + */ + export interface ExifInfo extends Object { + /** + * The file name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#ExifInfo) + */ + name?: string; + /** + * Array of tag objects containing the following properties: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#ExifInfo) + */ + tags?: ExifInfoTags[]; + } + + export interface ExifInfoTags extends Object { + /** + * The tag name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#ExifInfo) + */ + name: string; + /** + * The tag description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#ExifInfo) + */ + description: string; + /** + * The value of the tag. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#ExifInfo) + */ + value: any; + } + 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. @@ -12016,7 +13392,7 @@ declare namespace __esri { */ defaultValue: number | string | any | any; /** - * The domain associated with the field. + * The domain associated with the field. Domains are used to constrain the values allowed in a field. There are two types of domains: [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) and [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#domain) * @@ -12105,7 +13481,7 @@ declare namespace __esri { */ defaultValue?: number | string | any | any; /** - * The domain associated with the field. + * The domain associated with the field. Domains are used to constrain the values allowed in a field. There are two types of domains: [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) and [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#domain) * @@ -12168,6 +13544,47 @@ declare namespace __esri { | "xml"; } + interface fieldUtils { + /** + * Returns an array of field names used in the Arcade expression for calculating the Z values of features in the given feature layer's [FeatureLayer.elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-fieldUtils.html#getElevationFields) + * + * @param layer The featureLayer to extract fields required for calculating feature Z values. + * + */ + getElevationFields(layer: FeatureLayer): IPromise; + /** + * Returns an array of editor tracking field names for a given feature layer. It includes the fields from the [FeatureLayer.editFieldsInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#editFieldsInfo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-fieldUtils.html#getFeatureEditFields) + * + * @param layer The Feature Layer from which to extract editor tracking fields. + * + */ + getFeatureEditFields(layer: FeatureLayer): string[]; + /** + * Returns an array of field names used in the Arcade expression for labeling features in the given feature layer's [FeatureLayer.labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-fieldUtils.html#getLabelingFields) + * + * @param layer The Feature Layer from which to extract label fields. + * + */ + getLabelingFields(layer: FeatureLayer): IPromise; + /** + * Returns an array of field names related to time. It includes the fields from the [FeatureLayer.timeInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#timeInfo), and the `trackIdField`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-fieldUtils.html#getTimeFields) + * + * @param layer The Feature Layer from which to extract time fields. + * + */ + getTimeFields(layer: FeatureLayer): IPromise; + } + + export const fieldUtils: fieldUtils; + interface ImageParameters extends Accessor { /** * Dots per inch setting for an module:esri/layersMapImageLayer. @@ -12443,12 +13860,16 @@ declare namespace __esri { * 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) + * + * @default null */ 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) + * + * @default null */ labelExpressionInfo: LabelClassLabelExpressionInfo; /** @@ -12483,6 +13904,8 @@ declare namespace __esri { * Defines the symbol used for rendering the label. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#symbol) + * + * @default null */ symbol: TextSymbol | LabelSymbol3D; /** @@ -12496,6 +13919,8 @@ declare namespace __esri { * > **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) + * + * @default null */ where: string; @@ -12528,12 +13953,16 @@ declare namespace __esri { * 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) + * + * @default null */ 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) + * + * @default null */ labelExpressionInfo?: LabelClassLabelExpressionInfo; /** @@ -12568,6 +13997,8 @@ declare namespace __esri { * Defines the symbol used for rendering the label. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#symbol) + * + * @default null */ symbol?: TextSymbolProperties | LabelSymbol3DProperties; /** @@ -12581,6 +14012,8 @@ declare namespace __esri { * > **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) + * + * @default null */ where?: string; } @@ -12777,6 +14210,12 @@ declare namespace __esri { * @default true */ ascending: boolean; + /** + * The rendering rule applied on items before mosaicking. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#itemRenderingRule) + */ + itemRenderingRule: RasterFunction; /** * 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. * @@ -12865,6 +14304,12 @@ declare namespace __esri { * @default true */ ascending?: boolean; + /** + * The rendering rule applied on items before mosaicking. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#itemRenderingRule) + */ + itemRenderingRule?: RasterFunctionProperties; /** * 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. * @@ -13096,7 +14541,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#variableName) */ - variableName: any; + variableName: string; } interface RasterFunctionConstructor { @@ -13139,7 +14584,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#variableName) */ - variableName?: any; + variableName?: string; } interface Relationship extends Accessor { @@ -13216,7 +14661,7 @@ 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. + * 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. To see if you can use this property, check the `supportsSublayerDefinitionExpression` property of [MapImageLayer.capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#capabilities). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) */ @@ -13228,7 +14673,7 @@ declare namespace __esri { */ 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`. + * 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. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo) */ @@ -13255,6 +14700,21 @@ declare namespace __esri { * @default true */ legendEnabled: boolean; + /** + * 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 | Hide the children layers from the table of contents. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#listMode) + * + * @default show + */ + listMode: "show" | "hide" | "hide-children"; /** * 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. * @@ -13290,7 +14750,7 @@ declare namespace __esri { */ popupTemplate: PopupTemplate; /** - * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. + * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. To see if you can use this property, check the `supportsDynamicLayers` property of [MapImageLayer.capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#capabilities). * > **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. @@ -13323,7 +14783,7 @@ declare namespace __esri { */ readonly url: string; /** - * Indicates if the layer is visible in the view. + * Indicates if the layer is visible in the view. To see if you can use this property, check the `supportsSublayerVisibility` property of [MapImageLayer.capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#capabilities). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) */ @@ -13344,7 +14804,7 @@ declare namespace __esri { * * */ - createFeatureLayer(): FeatureLayer; + createFeatureLayer(): IPromise; /** * 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. * @@ -13354,7 +14814,7 @@ declare namespace __esri { */ createQuery(): Query; /** - * Executes a [query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) against features in the sublayer. + * Executes a [query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) against features in the sublayer. To see if you can use this property, check the `supportsQuery` property of [MapImageLayer.capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#capabilities). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#queryFeatures) * @@ -13378,7 +14838,7 @@ 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. + * 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. To see if you can use this property, check the `supportsSublayerDefinitionExpression` property of [MapImageLayer.capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#capabilities). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) */ @@ -13390,7 +14850,7 @@ declare namespace __esri { */ 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`. + * 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. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo) */ @@ -13417,6 +14877,21 @@ declare namespace __esri { * @default true */ legendEnabled?: boolean; + /** + * 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 | Hide the children layers from the table of contents. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#listMode) + * + * @default show + */ + listMode?: "show" | "hide" | "hide-children"; /** * 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. * @@ -13452,7 +14927,7 @@ declare namespace __esri { */ popupTemplate?: PopupTemplateProperties; /** - * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. + * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. To see if you can use this property, check the `supportsDynamicLayers` property of [MapImageLayer.capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#capabilities). * > **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. @@ -13479,7 +14954,7 @@ declare namespace __esri { */ title?: string; /** - * Indicates if the layer is visible in the view. + * Indicates if the layer is visible in the view. To see if you can use this property, check the `supportsSublayerVisibility` property of [MapImageLayer.capabilities](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#capabilities). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) */ @@ -13929,6 +15404,75 @@ declare namespace __esri { tileInfo?: TileInfoProperties; } + interface TimeInfo extends Accessor, JSONSupport { + /** + * The name of the field containing the end time information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#endField) + */ + endField: string; + /** + * The name of the field containing the start time information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#startField) + */ + startField: string; + /** + * The time extent defines the start time and end time for all data in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#timeExtent) + * + * @default null + */ + timeExtent: TimeExtent; + + /** + * Creates a deep clone of TimeInfo object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#clone) + * + * + */ + clone(): TimeInfo; + } + + interface TimeInfoConstructor { + /** + * Time info represents a temporal data of a time-aware layer. The time info provides information such as date fields that store [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#startField) and [end](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#endField) time for each feature and the [total time span](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#timeExtent) for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html) + */ + + new (properties?: TimeInfoProperties): TimeInfo; + + fromJSON(json: any): TimeInfo; + } + + export const TimeInfo: TimeInfoConstructor; + + interface TimeInfoProperties { + /** + * The name of the field containing the end time information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#endField) + */ + endField?: string; + /** + * The name of the field containing the start time information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#startField) + */ + startField?: string; + /** + * The time extent defines the start time and end time for all data in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TimeInfo.html#timeExtent) + * + * @default null + */ + timeExtent?: TimeExtentProperties; + } + interface WMSSublayer extends Accessor { /** * Description for the WMS sublayer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. @@ -14382,6 +15926,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#hasAttributionData) */ readonly hasAttributionData: boolean; + /** + * Resampling is enabled by default in 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This means that tile images are resampled at a lower level of detail and displayed at levels where tiles may not be available. Setting this property to `true` disables this behavior. Instead, if a tile is not available, a transparent image is displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#resampling) + * + * @default true + */ + resampling: boolean; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). Sublayer properties on TileLayer are read-only, with the following exceptions: * * [legendEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#legendEnabled) @@ -14462,6 +16014,14 @@ declare namespace __esri { RefreshableLayerProperties, ScaleRangeLayerProperties, PortalLayerProperties { + /** + * Resampling is enabled by default in 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This means that tile images are resampled at a lower level of detail and displayed at levels where tiles may not be available. Setting this property to `true` disables this behavior. Instead, if a tile is not available, a transparent image is displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#resampling) + * + * @default true + */ + resampling?: boolean; /** * An array of tile servers used for changing map tiles. * @@ -14598,12 +16158,6 @@ declare namespace __esri { * [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. * @@ -15402,25 +16956,25 @@ declare namespace __esri { /** * 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) - * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/satellite.jpg) - * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/hybrid.jpg) - * topo | ![basemap-topo](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) - * gray | ![basemap-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) - * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) - * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/oceans.jpg) - * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) - * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) - * osm | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) - * dark-gray-vector | ![dark-gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) - * gray-vector | ![gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) - * streets-vector | ![streets-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) - * topo-vector | ![topo-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) - * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-night.jpg) - * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-relief.jpg) - * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-navigation.jpg) + * Value | Source | Thumbnail + * ------|------- |---------- + * `topo` | https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer | ![basemap-topo](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * `streets` | https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * `satellite` | https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer | ![basemap-satellite](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/satellite.jpg) + * `hybrid` | https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer and https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer | ![basemap-hybrid](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/hybrid.jpg) + * `dark-gray` | https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer and https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer | ![basemap-dark-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * `gray` | https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer and https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer | ![basemap-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * `national-geographic` | https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) + * `oceans` | https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer and https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer | ![basemap-oceans](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/oceans.jpg) + * `osm` | [OpenStreetMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OpenStreetMapLayer.html) | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) + * `terrain` | https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer and https://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) + * `dark-gray-vector` | [Dark Gray Canvas [v2]](https://www.arcgis.com/home/item.html?id=c11ce4f7801740b2905eb03ddc963ac8) | ![dark-gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * `gray-vector` | [Light Gray Canvas [v2]](https://www.arcgis.com/home/item.html?id=8a2cba3b0ebf4140b7c0dc5ee149549a) | ![gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * `streets-vector` | [World Street Map [v2]](https://www.arcgis.com/home/item.html?id=de26a3cf4cc9451298ea173c4b324736) | ![streets-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * `streets-night-vector` | [World Street Map (Night) [v2]](https://www.arcgis.com/home/item.html?id=86f556a2d1fd468181855a35e344567f) | ![streets-night-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-night.jpg) + * `streets-navigation-vector` | [World Navigation Map [v2]](https://www.arcgis.com/home/item.html?id=63c47b7177f946b49902c24129b87252) | ![streets-navigation-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-navigation.jpg) + * `topo-vector` | https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer and [World Topographic Map [v2]](https://www.arcgis.com/home/item.html?id=7dc6cea0b1764a1f9af2e679f642f0f5) | ![topo-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * `streets-relief-vector` | https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer and [World Street Map (with Relief) [v2]](https://www.arcgis.com/home/item.html?id=b266e6d17fc345b498345613930fbd76) | ![streets-relief-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-relief.jpg) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) @@ -15455,25 +17009,25 @@ declare namespace __esri { /** * 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) - * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/satellite.jpg) - * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/hybrid.jpg) - * topo | ![basemap-topo](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) - * gray | ![basemap-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) - * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) - * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/oceans.jpg) - * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) - * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) - * osm | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) - * dark-gray-vector | ![dark-gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) - * gray-vector | ![gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) - * streets-vector | ![streets-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) - * topo-vector | ![topo-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) - * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-night.jpg) - * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-relief.jpg) - * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-navigation.jpg) + * Value | Source | Thumbnail + * ------|------- |---------- + * `topo` | https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer | ![basemap-topo](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * `streets` | https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * `satellite` | https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer | ![basemap-satellite](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/satellite.jpg) + * `hybrid` | https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer and https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer | ![basemap-hybrid](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/hybrid.jpg) + * `dark-gray` | https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer and https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer | ![basemap-dark-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * `gray` | https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer and https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer | ![basemap-gray](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * `national-geographic` | https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) + * `oceans` | https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer and https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer | ![basemap-oceans](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/oceans.jpg) + * `osm` | [OpenStreetMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OpenStreetMapLayer.html) | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) + * `terrain` | https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer and https://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) + * `dark-gray-vector` | [Dark Gray Canvas [v2]](https://www.arcgis.com/home/item.html?id=c11ce4f7801740b2905eb03ddc963ac8) | ![dark-gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/dark-gray.jpg) + * `gray-vector` | [Light Gray Canvas [v2]](https://www.arcgis.com/home/item.html?id=8a2cba3b0ebf4140b7c0dc5ee149549a) | ![gray-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/gray.jpg) + * `streets-vector` | [World Street Map [v2]](https://www.arcgis.com/home/item.html?id=de26a3cf4cc9451298ea173c4b324736) | ![streets-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) + * `streets-night-vector` | [World Street Map (Night) [v2]](https://www.arcgis.com/home/item.html?id=86f556a2d1fd468181855a35e344567f) | ![streets-night-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-night.jpg) + * `streets-navigation-vector` | [World Navigation Map [v2]](https://www.arcgis.com/home/item.html?id=63c47b7177f946b49902c24129b87252) | ![streets-navigation-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-navigation.jpg) + * `topo-vector` | https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer and [World Topographic Map [v2]](https://www.arcgis.com/home/item.html?id=7dc6cea0b1764a1f9af2e679f642f0f5) | ![topo-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/topo.jpg) + * `streets-relief-vector` | https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer and [World Street Map (with Relief) [v2]](https://www.arcgis.com/home/item.html?id=b266e6d17fc345b498345613930fbd76) | ![streets-relief-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-relief.jpg) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) @@ -15581,6 +17135,1128 @@ declare namespace __esri { */ export type pointCloudRenderersPointCloudUniqueValueRenderer = PointCloudUniqueValueRenderer; + /** + * A convenience module for importing [Content](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-Content.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-popup-content.html) + */ + namespace content { + /** + * Popup content element types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#Content) + */ + export type Content = __esri.TextContent | __esri.MediaContent | __esri.FieldsContent | __esri.AttachmentsContent; + + /** + * TextContent defines descriptive text as an element within the [PopupTemplate's](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#TextContent) + */ + export type TextContent = __esri.TextContent; + export const TextContent: typeof __esri.TextContent; + + /** + * MediaContent contains an individual or array of chart and/or image media elements to display within a popup's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#MediaContent) + */ + export type MediaContent = __esri.MediaContent; + export const MediaContent: typeof __esri.MediaContent; + + /** + * FieldsContent represents the [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-FieldInfo.html) associated with a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#FieldsContent) + */ + export type FieldsContent = __esri.FieldsContent; + export const FieldsContent: typeof __esri.FieldsContent; + + /** + * AttachmentsContent represents an attachment element associated with a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#AttachmentsContent) + */ + export type AttachmentsContent = __esri.AttachmentsContent; + export const AttachmentsContent: typeof __esri.AttachmentsContent; + } + + interface AttachmentsContent extends Content, 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-popup-content-AttachmentsContent.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-popup-content-AttachmentsContent.html#displayType) + */ + displayType: string; + } + + interface AttachmentsContentConstructor { + /** + * An `AttachmentsContent` popup element represents an attachment element associated with a feature. This resource is available only if the [FeatureLayer.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-popup-content-AttachmentsContent.html) + */ + + new (properties?: AttachmentsContentProperties): AttachmentsContent; + + fromJSON(json: any): AttachmentsContent; + } + + export const AttachmentsContent: AttachmentsContentConstructor; + + interface AttachmentsContentProperties extends ContentProperties { + /** + * 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-popup-content-AttachmentsContent.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-popup-content-AttachmentsContent.html#displayType) + */ + displayType?: string; + } + + interface BarChartMediaInfo extends JSONSupport, MediaInfo, ChartMediaInfo { + /** + * Indicates the type of chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-BarChartMediaInfo.html#type) + * + * @default bar-chart + */ + readonly type: string; + + /** + * Creates a deep clone of the BarChartMediaInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-BarChartMediaInfo.html#clone) + * + * + */ + clone(): BarChartMediaInfo; + } + + interface BarChartMediaInfoConstructor { + /** + * A `BarChartMediaInfo` is a type of chart media element that represents a bar chart displayed within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-BarChartMediaInfo.html) + */ + + new (properties?: BarChartMediaInfoProperties): BarChartMediaInfo; + + fromJSON(json: any): BarChartMediaInfo; + } + + export const BarChartMediaInfo: BarChartMediaInfoConstructor; + + interface BarChartMediaInfoProperties extends MediaInfoProperties, ChartMediaInfoProperties {} + + interface ColumnChartMediaInfo extends JSONSupport, MediaInfo, ChartMediaInfo { + /** + * Indicates the type of chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ColumnChartMediaInfo.html#type) + * + * @default column-chart + */ + readonly type: string; + + /** + * Creates a deep clone of the ColumnChartMediaInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ColumnChartMediaInfo.html#clone) + * + * + */ + clone(): ColumnChartMediaInfo; + } + + interface ColumnChartMediaInfoConstructor { + /** + * A `ColumnChartMediaInfo` is a type of chart media element that represents a column chart displayed within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ColumnChartMediaInfo.html) + */ + + new (properties?: ColumnChartMediaInfoProperties): ColumnChartMediaInfo; + + fromJSON(json: any): ColumnChartMediaInfo; + } + + export const ColumnChartMediaInfo: ColumnChartMediaInfoConstructor; + + interface ColumnChartMediaInfoProperties extends MediaInfoProperties, ChartMediaInfoProperties {} + + interface Content 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-popup-content-Content.html#type) + */ + readonly type: string; + } + + interface ContentConstructor { + /** + * 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-popup-content-Content.html) + */ + + new (properties?: ContentProperties): Content; + + fromJSON(json: any): Content; + } + + export const Content: ContentConstructor; + + interface ContentProperties {} + + interface FieldsContent extends Content, JSONSupport { + /** + * Array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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-popup-content-FieldsContent.html#fieldInfos) + */ + fieldInfos: FieldInfo[]; + + /** + * Creates a deep clone of the FieldsContent class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-FieldsContent.html#clone) + * + * + */ + clone(): FieldsContent; + } + + interface FieldsContentConstructor { + /** + * A `FieldsContent` popup element represents the [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-FieldsContent.html) + */ + + new (properties?: FieldsContentProperties): FieldsContent; + + fromJSON(json: any): FieldsContent; + } + + export const FieldsContent: FieldsContentConstructor; + + interface FieldsContentProperties extends ContentProperties { + /** + * Array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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-popup-content-FieldsContent.html#fieldInfos) + */ + fieldInfos?: FieldInfoProperties[]; + } + + interface ImageMediaInfo extends JSONSupport, MediaInfo { + /** + * 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-popup-content-ImageMediaInfo.html#refreshInterval) + */ + refreshInterval: number; + /** + * The type of popup element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ImageMediaInfo.html#type) + * + * @default image + */ + readonly type: string; + /** + * 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-popup-content-ImageMediaInfo.html#value) + */ + value: ImageMediaInfoValue; + + /** + * Creates a deep clone of the ImageMediaInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ImageMediaInfo.html#clone) + * + * + */ + clone(): ImageMediaInfo; + } + + interface ImageMediaInfoConstructor { + /** + * An `ImageMediaInfo` is a type of media element that represents images to display within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ImageMediaInfo.html) + */ + + new (properties?: ImageMediaInfoProperties): ImageMediaInfo; + + fromJSON(json: any): ImageMediaInfo; + } + + export const ImageMediaInfo: ImageMediaInfoConstructor; + + interface ImageMediaInfoProperties extends MediaInfoProperties { + /** + * 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-popup-content-ImageMediaInfo.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-popup-content-ImageMediaInfo.html#value) + */ + value?: ImageMediaInfoValueProperties; + } + + interface LineChartMediaInfo extends JSONSupport, MediaInfo, ChartMediaInfo { + /** + * Indicates the type of chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-LineChartMediaInfo.html#type) + * + * @default line-chart + */ + readonly type: string; + + /** + * Creates a deep clone of the LineChartMediaInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-LineChartMediaInfo.html#clone) + * + * + */ + clone(): LineChartMediaInfo; + } + + interface LineChartMediaInfoConstructor { + /** + * A `LineChartMediaInfo` is a type of chart media element that represents a line chart displayed within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-LineChartMediaInfo.html) + */ + + new (properties?: LineChartMediaInfoProperties): LineChartMediaInfo; + + fromJSON(json: any): LineChartMediaInfo; + } + + export const LineChartMediaInfo: LineChartMediaInfoConstructor; + + interface LineChartMediaInfoProperties extends MediaInfoProperties, ChartMediaInfoProperties {} + + interface MediaContent extends Content, 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-popup-content-MediaContent.html#mediaInfos) + */ + mediaInfos: + | BarChartMediaInfo + | ColumnChartMediaInfo + | ImageMediaInfo + | LineChartMediaInfo + | PieChartMediaInfo + | any[]; + + /** + * Creates a deep clone of the MediaContent class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html#clone) + * + * + */ + clone(): MediaContent; + } + + interface MediaContentConstructor { + /** + * A `MediaContent` popup element contains an individual or array of chart and/or image media elements to display within a popup's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) + */ + + new (properties?: MediaContentProperties): MediaContent; + + fromJSON(json: any): MediaContent; + } + + export const MediaContent: MediaContentConstructor; + + interface MediaContentProperties extends ContentProperties { + /** + * 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-popup-content-MediaContent.html#mediaInfos) + */ + mediaInfos?: + | BarChartMediaInfoProperties + | ColumnChartMediaInfoProperties + | ImageMediaInfoProperties + | LineChartMediaInfoProperties + | PieChartMediaInfoProperties + | any[]; + } + + interface ChartMediaInfo { + /** + * Defines the chart value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-mixins-ChartMediaInfo.html#value) + */ + value: ChartMediaInfoValue; + } + + interface ChartMediaInfoConstructor { + new (): ChartMediaInfo; + } + + export const ChartMediaInfo: ChartMediaInfoConstructor; + + interface ChartMediaInfoProperties { + /** + * Defines the chart value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-mixins-ChartMediaInfo.html#value) + */ + value?: ChartMediaInfoValueProperties; + } + + interface MediaInfo { + /** + * Defines a caption for the media. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-mixins-MediaInfo.html#caption) + */ + caption: string; + /** + * The title of the media element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-mixins-MediaInfo.html#title) + */ + title: string; + } + + interface MediaInfoConstructor { + new (): MediaInfo; + } + + export const MediaInfo: MediaInfoConstructor; + + interface MediaInfoProperties { + /** + * Defines a caption for the media. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-mixins-MediaInfo.html#caption) + */ + caption?: string; + /** + * The title of the media element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-mixins-MediaInfo.html#title) + */ + title?: string; + } + + interface PieChartMediaInfo extends JSONSupport, MediaInfo, ChartMediaInfo { + /** + * Indicates the type of chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-PieChartMediaInfo.html#type) + * + * @default pie-chart + */ + readonly type: string; + + /** + * Creates a deep clone of the PieChartMediaInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-PieChartMediaInfo.html#clone) + * + * + */ + clone(): PieChartMediaInfo; + } + + interface PieChartMediaInfoConstructor { + /** + * A `PieChartMediaInfo` is a type of chart media element that represents a pie chart displayed within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-PieChartMediaInfo.html) + */ + + new (properties?: PieChartMediaInfoProperties): PieChartMediaInfo; + + fromJSON(json: any): PieChartMediaInfo; + } + + export const PieChartMediaInfo: PieChartMediaInfoConstructor; + + interface PieChartMediaInfoProperties extends MediaInfoProperties, ChartMediaInfoProperties {} + + interface ChartMediaInfoValue extends Accessor, JSONSupport { + /** + * An array of strings, with each string containing the name of a field to display in the chart. + * > In order to work with related fields within a chart, the fields must also be set in the [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-FieldInfo.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValue.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-popup-content-support-ChartMediaInfoValue.html#normalizeField) + */ + normalizeField: string; + /** + * An array of [ChartMediaInfoValueSeries](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValueSeries.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-popup-content-support-ChartMediaInfoValue.html#series) + */ + series: ChartMediaInfoValueSeries[]; + /** + * 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-popup-content-support-ChartMediaInfoValue.html#tooltipField) + */ + tooltipField: string; + } + + interface ChartMediaInfoValueConstructor { + new (properties?: ChartMediaInfoValueProperties): ChartMediaInfoValue; + + fromJSON(json: any): ChartMediaInfoValue; + } + + export const ChartMediaInfoValue: ChartMediaInfoValueConstructor; + + interface ChartMediaInfoValueProperties { + /** + * An array of strings, with each string containing the name of a field to display in the chart. + * > In order to work with related fields within a chart, the fields must also be set in the [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-FieldInfo.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValue.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-popup-content-support-ChartMediaInfoValue.html#normalizeField) + */ + normalizeField?: string; + /** + * An array of [ChartMediaInfoValueSeries](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValueSeries.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-popup-content-support-ChartMediaInfoValue.html#series) + */ + series?: ChartMediaInfoValueSeriesProperties[]; + /** + * 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-popup-content-support-ChartMediaInfoValue.html#tooltipField) + */ + tooltipField?: string; + } + + interface ChartMediaInfoValueSeries extends Accessor { + /** + * String value indicating the tooltip for a series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValueSeries.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-popup-content-support-ChartMediaInfoValueSeries.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-popup-content-support-ChartMediaInfoValueSeries.html#y) + */ + y: number; + + /** + * Creates a deep clone of the ChartMediaInfoValueSeries class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValueSeries.html#clone) + * + * + */ + clone(): ChartMediaInfoValueSeries; + } + + interface ChartMediaInfoValueSeriesConstructor { + new (properties?: ChartMediaInfoValueSeriesProperties): ChartMediaInfoValueSeries; + } + + export const ChartMediaInfoValueSeries: ChartMediaInfoValueSeriesConstructor; + + interface ChartMediaInfoValueSeriesProperties { + /** + * String value indicating the tooltip for a series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValueSeries.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-popup-content-support-ChartMediaInfoValueSeries.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-popup-content-support-ChartMediaInfoValueSeries.html#y) + */ + y?: number; + } + + interface ImageMediaInfoValue 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-popup-content-support-ImageMediaInfoValue.html#linkURL) + */ + linkURL: string; + /** + * A string containing the URL to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ImageMediaInfoValue.html#sourceURL) + */ + sourceURL: string; + + /** + * Creates a deep clone of the ImageMediaInfoValue class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ImageMediaInfoValue.html#clone) + * + * + */ + clone(): ImageMediaInfoValue; + } + + interface ImageMediaInfoValueConstructor { + new (properties?: ImageMediaInfoValueProperties): ImageMediaInfoValue; + + fromJSON(json: any): ImageMediaInfoValue; + } + + export const ImageMediaInfoValue: ImageMediaInfoValueConstructor; + + interface ImageMediaInfoValueProperties { + /** + * 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-popup-content-support-ImageMediaInfoValue.html#linkURL) + */ + linkURL?: string; + /** + * A string containing the URL to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ImageMediaInfoValue.html#sourceURL) + */ + sourceURL?: string; + } + + interface TextContent extends Content, 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-popup-content-TextContent.html#text) + */ + text: string; + + /** + * Creates a deep clone of the TextContent class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-TextContent.html#clone) + * + * + */ + clone(): TextContent; + } + + interface TextContentConstructor { + /** + * A `TextContent` popup element 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-popup-content-TextContent.html) + */ + + new (properties?: TextContentProperties): TextContent; + + fromJSON(json: any): TextContent; + } + + export const TextContent: TextContentConstructor; + + interface TextContentProperties extends ContentProperties { + /** + * 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-popup-content-TextContent.html#text) + */ + text?: string; + } + + /** + * AttachmentsContent represents an attachment element associated with a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#AttachmentsContent) + */ + export type contentAttachmentsContent = AttachmentsContent; + + /** + * Popup content element types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#Content) + */ + export type contentContent = TextContent | MediaContent | FieldsContent | AttachmentsContent; + + /** + * FieldsContent represents the [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-FieldInfo.html) associated with a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#FieldsContent) + */ + export type contentFieldsContent = FieldsContent; + + /** + * MediaContent contains an individual or array of chart and/or image media elements to display within a popup's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#MediaContent) + */ + export type contentMediaContent = MediaContent; + + /** + * TextContent defines descriptive text as an element within the [PopupTemplate's](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content.html#TextContent) + */ + export type contentTextContent = TextContent; + + 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-popup-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-popup-ExpressionInfo.html#name) + */ + name: string; + /** + * Indicates the return type of the Arcade expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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-popup-FieldInfo.html) table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-ExpressionInfo.html#title) + */ + title: string; + + /** + * Creates a deep clone of the ExpressionInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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-popup-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-popup-ExpressionInfo.html#name) + */ + name?: string; + /** + * Indicates the return type of the Arcade expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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-popup-FieldInfo.html) table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-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-popup-FieldInfo.html#visible) + * + * @default true + */ + visible?: boolean; + } + + 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-popup-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-popup-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-popup-LayerOptions.html#showNoDataRecords) + * + * @default true + */ + showNoDataRecords?: boolean; + } + + interface RelatedRecordsInfo extends Accessor, JSONSupport { + /** + * An array of [RelatedRecordsInfoFieldOrder](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-support-RelatedRecordsInfoFieldOrder.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-popup-RelatedRecordsInfo.html#orderByFields) + */ + orderByFields: RelatedRecordsInfoFieldOrder[]; + /** + * Indicates whether to display related records in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-RelatedRecordsInfo.html#showRelatedRecords) + */ + showRelatedRecords: boolean; + + /** + * Creates a deep clone of the RelatedRecordsInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-RelatedRecordsInfo.html#clone) + * + * + */ + clone(): RelatedRecordsInfo; + } + + interface RelatedRecordsInfoConstructor { + new (properties?: RelatedRecordsInfoProperties): RelatedRecordsInfo; + + fromJSON(json: any): RelatedRecordsInfo; + } + + export const RelatedRecordsInfo: RelatedRecordsInfoConstructor; + + interface RelatedRecordsInfoProperties { + /** + * An array of [RelatedRecordsInfoFieldOrder](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-support-RelatedRecordsInfoFieldOrder.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-popup-RelatedRecordsInfo.html#orderByFields) + */ + orderByFields?: RelatedRecordsInfoFieldOrderProperties[]; + /** + * Indicates whether to display related records in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-RelatedRecordsInfo.html#showRelatedRecords) + */ + showRelatedRecords?: 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-popup-support-FieldInfoFormat.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-popup-support-FieldInfoFormat.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-popup-support-FieldInfoFormat.html#places) + */ + places: number; + + /** + * Creates a deep clone of the FieldInfoFormat class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-support-FieldInfoFormat.html#clone) + * + * + */ + clone(): FieldInfoFormat; + } + + interface FieldInfoFormatConstructor { + /** + * The `FieldInfoFormat` class is 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-popup-support-FieldInfoFormat.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-popup-support-FieldInfoFormat.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-popup-support-FieldInfoFormat.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-popup-support-FieldInfoFormat.html#places) + */ + places?: number; + } + + interface RelatedRecordsInfoFieldOrder 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-popup-support-RelatedRecordsInfoFieldOrder.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-popup-support-RelatedRecordsInfoFieldOrder.html#order) + */ + order: string; + + /** + * Creates a deep clone of the RelatedRecordsInfoFieldOrder class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-support-RelatedRecordsInfoFieldOrder.html#clone) + * + * + */ + clone(): RelatedRecordsInfoFieldOrder; + } + + interface RelatedRecordsInfoFieldOrderConstructor { + new (properties?: RelatedRecordsInfoFieldOrderProperties): RelatedRecordsInfoFieldOrder; + + fromJSON(json: any): RelatedRecordsInfoFieldOrder; + } + + export const RelatedRecordsInfoFieldOrder: RelatedRecordsInfoFieldOrderConstructor; + + interface RelatedRecordsInfoFieldOrderProperties { + /** + * 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-popup-support-RelatedRecordsInfoFieldOrder.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-popup-support-RelatedRecordsInfoFieldOrder.html#order) + */ + order?: string; + } + 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. @@ -15592,12 +18268,12 @@ declare namespace __esri { * 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. + * * **text** - A [text content element](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-TextContent.html) that provides descriptive text as content. + * * **media** - A [media content element](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) that is used to display media such as charts/images. + * * **fields** - A [fields content element](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-FieldsContent.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 [attachments content element](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-AttachmentsContent.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)}` + * * **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. Set the [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields) property to specify any fields needed for rendering the popup. 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: @@ -15613,15 +18289,15 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) */ - content: ContentElementContentElement | ContentElementContentElement[] | string | Function | IPromise; + content: Content | Content[] | string | Function | IPromise; /** - * 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. + * An array of objects or [ExpressionInfo[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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: ExpressionInfo[]; /** - * 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. + * An array of [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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-popup-FieldInfo.html) contains properties for a single field or expression. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) */ @@ -15641,7 +18317,8 @@ declare namespace __esri { */ 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 `["*"]`. + * An array of field names used in the PopupTemplate. Use this property to indicate what fields are required to fully render the PopupTemplate. This is important if setting [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) via a function since any fields needed for successful rendering should be specified here. To fetch the values from all fields, use `["*"]`. + * > This will not fetch fields from related tables. If related features are needed, set this using [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-FieldInfo.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields) * @@ -15704,12 +18381,12 @@ declare namespace __esri { * 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. + * * **text** - A [text content element](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-TextContent.html) that provides descriptive text as content. + * * **media** - A [media content element](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) that is used to display media such as charts/images. + * * **fields** - A [fields content element](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-FieldsContent.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 [attachments content element](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-AttachmentsContent.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)}` + * * **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. Set the [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields) property to specify any fields needed for rendering the popup. 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: @@ -15725,20 +18402,15 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) */ - content?: - | ContentElementContentElementProperties - | ContentElementContentElementProperties[] - | string - | Function - | IPromise; + content?: ContentProperties | ContentProperties[] | string | Function | IPromise; /** - * 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. + * An array of objects or [ExpressionInfo[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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?: ExpressionInfoProperties[]; /** - * 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. + * An array of [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-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-popup-FieldInfo.html) contains properties for a single field or expression. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) */ @@ -15758,7 +18430,8 @@ declare namespace __esri { */ 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 `["*"]`. + * An array of field names used in the PopupTemplate. Use this property to indicate what fields are required to fully render the PopupTemplate. This is important if setting [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) via a function since any fields needed for successful rendering should be specified here. To fetch the values from all fields, use `["*"]`. + * > This will not fetch fields from related tables. If related features are needed, set this using [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-FieldInfo.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields) * @@ -15834,7 +18507,7 @@ declare namespace __esri { */ bingKey: string; /** - * Indicates whether an organization can list applications in the marketplace . + * 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) */ @@ -16316,7 +18989,7 @@ declare namespace __esri { */ bingKey?: string; /** - * Indicates whether an organization can list applications in the marketplace . + * 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) */ @@ -18024,15 +20697,12 @@ declare namespace __esri { */ namespace renderers { /** - * Renderer types. + * SimpleRenderer. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#Renderer) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#SimpleRenderer) */ - export type Renderer = - | __esri.ClassBreaksRenderer - | __esri.SimpleRenderer - | __esri.UniqueValueRenderer - | __esri.HeatmapRenderer; + export type SimpleRenderer = __esri.SimpleRenderer; + export const SimpleRenderer: typeof __esri.SimpleRenderer; /** * ClassBreaksRenderer. @@ -18042,14 +20712,6 @@ declare namespace __esri { 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. * @@ -18058,6 +20720,32 @@ declare namespace __esri { export type UniqueValueRenderer = __esri.UniqueValueRenderer; export const UniqueValueRenderer: typeof __esri.UniqueValueRenderer; + /** + * DotDensityRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#DotDensityRenderer) + */ + export type DotDensityRenderer = __esri.DotDensityRenderer; + export const DotDensityRenderer: typeof __esri.DotDensityRenderer; + + /** + * RendererWithVisualVariables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#RendererWithVisualVariables) + */ + export type RendererWithVisualVariables = + | __esri.SimpleRenderer + | __esri.ClassBreaksRenderer + | __esri.UniqueValueRenderer + | __esri.DotDensityRenderer; + + /** + * RasterRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#RasterRenderer) + */ + export type RasterRenderer = __esri.ClassBreaksRenderer | __esri.UniqueValueRenderer; + /** * HeatmapRenderer. * @@ -18065,6 +20753,13 @@ declare namespace __esri { */ export type HeatmapRenderer = __esri.HeatmapRenderer; export const HeatmapRenderer: typeof __esri.HeatmapRenderer; + + /** + * Renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#Renderer) + */ + export type Renderer = __esri.HeatmapRenderer | __esri.RendererWithVisualVariables; } interface ClassBreaksRenderer extends Renderer, VisualVariablesRenderer { @@ -18149,6 +20844,45 @@ declare namespace __esri { * [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 { @@ -18279,6 +21013,173 @@ declare namespace __esri { title: string; } + interface DotDensityRenderer extends Renderer { + /** + * Defines the variable(s) used to visualize density. This is an array of objects, each of which references a numeric field value or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression used to drive the density. You must also set a color corresponding to each value. If you set a single attribute, `POPULATION` and match it with a color `black` and the [referenceDotValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceDotValue) is `100`, then number of black dots rendered for each feature will approximately equal the value of `POPULATION` divided by `100`. This property is limited to no more than 8 attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#attributes) + */ + attributes: AttributeColorInfo[]; + /** + * The color used to shade the polygon fill behind the dots. 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-renderers-DotDensityRenderer.html#backgroundColor) + * + * @default [0, 0, 0, 0.25] - black, semitransparent + */ + backgroundColor: Color; + /** + * Only applicable when two or more [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#attributes) are specified. When `true`, indicates that colors for overlapping dots will blend. For example, in a feature where a high density of blue dots exist on top of a high density of red dots, some of the dots may appear as purple dots if this property is `true`. When `false` only one color will be favored over the others in rendering. + * + * Blend enabled | Blend disabled + * --------------|--------------- + * ![dot-density-blend](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/dot-density-blend.png) | ![dot-density-no-blend](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/dot-density-no-blend.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#blendDots) + * + * @default true + */ + blendDots: boolean; + /** + * An object providing options for configuring 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-DotDensityRenderer.html#legendOptions) + */ + legendOptions: DotDensityRendererLegendOptions; + /** + * The outline of the polygon. When not set, this renders using the default [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). It is good practice to explicitly set this for every DotDensityRenderer. Either remove the outline altogether, or set it to a very thin, transparent style so it doesn't distract from the dot density. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#outline) + */ + outline: SimpleLineSymbol; + /** + * Defines the initial dot value used for visualizing density. If a [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) is provided, this value indicates the value of each dot at the [view.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) matching the value in [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale). If [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) is set, the dot value will be recalculated depending on the view scale. Note the value of `referenceDotValue` will remain constant even in this scenario. The variable dot value as displayed in the legend is recalculated using [calculateDotValue()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#calculateDotValue). If a [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) is not provided, the value specified in this property will apply to dots at all scales. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceDotValue) + */ + referenceDotValue: number; + /** + * When defined, the renderer will recalculate the dot value linearly based on the change in the view's scale using the [calculateDotValue()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#calculateDotValue) method. The rendering will maintain the density of points as drawn at the provided scale across various scales. However, the dot value will change as the user zooms in or out from the provided scale value, though the value of [referenceDotValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceDotValue) will remain constant. When the computed dot value reaches `1`, the dot value is no longer recalculated as the user zooms further in. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) + */ + referenceScale: number; + /** + * The type of renderer. For DotDensityRenderer this value is always `dot-density`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#type) + */ + readonly type: "dot-density"; + /** + * An array of [Size Visual Variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) objects. Only one [ScaleDependentStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) visual variable should be provided. This visual variable is used to vary the [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#outline) width based on the [view.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). See the snippet below for an example of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#visualVariables) + */ + visualVariables: ScaleDependentStops[]; + + /** + * Calculates an updated dot value for the given scale for the cases where a [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) is provided. This allows the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to update the dot value as the user zooms in or out in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#calculateDotValue) + * + * @param scale The view scale at which to calculate a new dot value. + * + */ + calculateDotValue(scale: number): number; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#clone) + * + * + */ + clone(): DotDensityRenderer; + } + + interface DotDensityRendererConstructor { + /** + * DotDensityRenderer allows you to create dot density visualizations for polygon layers. Dot density visualizations randomly draw dots within each polygon to visualize the density of a population or some other variable. Each dot represents a fixed numeric value of an [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#attributes) or a subset of attributes. Unlike choropleth maps, field values used in dot density visualizations don't need to be normalized because the size of the polygon, together with the number of dots rendered within its boundaries, indicate the spatial density of that value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html) + */ + + new (properties?: DotDensityRendererProperties): DotDensityRenderer; + + fromJSON(json: any): DotDensityRenderer; + } + + export const DotDensityRenderer: DotDensityRendererConstructor; + + interface DotDensityRendererProperties extends RendererProperties { + /** + * Defines the variable(s) used to visualize density. This is an array of objects, each of which references a numeric field value or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression used to drive the density. You must also set a color corresponding to each value. If you set a single attribute, `POPULATION` and match it with a color `black` and the [referenceDotValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceDotValue) is `100`, then number of black dots rendered for each feature will approximately equal the value of `POPULATION` divided by `100`. This property is limited to no more than 8 attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#attributes) + */ + attributes?: AttributeColorInfoProperties[]; + /** + * The color used to shade the polygon fill behind the dots. 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-renderers-DotDensityRenderer.html#backgroundColor) + * + * @default [0, 0, 0, 0.25] - black, semitransparent + */ + backgroundColor?: Color | number[] | string; + /** + * Only applicable when two or more [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#attributes) are specified. When `true`, indicates that colors for overlapping dots will blend. For example, in a feature where a high density of blue dots exist on top of a high density of red dots, some of the dots may appear as purple dots if this property is `true`. When `false` only one color will be favored over the others in rendering. + * + * Blend enabled | Blend disabled + * --------------|--------------- + * ![dot-density-blend](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/dot-density-blend.png) | ![dot-density-no-blend](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/dot-density-no-blend.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#blendDots) + * + * @default true + */ + blendDots?: boolean; + /** + * An object providing options for configuring 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-DotDensityRenderer.html#legendOptions) + */ + legendOptions?: DotDensityRendererLegendOptions; + /** + * The outline of the polygon. When not set, this renders using the default [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). It is good practice to explicitly set this for every DotDensityRenderer. Either remove the outline altogether, or set it to a very thin, transparent style so it doesn't distract from the dot density. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#outline) + */ + outline?: SimpleLineSymbolProperties; + /** + * Defines the initial dot value used for visualizing density. If a [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) is provided, this value indicates the value of each dot at the [view.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) matching the value in [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale). If [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) is set, the dot value will be recalculated depending on the view scale. Note the value of `referenceDotValue` will remain constant even in this scenario. The variable dot value as displayed in the legend is recalculated using [calculateDotValue()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#calculateDotValue). If a [referenceScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) is not provided, the value specified in this property will apply to dots at all scales. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceDotValue) + */ + referenceDotValue?: number; + /** + * When defined, the renderer will recalculate the dot value linearly based on the change in the view's scale using the [calculateDotValue()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#calculateDotValue) method. The rendering will maintain the density of points as drawn at the provided scale across various scales. However, the dot value will change as the user zooms in or out from the provided scale value, though the value of [referenceDotValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceDotValue) will remain constant. When the computed dot value reaches `1`, the dot value is no longer recalculated as the user zooms further in. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceScale) + */ + referenceScale?: number; + /** + * An array of [Size Visual Variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) objects. Only one [ScaleDependentStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) visual variable should be provided. This visual variable is used to vary the [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#outline) width based on the [view.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). See the snippet below for an example of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#visualVariables) + */ + visualVariables?: ScaleDependentStops[]; + } + + export interface DotDensityRendererLegendOptions extends Object { + /** + * Indicates the unit of the data being visualized. this will display next to the dot value in the title 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-DotDensityRenderer.html#legendOptions) + */ + unit?: string; + } + 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. @@ -19055,7 +21956,7 @@ declare namespace __esri { */ authoringInfo: AuthoringInfo; /** - * The renderer type. **Possible values:** class-breaks | heatmap | simple | unique-value + * The renderer type. **Possible values:** class-breaks | heatmap | simple | unique-value | raster-stretch * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#type) */ @@ -19462,7 +22363,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * The view instance in which the visualization will be rendered. * @@ -19588,7 +22489,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. * @@ -19770,7 +22671,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -20002,7 +22903,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -20260,6 +23161,146 @@ declare namespace __esri { authoringInfo: AuthoringInfo; } + /** + * This object contains a helper method for generating a [HeatmapRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html) for a point [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-heatmap.html) + */ + interface heatmap { + /** + * Generates a [HeatmapRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html) that may be applied directly to the layer used to call this method. The renderer represents points as a continuous surface using optimal colors for the indicated basemap. This method should be called when at least some points are visible in the input view's extent. If no points are visible in the view, then the response will not return a useful visualization. In most cases you will provide a `layer`, `basemap`, and optional `field` to generate this renderer. This is a scenario in which the statistics and the distribution of the data aren't well known and the user doesn't know what colors to use in the visualization. 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-heatmap.html#createRenderer) + * + * @param params Input parameters for generating a heatmap visualization based on data returned from a given field. See the table below for details of each parameter. + * @param params.layer The point layer for which the visualization is generated. + * @param params.view The view instance in which the visualization will be rendered. + * @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 value of the `field` is used as a multiplier in the heatmap, making areas with high field values hotter than areas where the features have low field 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.heatmapScheme In authoring apps, the user may select a pre-defined heatmap 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 [heatmapStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.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.fadeToTransparent Indicates whether to fade the lower color stops to a transparent color to create a fuzzy boundary on the edge of the heatmap. A value of `false` makes a discrete boundary on the lower color stop. + * @param params.blurRadius The [blurRadius](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius) in pixels that determines the area of influence of each point. A higher blur radius indicates points have more influence on surrounding points. + * @param params.minRatio The minimum [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) used in the [HeatmapRenderer.colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) of the output renderer. + * @param params.maxRatio The maximum [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) used in the [HeatmapRenderer.colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) of the output renderer. + * + */ + createRenderer(params: heatmapCreateRendererParams): IPromise; + } + + export const heatmap: heatmap; + + export interface heatmapCreateRendererParams extends Object { + /** + * The point layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.html#createRenderer) + */ + layer: FeatureLayer | CSVLayer | GeoJSONLayer; + /** + * The view instance in which the visualization will be rendered. + * + * [Read more...](global.html) + */ + view: MapView; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. The value of the `field` is used as a multiplier in the heatmap, making areas with high field values hotter than areas where the features have low field values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.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-heatmap.html#createRenderer) + * + * @default gray + */ + basemap?: string | Basemap; + /** + * In authoring apps, the user may select a pre-defined heatmap 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-heatmap.html#createRenderer) + */ + heatmapScheme?: HeatmapScheme; + /** + * A statistics object generated from the [heatmapStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.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-heatmap.html#createRenderer) + */ + statistics?: HeatmapStatisticsResult; + /** + * Indicates whether to fade the lower color stops to a transparent color to create a fuzzy boundary on the edge of the heatmap. A value of `false` makes a discrete boundary on the lower color stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.html#createRenderer) + * + * @default true + */ + fadeToTransparent?: boolean; + /** + * The [blurRadius](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius) in pixels that determines the area of influence of each point. A higher blur radius indicates points have more influence on surrounding points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.html#createRenderer) + * + * @default 10 + */ + blurRadius?: number; + /** + * The minimum [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) used in the [HeatmapRenderer.colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) of the output renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.html#createRenderer) + * + * @default 0.01 + */ + minRatio?: number; + /** + * The maximum [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) used in the [HeatmapRenderer.colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) of the output renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.html#createRenderer) + * + * @default 1 + */ + maxRatio?: number; + } + + /** + * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.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-heatmap.html#HeatmapRendererResult) + */ + export interface HeatmapRendererResult 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-heatmap.html#HeatmapRendererResult) + */ + renderer: HeatmapRenderer; + /** + * The color scheme used by the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.html#HeatmapRendererResult) + */ + scheme: HeatmapScheme; + /** + * 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-heatmap.html#HeatmapRendererResult) + */ + 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-heatmap.html#HeatmapRendererResult) + */ + statistics: HeatmapStatisticsResult; + /** + * The ID of the basemap used to determine the optimal color stops of the heatmap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-heatmap.html#HeatmapRendererResult) + */ + basemapId: string; + } + /** * 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. * @@ -20305,7 +23346,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -20421,7 +23462,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -20601,7 +23642,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * The view instance in which the visualization will be rendered. * @@ -20846,6 +23887,37 @@ declare namespace __esri { * */ createRenderer(params: relationshipCreateRendererParams): IPromise; + /** + * Updates a relationship renderer (bivariate choropleth) generated from [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) based on the given input parameters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + * + * @param params Input parameters for updating a relationship visualization created in [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer). + * @param params.field1 A numeric field 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 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.focus + * Determines the orientation of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This value does not change the renderer or symbology of any features in the layer. This affects the legend only. See the table below for a description of the possible values. See the class description at the top of this page for a more thorough explanation of how to read the legend. + * + * Value | Example | Description + * ------|-------------|-------- + * null | ![relationship-legend-null](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-null.png) | The legend renders as a square. The top right corner of the legend indicates that values from both `field1` and `field2` are considered high. | + * HH | ![relationship-legend-hh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hh.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered high. | + * HL | ![relationship-legend-hl](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hl.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are high and values from `field2` are low. | + * LH | ![relationship-legend-lh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-lh.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are low and values from `field2` are high. | + * LL | ![relationship-legend-ll](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-ll.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered low. | + * @param params.numClasses + * Indicates the number of classes by which to break up the values of each field. More classes give you more detail, but more colors, making the visualization more difficult to understand. There are only three possible values. + * + * 2 classes | 3 classes | 4 classes + * --|--|--- + * ![relationship-breaks-2](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-2.png) | ![relationship-breaks-3](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-3.png) | ![relationship-breaks-4](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-4.png) + * + * **Possible Values:** 2 | 3 | 4 + * @param params.colors The array of colors to be used by the symbols in the uniqueValueInfos of the renderer. + * @param params.renderer The relationship renderer (generated from [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer)) to update with the other parameters provided in this method. + * + */ + updateRenderer(params: relationshipUpdateRendererParams): IPromise; } export const relationship: relationship; @@ -20856,7 +23928,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * The view instance in which the visualization will be rendered. * @@ -21042,6 +24114,103 @@ declare namespace __esri { showLegend?: boolean; } + export interface relationshipUpdateRendererParams extends Object { + /** + * A numeric field 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#updateRenderer) + */ + field1: relationshipUpdateRendererParamsField1; + /** + * A numeric field 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#updateRenderer) + */ + field2: relationshipUpdateRendererParamsField2; + /** + * Determines the orientation of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This value does not change the renderer or symbology of any features in the layer. This affects the legend only. See the table below for a description of the possible values. See the class description at the top of this page for a more thorough explanation of how to read the legend. + * + * Value | Example | Description + * ------|-------------|-------- + * null | ![relationship-legend-null](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-null.png) | The legend renders as a square. The top right corner of the legend indicates that values from both `field1` and `field2` are considered high. | + * HH | ![relationship-legend-hh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hh.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered high. | + * HL | ![relationship-legend-hl](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hl.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are high and values from `field2` are low. | + * LH | ![relationship-legend-lh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-lh.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are low and values from `field2` are high. | + * LL | ![relationship-legend-ll](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-ll.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered low. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + */ + focus?: string; + /** + * Indicates the number of classes by which to break up the values of each field. More classes give you more detail, but more colors, making the visualization more difficult to understand. There are only three possible values. + * + * 2 classes | 3 classes | 4 classes + * --|--|--- + * ![relationship-breaks-2](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-2.png) | ![relationship-breaks-3](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-3.png) | ![relationship-breaks-4](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-4.png) + * + * **Possible Values:** 2 | 3 | 4 + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + */ + numClasses: number; + /** + * The array of colors to be used by the symbols in the uniqueValueInfos of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + */ + colors: Color[]; + /** + * The relationship renderer (generated from [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer)) to update with the other parameters provided in this method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + */ + renderer: UniqueValueRenderer; + } + + export interface relationshipUpdateRendererParamsField1 extends Object { + /** + * The name of a numeric field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + */ + 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#updateRenderer) + */ + normalizationField?: string; + /** + * The class breaks for the first field used in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + */ + classBreakInfos: ClassBreak[]; + } + + export interface relationshipUpdateRendererParamsField2 extends Object { + /** + * The name of a numeric field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + */ + 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#updateRenderer) + */ + normalizationField?: string; + /** + * The class breaks for the second field used in the relationship visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#updateRenderer) + */ + classBreakInfos: ClassBreak[]; + } + /** * 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. * @@ -21381,7 +24550,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * The view instance in which the visualization will be rendered. * @@ -21478,7 +24647,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -21646,7 +24815,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -21774,7 +24943,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -22102,7 +25271,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -22376,7 +25545,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -22549,7 +25718,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ - layer: FeatureLayer | SceneLayer | CSVLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | GeoJSONLayer; /** * 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. * @@ -22853,13 +26022,39 @@ declare namespace __esri { const __classBreaksMapped: classBreaks; export const classBreaks: typeof __classBreaksMapped.classBreaks; + /** + * An object describing a single class break 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#ClassBreak) + */ + export interface ClassBreak 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#ClassBreak) + */ + 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#ClassBreak) + */ + 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#ClassBreak) + */ + maxValue: number; + } + 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; + layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer | GeoJSONLayer; /** * 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. * @@ -22953,7 +26148,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ - classBreaksInfos: ClassBreaksResultClassBreaksInfos[]; + classBreakInfos: ClassBreak[]; /** * The minimum value of features in the dataset. This will be the lower bound of the lowest class break. * @@ -22974,25 +26169,105 @@ declare namespace __esri { normalizationTotal: number; } - export interface ClassBreaksResultClassBreaksInfos extends Object { + /** + * Function for generating statistics from a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) for a [HeatmapRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html) visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html) + */ + interface heatmapStatistics { /** - * The label describing the given class break for use in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * Returns an object containing various statistics describing the intensity values for a heatmap visualization of a given point [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-heatmapStatistics.html#heatmapStatistics) + * + * @param params See the table below for details of each parameter. + * @param params.layer The layer from which to generate statistics for the pixel intensity values and a given `field` if provided. + * @param params.view A [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance used to calculate pixel intensity values based on the features in the current view. + * @param params.field The name of the numeric field for which the statistics will be generated. + * @param params.blurRadius The area of influence for each point as a radius in pixels from the point. + * @param params.features A subset of features for which to calculate the statistics. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ - label: string; + heatmapStatistics(params: heatmapStatisticsHeatmapStatisticsParams): IPromise; + } + + export const heatmapStatistics: heatmapStatistics; + + export interface heatmapStatisticsHeatmapStatisticsParams extends Object { /** - * The lower bound of the class break. + * The layer from which to generate statistics for the pixel intensity values and a given `field` if provided. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#heatmapStatistics) */ - minValue: number; + layer: FeatureLayer | CSVLayer | GeoJSONLayer; /** - * The upper bound of the class break. + * A [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance used to calculate pixel intensity values based on the features in the current view. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + * [Read more...](global.html) */ - maxValue: number; + view: MapView; + /** + * The name of the numeric field for which the statistics will be generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#heatmapStatistics) + */ + field?: string; + /** + * The area of influence for each point as a radius in pixels from the point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#heatmapStatistics) + */ + blurRadius?: number; + /** + * A subset of features for which to calculate the statistics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#heatmapStatistics) + */ + features?: Graphic[]; + } + + /** + * The intensity value statistics returned from the [heatmapStatistics()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#heatmapStatistics) function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#HeatmapStatisticsResult) + */ + export interface HeatmapStatisticsResult extends Object { + /** + * The average of all pixel intensity values for the given view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#HeatmapStatisticsResult) + */ + avg: number; + /** + * The number of features evaluated in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#HeatmapStatisticsResult) + */ + count?: number; + /** + * The maximum pixel intensity value of all pixels in the given view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#HeatmapStatisticsResult) + */ + max: number; + /** + * The minimum pixel intensity value of all pixels in the given view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#HeatmapStatisticsResult) + */ + min: number; + /** + * The standard deviation of the pixel intensity values of all pixels in the given view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#HeatmapStatisticsResult) + */ + stddev: number; + /** + * The summary statistics for all values returned from the field, if provided. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-heatmapStatistics.html#HeatmapStatisticsResult) + */ + summaryStatistics?: SummaryStatisticsResult; } /** @@ -23042,7 +26317,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ - layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer | GeoJSONLayer; /** * The name of the numeric field for which the histogram will be generated. This property is ignored if a `valueExpression` is used. * @@ -23260,7 +26535,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ - layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer | GeoJSONLayer; /** * The name of the numeric field for which the summary statistics will be generated. This property is ignored if a `valueExpression` is used. * @@ -23365,7 +26640,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ - layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; + layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer | GeoJSONLayer; /** * 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. * @@ -23488,7 +26763,7 @@ declare namespace __esri { * @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[]; + getThemes(basemap?: string | Basemap): Theme[]; } export const symbologyColor: symbologyColor; @@ -23832,6 +27107,38 @@ declare namespace __esri { basemapId: string; } + /** + * Describes a theme that pairs well with the given basemaps. See the table below for more details of the properties in this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#Theme) + */ + export interface Theme extends Object { + /** + * The name of the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#Theme) + */ + name: string; + /** + * The label identifying the theme in UI elements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#Theme) + */ + label: string; + /** + * Text describing the theme in the UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#Theme) + */ + description: string; + /** + * The Esri basemaps that pair well with the given theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#Theme) + */ + basemaps: string[]; + } + export interface ColorSchemeForMeshColorsForClassBreaks extends Object { /** * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. @@ -23922,6 +27229,132 @@ declare namespace __esri { numClasses: number; } + interface symbologyHeatmap { + /** + * Clones a heatmap scheme object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#cloneScheme) + * + * @param scheme The heatmap scheme object to clone. + * + */ + cloneScheme(scheme: HeatmapScheme): HeatmapScheme; + /** + * Returns a primary scheme and secondary schemes defining properties for heatmap visualizations in a point [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color schemes of the heatmap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.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 colors for overlaying a heatmap against the given basemap. + * + */ + getSchemes(params: heatmapGetSchemesParams): HeatmapSchemes; + /** + * 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-heatmap.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): heatmapTheme[]; + } + + export const symbologyHeatmap: symbologyHeatmap; + + export interface heatmapGetSchemesParams extends Object { + /** + * The basemap to pair with the visualization. This value indicates the best colors for overlaying a heatmap against the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#getSchemes) + */ + basemap: string | Basemap; + } + + /** + * Properties defining the symbology scheme used to visualize point features as a heatmap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#HeatmapScheme) + */ + export interface HeatmapScheme 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-heatmap.html#HeatmapScheme) + */ + id: string; + /** + * A continuous color ramp used to construct a heatmap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#HeatmapScheme) + */ + colors: Color[]; + /** + * The opacity of the heatmap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#HeatmapScheme) + */ + opacity: number; + } + + /** + * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#getSchemes) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#HeatmapSchemes) + */ + export interface HeatmapSchemes extends Object { + /** + * The heatmap 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-heatmap.html#HeatmapSchemes) + */ + primaryScheme: HeatmapScheme; + /** + * Additional heatmap color schemes that may be used to visualize data overlaid on the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#HeatmapSchemes) + */ + secondarySchemes: HeatmapScheme[]; + /** + * The ID of the basemap associated with the given schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#HeatmapSchemes) + */ + basemapId: string; + } + + /** + * Describes a theme that pairs well with the given basemaps. See the table below for more details of the properties in this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#Theme) + */ + export interface heatmapTheme extends Object { + /** + * The name of the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#Theme) + */ + name: string; + /** + * The label identifying the theme in UI elements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#Theme) + */ + label: string; + /** + * Text describing the theme in the UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#Theme) + */ + description: string; + /** + * The Esri basemaps that pair well with the given theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-heatmap.html#Theme) + */ + basemaps: string[]; + } + interface symbologyLocation { /** * Clones a location scheme object. @@ -25284,6 +28717,285 @@ declare namespace __esri { width: number; } + interface StretchRenderer extends Renderer { + /** + * The stretched values are mapped to this specified color ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#colorRamp) + */ + colorRamp: ColorRamp; + /** + * The computeGamma automatically calculates best gamma value to render exported image based on empirical model. This is applicable to any stretch type when [useGamma](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#useGamma) is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#computeGamma) + */ + computeGamma: boolean; + /** + * When Dynamic Range Adjustment is `true`, the statistics based on the current display extent are calculated as you zoom and pan around the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#dynamicRangeAdjustment) + */ + dynamicRangeAdjustment: boolean; + /** + * The gamma values to be used if [useGamma](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#useGamma) is set to `false`. Gamma refers to the degree of contrast between the mid-level gray values of a raster dataset. Gamma does not affect the black or white values in a raster dataset, only the middle values. By applying a gamma correction, you can control the overall brightness of 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-renderers-StretchRenderer.html#gamma) + */ + gamma: number[]; + /** + * Applicable when [stretchType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#stretchType) is percent-clip. Specifies the percentage of the highest values to exclude from the stretch. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#maxPercent) + */ + maxPercent: number; + /** + * Applicable when [stretchType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#stretchType) is percent-clip. Specifies the percentage of the lowest values to exclude from the stretch. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#minPercent) + */ + minPercent: number; + /** + * Applicable when [stretchType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#stretchType) is standard-deviation. Specifies the number of standard deviations to use. The values beyond the number of standard deviations become the [outputMin](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) and [outputMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax). The remaining values are linearly stretched between [outputMin](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) and [outputMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#numberOfStandardDeviations) + */ + numberOfStandardDeviations: number; + /** + * The outputMax denotes the Output Maximum, which is the highest pixel value for the histogram. The [outputMin](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) and [outputMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax) will set the range of values that will then be linearly contrast stretched. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax) + */ + outputMax: number; + /** + * The outputMin denotes the Output Minimum, which is the lowest pixel value for the histogram. The [outputMin](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) and [outputMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax) will set the range of values that will then be linearly contrast stretched. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) + */ + outputMin: number; + /** + * The Strength Level determines how much of the sigmoidal function will be used in the stretch. A low value such as 1 will only use the middle portion of the curve, which tends to produce dull and faint colors. A high value such as 6 will use the entire curve, which tends to produce bold and sharp colors. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#sigmoidStrengthLevel) + */ + sigmoidStrengthLevel: number; + /** + * The stretch type defines a histogram stretch that will be applied to the rasters to enhance their appearance. Stretching improves the appearance of the data by spreading the pixel values along a histogram from the minimum and maximum values defined by their bit depth. For example, an 8-bit raster dataset or mosaic dataset will be stretched from 0 to 255. Different stretches will produce different results in the raster display. The possible stretch types are listed below. + * + * Value | Description + * ------|------------ + * none | No stretch method will be applied, even if statistics exist. + * standard-deviation | This stretch type applies a linear stretch between the values defined by the standard deviation value. + * histogram-equalization | The pixel values are stretched to adjust the contrast using the histogram of the data. + * min-max | This stretch type applies a linear stretch based on the output minimum and output maximum pixel values, which are used as the endpoints for the histogram. + * percent-clip | This stretch type applies a linear stretch between the defined [minPercent](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#minPercent) and [maxPercent](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#maxPercent) pixel values. + * sigmoid | The Sigmoid contrast stretch is designed to highlight moderate pixel values in your imagery while maintaining sufficient contrast at the extremes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#stretchType) + */ + stretchType: "none" | "standard-deviation" | "histogram-equalization" | "min-max" | "percent-clip" | "sigmoid"; + /** + * The type of Renderer. For StretchRenderer this value is always `raster-stretch`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#type) + */ + readonly type: "raster-stretch"; + /** + * Denotes wether the [gamma](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#gamma) value should be used. When `useGamma` is `false`, the gamma is calculated from the statistics and histogram of the data. The [gamma](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#gamma) property is required if `useGamma` is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#useGamma) + */ + useGamma: boolean; + } + + interface StretchRendererConstructor { + /** + * StretchRenderer defines the symbology with a gradual ramp of colors for each pixel in a [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) based on the pixel value. The StretchRenderer works well when you have a large range of values to display, such as in imagery, aerial photographs, or elevation models. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html) + */ + + new (properties?: StretchRendererProperties): StretchRenderer; + + fromJSON(json: any): StretchRenderer; + } + + export const StretchRenderer: StretchRendererConstructor; + + interface StretchRendererProperties extends RendererProperties { + /** + * The stretched values are mapped to this specified color ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#colorRamp) + */ + colorRamp?: ColorRampProperties; + /** + * The computeGamma automatically calculates best gamma value to render exported image based on empirical model. This is applicable to any stretch type when [useGamma](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#useGamma) is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#computeGamma) + */ + computeGamma?: boolean; + /** + * When Dynamic Range Adjustment is `true`, the statistics based on the current display extent are calculated as you zoom and pan around the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#dynamicRangeAdjustment) + */ + dynamicRangeAdjustment?: boolean; + /** + * The gamma values to be used if [useGamma](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#useGamma) is set to `false`. Gamma refers to the degree of contrast between the mid-level gray values of a raster dataset. Gamma does not affect the black or white values in a raster dataset, only the middle values. By applying a gamma correction, you can control the overall brightness of 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-renderers-StretchRenderer.html#gamma) + */ + gamma?: number[]; + /** + * Applicable when [stretchType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#stretchType) is percent-clip. Specifies the percentage of the highest values to exclude from the stretch. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#maxPercent) + */ + maxPercent?: number; + /** + * Applicable when [stretchType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#stretchType) is percent-clip. Specifies the percentage of the lowest values to exclude from the stretch. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#minPercent) + */ + minPercent?: number; + /** + * Applicable when [stretchType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#stretchType) is standard-deviation. Specifies the number of standard deviations to use. The values beyond the number of standard deviations become the [outputMin](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) and [outputMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax). The remaining values are linearly stretched between [outputMin](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) and [outputMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#numberOfStandardDeviations) + */ + numberOfStandardDeviations?: number; + /** + * The outputMax denotes the Output Maximum, which is the highest pixel value for the histogram. The [outputMin](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) and [outputMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax) will set the range of values that will then be linearly contrast stretched. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax) + */ + outputMax?: number; + /** + * The outputMin denotes the Output Minimum, which is the lowest pixel value for the histogram. The [outputMin](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) and [outputMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMax) will set the range of values that will then be linearly contrast stretched. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#outputMin) + */ + outputMin?: number; + /** + * The Strength Level determines how much of the sigmoidal function will be used in the stretch. A low value such as 1 will only use the middle portion of the curve, which tends to produce dull and faint colors. A high value such as 6 will use the entire curve, which tends to produce bold and sharp colors. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#sigmoidStrengthLevel) + */ + sigmoidStrengthLevel?: number; + /** + * The stretch type defines a histogram stretch that will be applied to the rasters to enhance their appearance. Stretching improves the appearance of the data by spreading the pixel values along a histogram from the minimum and maximum values defined by their bit depth. For example, an 8-bit raster dataset or mosaic dataset will be stretched from 0 to 255. Different stretches will produce different results in the raster display. The possible stretch types are listed below. + * + * Value | Description + * ------|------------ + * none | No stretch method will be applied, even if statistics exist. + * standard-deviation | This stretch type applies a linear stretch between the values defined by the standard deviation value. + * histogram-equalization | The pixel values are stretched to adjust the contrast using the histogram of the data. + * min-max | This stretch type applies a linear stretch based on the output minimum and output maximum pixel values, which are used as the endpoints for the histogram. + * percent-clip | This stretch type applies a linear stretch between the defined [minPercent](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#minPercent) and [maxPercent](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#maxPercent) pixel values. + * sigmoid | The Sigmoid contrast stretch is designed to highlight moderate pixel values in your imagery while maintaining sufficient contrast at the extremes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#stretchType) + */ + stretchType?: "none" | "standard-deviation" | "histogram-equalization" | "min-max" | "percent-clip" | "sigmoid"; + /** + * Denotes wether the [gamma](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#gamma) value should be used. When `useGamma` is `false`, the gamma is calculated from the statistics and histogram of the data. The [gamma](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#gamma) property is required if `useGamma` is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-StretchRenderer.html#useGamma) + */ + useGamma?: boolean; + } + + interface AttributeColorInfo extends Accessor, JSONSupport { + /** + * The color used to render dots representing the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#color) + */ + color: Color; + /** + * The name of the numeric attribute field to represent with dots with the reference dot value provided to the [DotDensityRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceDotValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#field) + */ + field: string; + /** + * The label used to describe the field or attribute in 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-support-AttributeColorInfo.html#label) + */ + label: 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-support-AttributeColorInfo.html#field). Therefore, this property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.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-support-AttributeColorInfo.html#valueExpression) property. This is displayed as the label of the attribute in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of one provided in the [label](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#label) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#valueExpressionTitle) + */ + valueExpressionTitle: string; + + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#clone) + * + * + */ + clone(): AttributeColorInfo; + } + + interface AttributeColorInfoConstructor { + /** + * Defines the symbology for a [DotDensityRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html) in the renderer's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#attributes) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html) + */ + + new (properties?: AttributeColorInfoProperties): AttributeColorInfo; + + fromJSON(json: any): AttributeColorInfo; + } + + export const AttributeColorInfo: AttributeColorInfoConstructor; + + interface AttributeColorInfoProperties { + /** + * The color used to render dots representing the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#color) + */ + color?: Color | number[] | string; + /** + * The name of the numeric attribute field to represent with dots with the reference dot value provided to the [DotDensityRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html#referenceDotValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#field) + */ + field?: string; + /** + * The label used to describe the field or attribute in 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-support-AttributeColorInfo.html#label) + */ + label?: 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-support-AttributeColorInfo.html#field). Therefore, this property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.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-support-AttributeColorInfo.html#valueExpression) property. This is displayed as the label of the attribute in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of one provided in the [label](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#label) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AttributeColorInfo.html#valueExpressionTitle) + */ + valueExpressionTitle?: string; + } + 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 @@ -25291,6 +29003,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) */ classificationMethod: string; + /** + * Indicates the color ramp was used to create the symbols for Unique Value or Class Breaks renderer for Imagery Layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#colorRamp) + */ + colorRamp: ColorRamp; /** * 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). * @@ -25371,6 +29089,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) */ classificationMethod?: string; + /** + * Indicates the color ramp was used to create the symbols for Unique Value or Class Breaks renderer for Imagery Layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#colorRamp) + */ + colorRamp?: ColorRampProperties; /** * 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). * @@ -26538,7 +30262,7 @@ declare namespace __esri { /** * 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). + * > **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) */ @@ -26562,7 +30286,7 @@ declare namespace __esri { */ normalizationField?: string; /** - * This value must be `$view.scale`. + * 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#ScaleDependentIcons) */ @@ -26736,18 +30460,18 @@ declare namespace __esri { } 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; + /** + * The opacity value (between `0.0` and `1.0`) 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#opacity) + */ + opacity: number; /** * 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). * @@ -26774,18 +30498,18 @@ declare namespace __esri { 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; + /** + * The opacity value (between `0.0` and `1.0`) 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#opacity) + */ + opacity?: number | number[] | 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). * @@ -26961,6 +30685,13 @@ declare namespace __esri { */ export type renderersClassBreaksRenderer = ClassBreaksRenderer; + /** + * DotDensityRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#DotDensityRenderer) + */ + export type renderersDotDensityRenderer = DotDensityRenderer; + /** * HeatmapRenderer. * @@ -26969,11 +30700,29 @@ declare namespace __esri { export type renderersHeatmapRenderer = HeatmapRenderer; /** - * Renderer types. + * RasterRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#RasterRenderer) + */ + export type RasterRenderer = ClassBreaksRenderer | UniqueValueRenderer; + + /** + * Renderer. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#Renderer) */ - export type renderersRenderer = ClassBreaksRenderer | SimpleRenderer | UniqueValueRenderer | HeatmapRenderer; + export type renderersRenderer = HeatmapRenderer | RendererWithVisualVariables; + + /** + * RendererWithVisualVariables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#RendererWithVisualVariables) + */ + export type RendererWithVisualVariables = + | SimpleRenderer + | ClassBreaksRenderer + | UniqueValueRenderer + | DotDensityRenderer; /** * SimpleRenderer. @@ -27296,983 +31045,6 @@ declare namespace __esri { 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). @@ -28295,11 +31067,11 @@ declare namespace __esri { * * [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 layer Layer or a promise that resolves to a layer to add 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; + 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). * @@ -28381,100 +31153,6 @@ declare namespace __esri { layers?: CollectionProperties | LayerProperties[]; } - 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; - } - - 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: * @@ -28756,7 +31434,7 @@ declare namespace __esri { */ 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. + * The color of the callout line. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -28810,7 +31488,7 @@ declare namespace __esri { */ 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. + * The color of the callout line. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -28835,18 +31513,18 @@ declare namespace __esri { 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. + * The color of the callout line border. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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; + color?: Color | number[] | string; } 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. + * The color of the callout line border. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -28857,7 +31535,7 @@ 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. + * The color of the edges. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -28907,7 +31585,7 @@ 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. + * The color of the edges. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -29015,6 +31693,14 @@ declare namespace __esri { } interface ExtrudeSymbol3DLayer extends Symbol3DLayer { + /** + * Indicates whether the symbol layer geometry casts shadows in the scene. Setting this property to `false` will disable shadows for the symbol layer even if direct shadows are enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#castShadows) + * + * @default true + */ + castShadows: boolean; /** * Sets the contour edges on polygons symbolized with ExtrudeSymbol3DLayer. * @@ -29061,6 +31747,14 @@ declare namespace __esri { export const ExtrudeSymbol3DLayer: ExtrudeSymbol3DLayerConstructor; interface ExtrudeSymbol3DLayerProperties extends Symbol3DLayerProperties { + /** + * Indicates whether the symbol layer geometry casts shadows in the scene. Setting this property to `false` will disable shadows for the symbol layer even if direct shadows are enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#castShadows) + * + * @default true + */ + castShadows?: boolean; /** * Sets the contour edges on polygons symbolized with ExtrudeSymbol3DLayer. * @@ -29110,6 +31804,14 @@ declare namespace __esri { } interface FillSymbol3DLayer extends Symbol3DLayer { + /** + * Indicates whether the symbol layer geometry casts shadows in the scene. Setting this property to `false` will disable shadows for the symbol layer even if direct shadows are enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment). This property applies only to [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#castShadows) + * + * @default true + */ + castShadows: boolean; /** * 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) * @@ -29154,6 +31856,14 @@ declare namespace __esri { export const FillSymbol3DLayer: FillSymbol3DLayerConstructor; interface FillSymbol3DLayerProperties extends Symbol3DLayerProperties { + /** + * Indicates whether the symbol layer geometry casts shadows in the scene. Setting this property to `false` will disable shadows for the symbol layer even if direct shadows are enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment). This property applies only to [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#castShadows) + * + * @default true + */ + castShadows?: boolean; /** * 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) * @@ -29170,7 +31880,7 @@ declare namespace __esri { 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. + * The color of the outline. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) */ @@ -29185,7 +31895,7 @@ 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. + * The color of the outline. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) */ @@ -29318,6 +32028,12 @@ declare namespace __esri { * @default center */ anchor: string; + /** + * Defines the [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) relative to the center of the icon. It is specified as a ratio of the icon's dimensions. For example, a value of `{ x: 0, y: 0 }` designates the center of the icon, while a value of `{ x: -0.5, y: -0.5 }` causes the top-left corner of the icon to coincide with the feature geometry. This property only applies when [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) is set to `relative`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchorPosition) + */ + anchorPosition: IconSymbol3DLayerAnchorPosition; /** * The outline of the icon. * @@ -29326,6 +32042,7 @@ declare namespace __esri { 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. + * > **Known Limitations** Using this property to render an SVG path is not supported in IE11. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) * @@ -29380,6 +32097,12 @@ declare namespace __esri { * @default center */ anchor?: string; + /** + * Defines the [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) relative to the center of the icon. It is specified as a ratio of the icon's dimensions. For example, a value of `{ x: 0, y: 0 }` designates the center of the icon, while a value of `{ x: -0.5, y: -0.5 }` causes the top-left corner of the icon to coincide with the feature geometry. This property only applies when [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) is set to `relative`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchorPosition) + */ + anchorPosition?: IconSymbol3DLayerAnchorPosition; /** * The outline of the icon. * @@ -29388,6 +32111,7 @@ declare namespace __esri { 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. + * > **Known Limitations** Using this property to render an SVG path is not supported in IE11. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) * @@ -29404,9 +32128,24 @@ declare namespace __esri { size?: number | string; } + export interface IconSymbol3DLayerAnchorPosition extends Object { + /** + * Value defining the position relative to the icon's width. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchorPosition) + */ + x: number; + /** + * Value defining the position relative to the icon's height. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchorPosition) + */ + y: number; + } + 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. + * The color of the outline. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -29425,7 +32164,7 @@ 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. + * The color of the outline. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -29453,6 +32192,7 @@ 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) + * triangle | ![s3d-icon-triangle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-triangle.png) * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) @@ -29690,7 +32430,7 @@ declare namespace __esri { interface MarkerSymbol extends Symbol { /** - * The angle of the marker in degrees. + * The angle of the marker relative to the screen 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) @@ -29700,7 +32440,6 @@ declare namespace __esri { 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`). - * > **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) * @@ -29709,7 +32448,6 @@ declare namespace __esri { 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`). - * > **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) * @@ -29734,7 +32472,7 @@ declare namespace __esri { interface MarkerSymbolProperties extends SymbolProperties { /** - * The angle of the marker in degrees. + * The angle of the marker relative to the screen 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) @@ -29744,7 +32482,6 @@ declare namespace __esri { 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`). - * > **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) * @@ -29753,7 +32490,6 @@ declare namespace __esri { 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`). - * > **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) * @@ -29817,6 +32553,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) */ anchorPosition: ObjectSymbol3DLayerAnchorPosition; + /** + * Indicates whether the symbol layer geometry casts shadows in the scene. Setting this property to `false` will disable shadows for the symbol layer even if direct shadows are enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#castShadows) + * + * @default true + */ + castShadows: boolean; /** * 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. * @@ -29840,7 +32584,7 @@ declare namespace __esri { */ 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. + * 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 glTF format. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) * @@ -29919,6 +32663,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) */ anchorPosition?: ObjectSymbol3DLayerAnchorPosition; + /** + * Indicates whether the symbol layer geometry casts shadows in the scene. Setting this property to `false` will disable shadows for the symbol layer even if direct shadows are enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#castShadows) + * + * @default true + */ + castShadows?: boolean; /** * 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. * @@ -29942,7 +32694,7 @@ declare namespace __esri { */ 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. + * 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 glTF format. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) * @@ -29972,10 +32724,23 @@ declare namespace __esri { } export interface ObjectSymbol3DLayerAnchorPosition extends Object { + /** + * Value defining the position relative to the x axis of the bounding box. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) + */ x: number; - + /** + * Value defining the position relative to the y axis of the bounding box. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) + */ y: number; - + /** + * Value defining the position relative to the z axis of the bounding box. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) + */ z: number; } @@ -29998,7 +32763,7 @@ declare namespace __esri { */ 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. + * The URL to the 3D model in glTF format. The URL should point to a glTF file (.gltf or .glb) which can reference additional binary (.bin) and image files (.jpg, .png). See the guide topic on [Visualizing points with 3D symbols](https://developers.arcgis.com/javascript/latest/guide/visualizing-points-3d/index.html) to learn how to use a custom 3D model. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) */ @@ -30006,6 +32771,14 @@ declare namespace __esri { } interface PathSymbol3DLayer extends Symbol3DLayer { + /** + * Indicates whether the symbol layer geometry casts shadows in the scene. Setting this property to `false` will disable shadows for the symbol layer even if direct shadows are enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#castShadows) + * + * @default true + */ + castShadows: boolean; /** * The diameter of the tube in meters. * @@ -30046,6 +32819,14 @@ declare namespace __esri { export const PathSymbol3DLayer: PathSymbol3DLayerConstructor; interface PathSymbol3DLayerProperties extends Symbol3DLayerProperties { + /** + * Indicates whether the symbol layer geometry casts shadows in the scene. Setting this property to `false` will disable shadows for the symbol layer even if direct shadows are enabled in [SceneView.environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#castShadows) + * + * @default true + */ + castShadows?: boolean; /** * The diameter of the tube in meters. * @@ -30220,6 +33001,9 @@ declare namespace __esri { * * 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. * + * + * > **Known Limitations** Using this property to render SVG paths as images is not supported in IE11. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) */ url: string; @@ -30271,6 +33055,9 @@ declare namespace __esri { * * 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. * + * + * > **Known Limitations** Using this property to render SVG paths as images is not supported in IE11. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) */ url?: string; @@ -30290,7 +33077,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) */ - callout: Callout3D; + callout: LineCallout3D; /** * For PointSymbol3D the type is always `point-3d`. * @@ -30334,7 +33121,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) */ - callout?: Callout3DProperties; + callout?: LineCallout3DProperties; /** * 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. * @@ -30676,7 +33463,7 @@ declare namespace __esri { outline: SimpleLineSymbol; /** * 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). + * > **Known Limitations** This property is not supported in IE11. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#path) */ @@ -30691,7 +33478,6 @@ declare namespace __esri { size: number; /** * 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 * ------|------------ @@ -30748,7 +33534,7 @@ declare namespace __esri { outline?: SimpleLineSymbolProperties; /** * 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). + * > **Known Limitations** This property is not supported in IE11. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#path) */ @@ -30763,7 +33549,6 @@ declare namespace __esri { size?: number | string; /** * 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 * ------|------------ @@ -30863,9 +33648,124 @@ declare namespace __esri { symbolConfig?: string; } + interface symbolUtils { + /** + * Returns a symbol representing the input [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). This method is useful when you need to know the exact visual properties of a [Graphic's symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol), particularly when the graphic comes from the result of a [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) and its symbol properties may be empty. A symbol's properties won't be populated when a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) defines the visualization of a layer rather than symbols set individually on each graphic of a layer. This is the case for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), and any other layer that has a `renderer` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#getDisplayedSymbol) + * + * @param symbol The graphic from which to retrieve the displayed symbol. This commonly comes from a [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) operation. + * @param options Options for generating the display symbol of the input graphic. These must be specified if the input graphic comes from a layer with a renderer that has [visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) applied. See the object specification below. + * @param options.scale The [view scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) at which the symbol is displayed. + * @param options.viewingMode The [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) of the view, if the symbol is displayed in a SceneView. + * @param options.spatialReference The spatial reference of the view in which the symbol is displayed. + * @param options.resolution The [resolution](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resolution) of the view at which the symbol is displayed. + * + */ + getDisplayedSymbol(symbol: Graphic, options?: symbolUtilsGetDisplayedSymbolOptions): IPromise; + /** + * 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-symbolUtils.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. + * @param options.size The size of the symbol preview in points. + * @param options.maxSize The maximum size of the symbol preview in points. + * @param options.opacity The opacity of the layer represented by the `symbol`. + * @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. + * @param options.rotation The rotation of the symbol. + * + */ + renderPreviewHTML(symbol: Symbol, options?: symbolUtilsRenderPreviewHTMLOptions): IPromise; + } + + export const symbolUtils: symbolUtils; + + export interface symbolUtilsGetDisplayedSymbolOptions extends Object { + /** + * The [view scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) at which the symbol is displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#getDisplayedSymbol) + */ + scale?: number; + /** + * The [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) of the view, if the symbol is displayed in a SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#getDisplayedSymbol) + */ + viewingMode?: string; + /** + * The spatial reference of the view in which the symbol is displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#getDisplayedSymbol) + */ + spatialReference?: SpatialReference; + /** + * The [resolution](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resolution) of the view at which the symbol is displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#getDisplayedSymbol) + */ + resolution?: number; + } + + export interface symbolUtilsRenderPreviewHTMLOptions extends Object { + /** + * The parent node to append to the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.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-symbolUtils.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-symbolUtils.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-symbolUtils.html#renderPreviewHTML) + */ + opacity?: number; + /** + * Indicates whether to scale the symbol preview. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.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-symbolUtils.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-symbolUtils.html#renderPreviewHTML) + */ + symbolConfig?: string; + /** + * The rotation of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#renderPreviewHTML) + */ + rotation?: 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. + * The color of the symbol. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -30896,7 +33796,7 @@ declare namespace __esri { 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. + * The color of the symbol. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -31098,7 +33998,8 @@ declare namespace __esri { */ rotated: boolean; /** - * The text string to display in the view. + * The text string to display in the view. Long text strings will be split into multiple lines. The maximum length of each line is equal to this formula: (512 * [font.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size)) / 24. + * > **Known Limitations** This property only applies when TextSymbol is used to define the symbol property of a [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), and not for labelling purposes. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#text) */ @@ -31240,7 +34141,8 @@ declare namespace __esri { */ rotated?: boolean; /** - * The text string to display in the view. + * The text string to display in the view. Long text strings will be split into multiple lines. The maximum length of each line is equal to this formula: (512 * [font.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size)) / 24. + * > **Known Limitations** This property only applies when TextSymbol is used to define the symbol property of a [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), and not for labelling purposes. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#text) */ @@ -31363,7 +34265,7 @@ declare namespace __esri { 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. + * The color of the halo. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -31382,7 +34284,7 @@ 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. + * The color of the halo. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -32141,7 +35043,7 @@ declare namespace __esri { * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). * */ - checkJobStatus(jobId: string, requestOptions?: any): IPromise; + checkJobStatus(jobId: string, requestOptions?: any): IPromise; /** * Sends a request to the server to execute a synchronous GP task. * @@ -32222,7 +35124,7 @@ declare namespace __esri { * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). * */ - submitJob(params: any, requestOptions?: any): IPromise; + submitJob(params: any, requestOptions?: any): IPromise; } interface GeoprocessorConstructor { @@ -32784,50 +35686,6 @@ declare namespace __esri { gdbVersion?: string; } - /** - * The AttachmentInfo returns information about attachments associated with a feature. This resource is available only if the [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) has attachments. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) - */ - export interface 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; - } - interface RouteTask extends Task { /** * Solves the route against the route layer with the route parameters. @@ -32956,6 +35814,93 @@ declare namespace __esri { score?: number; } + interface AlgorithmicColorRamp extends ColorRamp { + /** + * The algorithm used to generate the colors between the `fromColor` and `toColor`. Each algorithm uses different methods for generating the intervening colors. + * + * Possible Value | Description + * ---------------|------------ + * cie-lab | Blends the from and to colors without traversing the intervening hue space. + * lab-lch | The hue, saturation, value (hsv) algorithm is a linear traverse of colors between pairs: Color 1 H to Color 2 H, Color 1 S to Color 2 S, and Color 1 V to Color 2 V. + * hsv | The lab-lch algorithm is very similar to the cie-lab but does not seek the shortest path between colors. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html#algorithm) + */ + algorithm: "cie-lab" | "lab-lch" | "hsv"; + /** + * The first color in the color ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html#fromColor) + */ + fromColor: Color; + /** + * The last color in the color ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html#toColor) + */ + toColor: Color; + /** + * A string value representing the color ramp type. This value is always `algorithmic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html#type) + * + * @default algorithmic + */ + readonly type: "algorithmic"; + + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html#clone) + * + * + */ + clone(): AlgorithmicColorRamp; + } + + interface AlgorithmicColorRampConstructor { + /** + * Create an algorithmic color ramp to define the range of colors used in the renderer generated by the GenerateRendererTask. The algorithmic color ramp is defined by specifying two colors and the algorithm used to traverse the intervening color spaces. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html) + */ + + new (properties?: AlgorithmicColorRampProperties): AlgorithmicColorRamp; + + fromJSON(json: any): AlgorithmicColorRamp; + } + + export const AlgorithmicColorRamp: AlgorithmicColorRampConstructor; + + interface AlgorithmicColorRampProperties extends ColorRampProperties { + /** + * The algorithm used to generate the colors between the `fromColor` and `toColor`. Each algorithm uses different methods for generating the intervening colors. + * + * Possible Value | Description + * ---------------|------------ + * cie-lab | Blends the from and to colors without traversing the intervening hue space. + * lab-lch | The hue, saturation, value (hsv) algorithm is a linear traverse of colors between pairs: Color 1 H to Color 2 H, Color 1 S to Color 2 S, and Color 1 V to Color 2 V. + * hsv | The lab-lch algorithm is very similar to the cie-lab but does not seek the shortest path between colors. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html#algorithm) + */ + algorithm?: "cie-lab" | "lab-lch" | "hsv"; + /** + * The first color in the color ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html#fromColor) + */ + fromColor?: Color; + /** + * The last color in the color ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AlgorithmicColorRamp.html#toColor) + */ + toColor?: Color; + } + 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 @@ -33046,12 +35991,6 @@ declare namespace __esri { * [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`. * @@ -33070,6 +36009,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) */ objectIds: number[]; + /** + * If `true`, the [exif information](http://www.cipa.jp/std/documents/e/DC-008-Translation-2016-E.pdf) for the attachment will be included in [attachmentInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#exifInfo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#returnMetadata) + * + * @default false + */ + returnMetadata: boolean; /** * 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`. * @@ -33082,6 +36029,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start) */ start: number; + /** + * The `where` clause to be applied to the layer. Only features that satisfy the `where` clause 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#where) + */ + where: string; /** * Creates a deep clone of AttachmentQuery object. @@ -33095,7 +36048,7 @@ 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. + * 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](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html) grouped by the source feature objectIds. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html) */ @@ -33114,12 +36067,6 @@ declare namespace __esri { * [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`. * @@ -33138,6 +36085,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) */ objectIds?: number[]; + /** + * If `true`, the [exif information](http://www.cipa.jp/std/documents/e/DC-008-Translation-2016-E.pdf) for the attachment will be included in [attachmentInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#exifInfo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#returnMetadata) + * + * @default false + */ + returnMetadata?: boolean; /** * 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`. * @@ -33150,6 +36105,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start) */ start?: number; + /** + * The `where` clause to be applied to the layer. Only features that satisfy the `where` clause 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#where) + */ + where?: string; } interface BufferParameters extends Accessor { @@ -33257,7 +36218,7 @@ declare namespace __esri { unit?: string; } - interface ClosestFacilityParameters extends Accessor { + interface ClosestFacilityParameters extends Accessor, JSONSupport { /** * The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. * @@ -33293,13 +36254,25 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) */ - directionsLengthUnits: string; + directionsLengthUnits: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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; + directionsOutputType: "complete" | "complete-no-events" | "instructions-only" | "standard" | "summary-only"; /** * 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. * @@ -33316,8 +36289,6 @@ declare namespace __esri { * 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; /** @@ -33349,7 +36320,19 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) */ - outputGeometryPrecisionUnits: string; + outputGeometryPrecisionUnits: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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. * @@ -33363,7 +36346,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) */ - outputLines: string; + outputLines: "none" | "straight" | "true-shape" | "true-shape-with-measure"; /** * 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. * @@ -33399,7 +36382,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) */ - restrictUTurns: string; + restrictUTurns: "allow-backtrack" | "at-dead-ends-only" | "no-backtrack" | "at-dead-ends-and-intersections"; /** * Indicates whether the service should generate driving directions for each route. * @@ -33452,8 +36435,6 @@ declare namespace __esri { * 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; /** @@ -33467,7 +36448,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) */ - timeOfDayUsage: string; + timeOfDayUsage: "start" | "end"; /** * Options for traveling to or from the facility. Default values are defined by the network layer. * @@ -33479,13 +36460,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) */ - travelDirection: string; + travelDirection: "from-facility" | "to-facility"; /** * 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; + travelMode: string; /** * 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). * @@ -33494,15 +36475,6 @@ declare namespace __esri { * @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; } interface ClosestFacilityParametersConstructor { @@ -33513,6 +36485,8 @@ declare namespace __esri { */ new (properties?: ClosestFacilityParametersProperties): ClosestFacilityParameters; + + fromJSON(json: any): ClosestFacilityParameters; } export const ClosestFacilityParameters: ClosestFacilityParametersConstructor; @@ -33553,13 +36527,25 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) */ - directionsLengthUnits?: string; + directionsLengthUnits?: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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; + directionsOutputType?: "complete" | "complete-no-events" | "instructions-only" | "standard" | "summary-only"; /** * 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. * @@ -33576,8 +36562,6 @@ declare namespace __esri { * 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; /** @@ -33609,7 +36593,19 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) */ - outputGeometryPrecisionUnits?: string; + outputGeometryPrecisionUnits?: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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. * @@ -33623,7 +36619,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) */ - outputLines?: string; + outputLines?: "none" | "straight" | "true-shape" | "true-shape-with-measure"; /** * 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. * @@ -33659,7 +36655,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) */ - restrictUTurns?: string; + restrictUTurns?: "allow-backtrack" | "at-dead-ends-only" | "no-backtrack" | "at-dead-ends-and-intersections"; /** * Indicates whether the service should generate driving directions for each route. * @@ -33712,8 +36708,6 @@ declare namespace __esri { * 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; /** @@ -33727,7 +36721,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) */ - timeOfDayUsage?: string; + timeOfDayUsage?: "start" | "end"; /** * Options for traveling to or from the facility. Default values are defined by the network layer. * @@ -33739,13 +36733,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) */ - travelDirection?: string; + travelDirection?: "from-facility" | "to-facility"; /** * 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; + travelMode?: string; /** * 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). * @@ -33893,9 +36887,34 @@ declare namespace __esri { routes?: GraphicProperties[]; } + interface ColorRamp extends Accessor, JSONSupport { + /** + * A string value representing the color ramp type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ColorRamp.html#type) + */ + readonly type: "algorithmic" | "multipart"; + } + + interface ColorRampConstructor { + /** + * A ColorRamp object is used to specify a range of colors that are applied to a group of symbols or pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ColorRamp.html) + */ + + new (properties?: ColorRampProperties): ColorRamp; + + fromJSON(json: any): ColorRamp; + } + + export const ColorRamp: ColorRampConstructor; + + interface ColorRampProperties {} + 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. + * 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) */ @@ -33918,7 +36937,7 @@ 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. + * 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) */ @@ -33931,7 +36950,7 @@ declare namespace __esri { url?: string; } - interface DataLayer extends Accessor { + interface DataLayer extends Accessor, JSONSupport { /** * 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. * @@ -33963,31 +36982,26 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) */ spatialRelationship: string; + + type: void; /** * 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; } interface DataLayerConstructor { /** - * Input for properties of ClosestFacilityParameters,RouteParameters or ServiceAreaParameters. The DataLayer can be used to define the following for each paramater type: + * Input for properties of ClosestFacilityParameters, RouteParameters or ServiceAreaParameters. The DataLayer can be used to define the following for each parameter type: * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) */ new (properties?: DataLayerProperties): DataLayer; + + fromJSON(json: any): DataLayer; } export const DataLayer: DataLayerConstructor; @@ -34024,6 +37038,8 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) */ spatialRelationship?: string; + + type?: void; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. * @@ -34354,11 +37370,17 @@ declare namespace __esri { */ fields: Field[]; /** - * The geometry type of the FeatureSet. + * The geometry type of features in the FeatureSet. All features's geometry must be of the same type. **Possible Values:** point | multipoint | polyline | polygon | multipatch | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#geometryType) */ geometryType: string; + /** + * The [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) used to query the features. It is useful for getting the buffer geometry generated when querying features by [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) or getting the query geometry projected in the [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) of the query. The query geometry is returned only for [client-side queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) and [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm). The query's [returnQueryGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnQueryGeometry) must be set to `true` and the layer's [capabilities.query.supportsQueryGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) has to be `true` for the query to return query geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#queryGeometry) + */ + queryGeometry: Geometry; /** * 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. * @@ -34401,11 +37423,17 @@ declare namespace __esri { */ fields?: FieldProperties[]; /** - * The geometry type of the FeatureSet. + * The geometry type of features in the FeatureSet. All features's geometry must be of the same type. **Possible Values:** point | multipoint | polyline | polygon | multipatch | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#geometryType) */ geometryType?: string; + /** + * The [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) used to query the features. It is useful for getting the buffer geometry generated when querying features by [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) or getting the query geometry projected in the [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) of the query. The query geometry is returned only for [client-side queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) and [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm). The query's [returnQueryGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnQueryGeometry) must be set to `true` and the layer's [capabilities.query.supportsQueryGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) has to be `true` for the query to return query geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#queryGeometry) + */ + queryGeometry?: GeometryProperties; /** * 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. * @@ -35503,6 +38531,49 @@ declare namespace __esri { units?: string; } + interface MultipartColorRamp extends ColorRamp { + /** + * Define an array of algorithmic color ramps used to generate the multi part ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-MultipartColorRamp.html#colorRamps) + */ + colorRamps: AlgorithmicColorRamp[]; + /** + * A string value representing the color ramp type. This value is always `multipart`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-MultipartColorRamp.html#type) + * + * @default multipart + */ + readonly type: "multipart"; + + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-MultipartColorRamp.html#clone) + * + * + */ + clone(): MultipartColorRamp; + } + + interface MultipartColorRampConstructor { + new (properties?: MultipartColorRampProperties): MultipartColorRamp; + + fromJSON(json: any): MultipartColorRamp; + } + + export const MultipartColorRamp: MultipartColorRampConstructor; + + interface MultipartColorRampProperties extends ColorRampProperties { + /** + * Define an array of algorithmic color ramps used to generate the multi part ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-MultipartColorRamp.html#colorRamps) + */ + colorRamps?: AlgorithmicColorRampProperties[]; + } + interface NAMessage extends Accessor, JSONSupport { /** * A description of the network analyst message. @@ -35511,11 +38582,11 @@ declare namespace __esri { */ description: string; /** - * The network analyst message type. + * The network analyst 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-NAMessage.html#type) */ - type: any; + type: string; } interface NAMessageConstructor { @@ -35534,11 +38605,11 @@ declare namespace __esri { */ description?: string; /** - * The network analyst message type. + * The network analyst 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-NAMessage.html#type) */ - type?: any; + type?: string; } interface OffsetParameters extends Accessor { @@ -35989,7 +39060,7 @@ declare namespace __esri { */ scalebarUnit?: string; /** - * An array of [LegendLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html) containing the id's of the layers that will be included in the legend. If `legendLayers` is not specified, all operational layers (non-tiled layers) will be present in the legend. To specify that no layers will be included in the legend set `legendLayer = []`. + * An array of [LegendLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html) containing the id's of the layers that will be included in the legend. If `legendLayers` is not specified, all operational layers (non-tiled layers) except [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) 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) */ @@ -36288,6 +39359,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) */ returnM: boolean; + /** + * If `true`, the [query geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#queryGeometry) will be returned with the query results. It is useful for getting the buffer geometry generated when querying features by [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) or getting the query geometry projected in the [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) of the query. The query geometry is returned only for [client-side queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) and [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) and if the layer's [capabilities.query.supportsQueryGeometry](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-tasks-support-Query.html#returnQueryGeometry) + * + * @default false + */ + returnQueryGeometry: 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. * @@ -36295,20 +39374,12 @@ declare namespace __esri { */ 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). The spatial relationships discover how features are spatially related to each other. For example, you may want to know if a polygon representing a county completely contains points representing settlements. The spatial relationship is determined by whether the boundaries or interiors of a geometry intersect. + * * Boundary — The endpoints of all linear parts for line features, or the linear outline of a polygon. Only lines and polygons have boundaries. + * * Interior — Points are entirely interior and have no boundary. For lines and polygons, the interior is any part of the geometry that is not part of the boundary. * - * 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). - * contains | Returns features from the layer or layer view that are completely contained by the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). - * crosses | Returns features from the layer or layer view that cross the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). - * envelope-intersects | Returns features from the layer or layer view that intersect the envelope (or extent) of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). - * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. - * overlaps | Returns features from the layer or layer view that overlap the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). - * 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. * + * The possible values for this parameter are described below and the images highlight the geometries returned for the specified spatial relationship for given geometries. The `intersects` spatial relationship returns features in the layer view that intersect the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). ![intersects](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/intersects.png) The `contains` spatial relationship returns features in the layer view that are completely contained by the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). ![contains](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/contains.png) The `crosses` spatial relationship returns features in the layer view when the interior of a query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) comes into contact with the interior or boundary of features in the layer view. In other words, the geometries share some interior area, but not all interior area. ![crosses](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/crosses.png) The `envelope-intersects` spatial relationship returns features in the layer view that intersect the envelope (or extent) of the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). ![envelope-intersects](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/envelope-intersects.png) The `overlaps` spatial relationship returns features in the layer view that overlap the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). Only features of the same geometry can be compared. ![overlaps](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/overlap.png) The `touches` spatial relationship returns features in the layer view that touch the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). The boundaries of the geometries intersect, but not their interiors. ![touches](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/touches.png) The `within` spatial relationship returns features in the layer view that completely contain the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). In other words, the filter geometry is completely `within` the features in the layer view. It is opposite of `contains`. ![within](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/within.png) The `disjoint` spatial relationship returns features in the layer view that do not intersect the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) in anyway. Opposite of `intersects`. ![disjoint](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/disjoint.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) * @@ -36340,11 +39411,17 @@ declare namespace __esri { */ 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). - * > **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 + * A time extent for a temporal query against [time-aware layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#timeInfo). For example, it can be used to discover all crimes that occurred during the night shift from 10 PM to 6 AM on a particular date. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#timeExtent) + */ + timeExtent: TimeExtent; + /** + * 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 `units` is not specified, the unit is derived from the geometry spatial reference. If the geometry spatial reference is not specified, the unit is derived from the feature service data spatial reference. For service-based queries, this parameter only applies if the layer's [capabilities.query.supportsDistance](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) 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) + * + * @default null */ units: string; /** @@ -36568,6 +39645,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) */ returnM?: boolean; + /** + * If `true`, the [query geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#queryGeometry) will be returned with the query results. It is useful for getting the buffer geometry generated when querying features by [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) or getting the query geometry projected in the [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) of the query. The query geometry is returned only for [client-side queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) and [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) and if the layer's [capabilities.query.supportsQueryGeometry](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-tasks-support-Query.html#returnQueryGeometry) + * + * @default false + */ + returnQueryGeometry?: 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. * @@ -36575,20 +39660,12 @@ declare namespace __esri { */ 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). The spatial relationships discover how features are spatially related to each other. For example, you may want to know if a polygon representing a county completely contains points representing settlements. The spatial relationship is determined by whether the boundaries or interiors of a geometry intersect. + * * Boundary — The endpoints of all linear parts for line features, or the linear outline of a polygon. Only lines and polygons have boundaries. + * * Interior — Points are entirely interior and have no boundary. For lines and polygons, the interior is any part of the geometry that is not part of the boundary. * - * 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). - * contains | Returns features from the layer or layer view that are completely contained by the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). - * crosses | Returns features from the layer or layer view that cross the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). - * envelope-intersects | Returns features from the layer or layer view that intersect the envelope (or extent) of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). - * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. - * overlaps | Returns features from the layer or layer view that overlap the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). - * 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. * + * The possible values for this parameter are described below and the images highlight the geometries returned for the specified spatial relationship for given geometries. The `intersects` spatial relationship returns features in the layer view that intersect the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). ![intersects](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/intersects.png) The `contains` spatial relationship returns features in the layer view that are completely contained by the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). ![contains](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/contains.png) The `crosses` spatial relationship returns features in the layer view when the interior of a query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) comes into contact with the interior or boundary of features in the layer view. In other words, the geometries share some interior area, but not all interior area. ![crosses](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/crosses.png) The `envelope-intersects` spatial relationship returns features in the layer view that intersect the envelope (or extent) of the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). ![envelope-intersects](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/envelope-intersects.png) The `overlaps` spatial relationship returns features in the layer view that overlap the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). Only features of the same geometry can be compared. ![overlaps](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/overlap.png) The `touches` spatial relationship returns features in the layer view that touch the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). The boundaries of the geometries intersect, but not their interiors. ![touches](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/touches.png) The `within` spatial relationship returns features in the layer view that completely contain the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). In other words, the filter geometry is completely `within` the features in the layer view. It is opposite of `contains`. ![within](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/within.png) The `disjoint` spatial relationship returns features in the layer view that do not intersect the query [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) in anyway. Opposite of `intersects`. ![disjoint](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/disjoint.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) * @@ -36620,11 +39697,17 @@ declare namespace __esri { */ 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). - * > **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 + * A time extent for a temporal query against [time-aware layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#timeInfo). For example, it can be used to discover all crimes that occurred during the night shift from 10 PM to 6 AM on a particular date. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#timeExtent) + */ + timeExtent?: TimeExtentProperties; + /** + * 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 `units` is not specified, the unit is derived from the geometry spatial reference. If the geometry spatial reference is not specified, the unit is derived from the feature service data spatial reference. For service-based queries, this parameter only applies if the layer's [capabilities.query.supportsDistance](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) 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) + * + * @default null */ units?: string; /** @@ -36760,7 +39843,7 @@ declare namespace __esri { */ 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 `relationParameter` parameter describes the spatial relationship and must be specified. * * Value | Description * ------|------------ @@ -36818,7 +39901,7 @@ declare namespace __esri { */ 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 `relationParameter` parameter describes the spatial relationship and must be specified. * * Value | Description * ------|------------ @@ -36848,12 +39931,6 @@ 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. * @@ -36910,6 +39987,12 @@ declare namespace __esri { * @default false */ returnGeometry: boolean; + /** + * 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#where) + */ + where: string; /** * Creates a deep clone of RelationshipQuery object. @@ -36930,12 +40013,6 @@ declare namespace __esri { export const RelationshipQuery: RelationshipQueryConstructor; 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. * @@ -36992,9 +40069,15 @@ declare namespace __esri { * @default false */ returnGeometry?: boolean; + /** + * 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#where) + */ + where?: string; } - interface RouteParameters extends Accessor { + interface RouteParameters extends Accessor, JSONSupport { /** * 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). * @@ -37006,7 +40089,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) */ - attributeParameterValues: AttributeParamValue; + 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. * @@ -37024,15 +40107,25 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) */ - directionsLengthUnits: string; + directionsLengthUnits: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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; + directionsOutputType: "complete" | "complete-no-events" | "instructions-only" | "standard" | "summary-only"; /** * 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. * @@ -37049,8 +40142,6 @@ declare namespace __esri { * 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; /** @@ -37090,21 +40181,45 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) */ - outputGeometryPrecisionUnits: string; + outputGeometryPrecisionUnits: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** - * 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 + * 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 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-RouteParameters.html#outputLines) - * - * @default true-shape */ - outputLines: string; + outputLines: "none" | "straight" | "true-shape" | "true-shape-with-measure"; /** * 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; + outSpatialReference: SpatialReference | string; + /** + * 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#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. * @@ -37140,7 +40255,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) */ - restrictUTurns: string; + restrictUTurns: "allow-backtrack" | "at-dead-ends-only" | "no-backtrack" | "at-dead-ends-and-intersections"; /** * If `true`, barriers are returned with the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). * @@ -37150,7 +40265,7 @@ declare namespace __esri { */ 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). + * Indicates whether the service should generate driving directions for each route. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnDirections) * @@ -37177,24 +40292,18 @@ declare namespace __esri { * 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; /** @@ -37220,32 +40329,29 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#travelMode) */ - travelMode: any; + travelMode: string; /** * 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) + * + * @default false */ 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) + * + * @default false */ 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; + + fromJSON(json: any): RouteParameters; } export const RouteParameters: RouteParametersConstructor; @@ -37262,7 +40368,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) */ - attributeParameterValues?: AttributeParamValue; + 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. * @@ -37280,15 +40386,25 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) */ - directionsLengthUnits?: string; + directionsLengthUnits?: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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; + directionsOutputType?: "complete" | "complete-no-events" | "instructions-only" | "standard" | "summary-only"; /** * 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. * @@ -37305,8 +40421,6 @@ declare namespace __esri { * 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; /** @@ -37346,21 +40460,45 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) */ - outputGeometryPrecisionUnits?: string; + outputGeometryPrecisionUnits?: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** - * 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 + * 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 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-RouteParameters.html#outputLines) - * - * @default true-shape */ - outputLines?: string; + outputLines?: "none" | "straight" | "true-shape" | "true-shape-with-measure"; /** * 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; + outSpatialReference?: SpatialReferenceProperties | string; + /** + * 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#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. * @@ -37396,7 +40534,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) */ - restrictUTurns?: string; + restrictUTurns?: "allow-backtrack" | "at-dead-ends-only" | "no-backtrack" | "at-dead-ends-and-intersections"; /** * If `true`, barriers are returned with the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). * @@ -37406,7 +40544,7 @@ declare namespace __esri { */ 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). + * Indicates whether the service should generate driving directions for each route. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnDirections) * @@ -37433,24 +40571,18 @@ declare namespace __esri { * 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; /** @@ -37476,17 +40608,21 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#travelMode) */ - travelMode?: any; + travelMode?: string; /** * 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) + * + * @default false */ 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) + * + * @default false */ useTimeWindows?: boolean; } @@ -37579,7 +40715,7 @@ declare namespace __esri { stops?: GraphicProperties[]; } - interface ServiceAreaParameters extends Accessor { + interface ServiceAreaParameters extends Accessor, JSONSupport { /** * 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`. * @@ -37602,8 +40738,6 @@ declare namespace __esri { * 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; /** @@ -37643,7 +40777,19 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) */ - outputGeometryPrecisionUnits: string; + outputGeometryPrecisionUnits: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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). * @@ -37657,13 +40803,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines) */ - outputLines: string; + outputLines: "none" | "straight" | "true-shape" | "true-shape-with-measure"; /** * 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; + outputPolygons: "none" | "simplified" | "detailed"; /** * 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. * @@ -37723,7 +40869,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictUTurns) */ - restrictUTurns: string; + restrictUTurns: "allow-backtrack" | "at-dead-ends-only" | "no-backtrack" | "at-dead-ends-and-intersections"; /** * If `true`, facilities will be returned with the analysis results. * @@ -37789,13 +40935,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelDirection) */ - travelDirection: string; + travelDirection: "from-facility" | "to-facility"; /** * 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; + travelMode: string; /** * 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). * @@ -37815,22 +40961,25 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistanceUnits) */ - trimPolygonDistanceUnits: string; + trimPolygonDistanceUnits: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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; } interface ServiceAreaParametersConstructor { @@ -37841,6 +40990,8 @@ declare namespace __esri { */ new (properties?: ServiceAreaParametersProperties): ServiceAreaParameters; + + fromJSON(json: any): ServiceAreaParameters; } export const ServiceAreaParameters: ServiceAreaParametersConstructor; @@ -37868,8 +41019,6 @@ declare namespace __esri { * 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; /** @@ -37909,7 +41058,19 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) */ - outputGeometryPrecisionUnits?: string; + outputGeometryPrecisionUnits?: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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). * @@ -37923,13 +41084,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines) */ - outputLines?: string; + outputLines?: "none" | "straight" | "true-shape" | "true-shape-with-measure"; /** * 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; + outputPolygons?: "none" | "simplified" | "detailed"; /** * 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. * @@ -37989,7 +41150,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictUTurns) */ - restrictUTurns?: string; + restrictUTurns?: "allow-backtrack" | "at-dead-ends-only" | "no-backtrack" | "at-dead-ends-and-intersections"; /** * If `true`, facilities will be returned with the analysis results. * @@ -38055,13 +41216,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelDirection) */ - travelDirection?: string; + travelDirection?: "from-facility" | "to-facility"; /** * 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; + travelMode?: string; /** * 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). * @@ -38081,7 +41242,19 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistanceUnits) */ - trimPolygonDistanceUnits?: string; + trimPolygonDistanceUnits?: + | "centimeters" + | "decimal-degrees" + | "decimeters" + | "feet" + | "inches" + | "kilometers" + | "meters" + | "miles" + | "millimeters" + | "nautical-miles" + | "points" + | "yards"; /** * 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. * @@ -43129,6 +46302,67 @@ declare namespace __esri { user: string; } + interface TimeExtent extends JSONSupport { + /** + * The end time of the time extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#end) + * + * @default null + */ + end: Date; + /** + * The start time of the time extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#start) + * + * @default null + */ + start: Date; + + /** + * Creates a deep clone of TimeExtent object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#clone) + * + * + */ + clone(): TimeExtent; + } + + interface TimeExtentConstructor { + /** + * A period of time with definitive [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#start) and [end](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#end) dates. The time extent is used to [display](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter) or [query](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) features that fall within the specified time period. To represent a single point in time set the [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#start) and [end](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#end) times to the same time value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html) + */ + + new (properties?: TimeExtentProperties): TimeExtent; + + fromJSON(json: any): TimeExtent; + } + + export const TimeExtent: TimeExtentConstructor; + + interface TimeExtentProperties { + /** + * The end time of the time extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#end) + * + * @default null + */ + end?: DateProperties; + /** + * The start time of the time extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html#start) + * + * @default null + */ + start?: DateProperties; + } + interface Viewpoint extends Accessor, JSONSupport { /** * The viewpoint camera (3D only). @@ -43208,404 +46442,7 @@ declare namespace __esri { targetGeometry?: GeometryProperties; } - 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 - * - * Geometry type | Draw action instance - * ------------- | -------------------- - * point | [PointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html) - * multipoint | [MultipointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html) - * polyline | [PolylineDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html) - * 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:** - * - * 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; - } - - 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; - } - - export const Draw: DrawConstructor; - - 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:** - * - * 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; - } - - 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; - } - - 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; - } - - export const DrawAction: DrawActionConstructor; - - 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; - } - - 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; - } - - export const MultipointDrawAction: MultipointDrawActionConstructor; - - 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; - } - - export const PointDrawAction: PointDrawActionConstructor; - - 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:** - * - * 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; - } - - 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:** - * - * 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; - } - - 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:** - * - * 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; - } - - 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:** - * - * 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; - } - - 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:** - * - * 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; - } - - 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:** - * - * 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; - } - - /** - * 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; + interface BaseLayerView2D extends LayerView { /** * 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. * @@ -43677,7 +46514,32 @@ declare namespace __esri { tilesChanged(added: Tile[], removed: Tile[]): void; } - export const BaseLayerView2D: BaseLayerView2D; + interface BaseLayerView2DConstructor { + /** + * 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) + */ + + new (properties?: BaseLayerView2DProperties): BaseLayerView2D; + } + + export const BaseLayerView2D: BaseLayerView2DConstructor; + + interface BaseLayerView2DProperties extends LayerViewProperties { + /** + * 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?: MapViewProperties; + } export interface BaseLayerView2DRenderRenderParameters extends Object { /** @@ -43762,6 +46624,200 @@ declare namespace __esri { bounds: number[]; } + interface BaseLayerViewGL2D extends LayerView { + /** + * The WebGL rendering context associated to this layer view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#context) + */ + context: WebGLRenderingContext | any; + /** + * The array of [Tile](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.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-BaseLayerViewGL2D.html#tilesChanged) is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#tiles) + */ + tiles: BaseLayerViewGL2DTile[]; + /** + * 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-BaseLayerViewGL2D.html#view) + */ + view: MapView; + + /** + * Method called after the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) is created and right before it starts drawing the layer's content. Typically this method is implemented to start watching property changes on the layer and to initialize WebGL objects such as shaders. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.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 and destroy WebGL objects such as shader programs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.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-BaseLayerViewGL2D.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-BaseLayerViewGL2D.html#requestRender) has been called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#render) + * + * @param renderParameters + * @param renderParameters.context The WebGL or WebGL 2 context. Its concrete type depends on system configuration. The initial state is guaranteed to be the default one. + * @param renderParameters.stationary The stationary state of the `MapView`. + * @param renderParameters.state The object that describes view state. + * + */ + render(renderParameters: BaseLayerViewGL2DRenderRenderParameters): 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-BaseLayerViewGL2D.html#requestRender) + * + * + */ + 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-BaseLayerViewGL2D.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: BaseLayerViewGL2DTile[], removed: BaseLayerViewGL2DTile[]): void; + } + + interface BaseLayerViewGL2DConstructor { + /** + * 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). In contrast to the related class [BaseLayerView2D](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html), this one exposes [WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) rendering capabilities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html) + */ + + new (properties?: BaseLayerViewGL2DProperties): BaseLayerViewGL2D; + } + + export const BaseLayerViewGL2D: BaseLayerViewGL2DConstructor; + + interface BaseLayerViewGL2DProperties extends LayerViewProperties { + /** + * The WebGL rendering context associated to this layer view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#context) + */ + context?: WebGLRenderingContext | any; + /** + * The array of [Tile](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.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-BaseLayerViewGL2D.html#tilesChanged) is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#tiles) + */ + tiles?: BaseLayerViewGL2DTile[]; + /** + * 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-BaseLayerViewGL2D.html#view) + */ + view?: MapViewProperties; + } + + export interface BaseLayerViewGL2DRenderRenderParameters extends Object { + /** + * The WebGL or WebGL 2 context. Its concrete type depends on system configuration. The initial state is guaranteed to be the default one. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#render) + */ + context: WebGLRenderingContext | any; + /** + * The stationary state of the `MapView`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#render) + */ + stationary: boolean; + /** + * The object that describes view state. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#render) + */ + state: ViewState; + } + + /** + * Represents a tile reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#Tile) + */ + export interface BaseLayerViewGL2DTile 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-BaseLayerViewGL2D.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-BaseLayerViewGL2D.html#Tile) + */ + level: number; + /** + * The row identifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.html#Tile) + */ + row: number; + /** + * The column identifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerViewGL2D.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-BaseLayerViewGL2D.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-BaseLayerViewGL2D.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-BaseLayerViewGL2D.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-BaseLayerViewGL2D.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-BaseLayerViewGL2D.html#Tile) + */ + bounds: number[]; + } + interface ViewState { /** * Represents the view's center point as an array of two numbers `[x, y]`. @@ -44138,7 +47194,7 @@ declare namespace __esri { bindRenderTarget(): void; } - export type RenderContextCallback = (context: RenderContext) => void; + export type RenderContextCallback = (context?: RenderContext) => void; /** * 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). @@ -44402,6 +47458,398 @@ declare namespace __esri { ui?: DefaultUIProperties; } + interface Draw extends Accessor { + /** + * A reference to the active [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html). An instance of the draw action is created when [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-Draw.html#create) method is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-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-draw-Draw.html#view) + */ + view: MapView; + + /** + * Complete the current active drawing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-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-draw-Draw.html#create) + * + * @param drawAction + * Name of the [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-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-draw-PointDrawAction.html) + * multipoint | [MultipointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-MultipointDrawAction.html) (only supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)) + * polyline | [PolylineDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-PolylineDrawAction.html) + * polygon | [PolygonDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-PolygonDrawAction.html) + * rectangle, circle, ellipse | [SegmentDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-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:** + * + * 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-draw-Draw.html#reset) + * + * + */ + reset(): void; + } + + 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-draw-Draw.html) + */ + + new (properties?: DrawProperties): Draw; + } + + export const Draw: DrawConstructor; + + interface DrawProperties { + /** + * A reference to the active [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html). An instance of the draw action is created when [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-Draw.html#create) method is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-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-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:** + * + * 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-draw-Draw.html#create) + */ + mode?: string; + } + + 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-draw-DrawAction.html#view) + */ + view: MapView; + + /** + * Indicates if the [redo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html#redo) method can be called on the action instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html#canRedo) + * + * + */ + canRedo(): boolean; + /** + * Indicates if the [undo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html#undo) method can be called on the action instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-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-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-draw-DrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html#event:vertex-remove) events depending on the last action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-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-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-draw-DrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html#event:vertex-remove) events depending on the last action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-DrawAction.html#undo) + * + * + */ + undo(): void; + } + + 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-draw-DrawAction.html) + */ + + new (properties?: DrawActionProperties): DrawAction; + } + + export const DrawAction: DrawActionConstructor; + + 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-draw-DrawAction.html#view) + */ + view?: MapViewProperties; + } + + 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-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-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-draw-MultipointDrawAction.html#complete) + * + * + */ + complete(): void; + } + + interface MultipointDrawActionConstructor { + /** + * This class uses the view events to generate a set of coordinates to create a new [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometry using [Draw](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-Draw.html). When the [draw.create("multipoint")](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-Draw.html#create) method is called, a reference to MultipointDrawAction is returned. You can listen to [events](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-MultipointDrawAction.html#events-summary) on the MultipointDrawAction instance, which allows users to create a multipoint that meets criteria specified by the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-MultipointDrawAction.html) + */ + + new (properties?: MultipointDrawActionProperties): MultipointDrawAction; + } + + export const MultipointDrawAction: MultipointDrawActionConstructor; + + 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-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-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-draw-PointDrawAction.html#complete) + * + * + */ + complete(): void; + } + + interface PointDrawActionConstructor { + new (properties?: PointDrawActionProperties): PointDrawAction; + } + + export const PointDrawAction: PointDrawActionConstructor; + + 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:** + * + * 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-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-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-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-draw-PolygonDrawAction.html#complete) + * + * + */ + complete(): void; + } + + interface PolygonDrawActionConstructor { + 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:** + * + * 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-draw-PolygonDrawAction.html#mode) + * + * @default hybrid + */ + mode?: string; + } + + 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:** + * + * 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-draw-PolylineDrawAction.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-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-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-draw-PolylineDrawAction.html#complete) + * + * + */ + complete(): void; + } + + interface PolylineDrawActionConstructor { + 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:** + * + * 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-draw-PolylineDrawAction.html#mode) + * + * @default hybrid + */ + mode?: string; + } + + 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:** + * + * 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-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-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-draw-SegmentDrawAction.html#event:draw-complete) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-SegmentDrawAction.html#complete) + * + * + */ + complete(): void; + } + + interface SegmentDrawActionConstructor { + 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:** + * + * 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-draw-SegmentDrawAction.html#mode) + * + * @default freehand + */ + mode?: string; + } + 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. @@ -44522,6 +47970,18 @@ declare namespace __esri { interface InputProperties {} interface CSVLayerView extends LayerView { + /** + * The effect applied to the layer view. The effect allows for the selection of features via a [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter), and an [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) and [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) are applied to those features that respectively pass or fail the filter requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#effect) + */ + effect: FeatureEffect; + /** + * The [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#where), [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry), and [time extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#timeExtent) filter. Only the features that satisfy the filter are displayed on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#filter) + */ + filter: FeatureFilter; /** * 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. * @@ -44543,7 +48003,7 @@ declare namespace __esri { * @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; + highlight(target?: Graphic | Graphic[] | number | number[]): Handle; /** * 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** @@ -44614,13 +48074,19 @@ declare namespace __esri { queryObjectIds(params?: Query | QueryProperties): IPromise; } - interface CSVLayerViewConstructor { - new (properties?: CSVLayerViewProperties): CSVLayerView; - } - - export const CSVLayerView: CSVLayerViewConstructor; - interface CSVLayerViewProperties extends LayerViewProperties { + /** + * The effect applied to the layer view. The effect allows for the selection of features via a [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter), and an [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) and [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) are applied to those features that respectively pass or fail the filter requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#effect) + */ + effect?: FeatureEffectProperties; + /** + * The [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#where), [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry), and [time extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#timeExtent) filter. Only the features that satisfy the filter are displayed on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#filter) + */ + filter?: FeatureFilterProperties; /** * 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. * @@ -44636,6 +48102,25 @@ declare namespace __esri { } interface FeatureLayerView extends LayerView { + /** + * A list of attribute fields fetched for each feature including fields required for layer [rendering](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), [labeling](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo), [elevation info](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo), and additional fields defined on the [FeatureLayer.outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields). The availableFields is populated when the layer view is finished [updating](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#updating). Use this list when setting [client-side filtering](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter) or querying features on the [client-side](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields) + */ + readonly availableFields: string[]; + /** + * The effect applied to the layer view. The effect allows for the selection of features via a [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter), and an [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) and [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) are applied to those features that respectively pass or fail the filter requirements. + * > **Known Limitations** FeatureEffect is 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-views-layers-FeatureLayerView.html#effect) + */ + effect: FeatureEffect; + /** + * The [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#where), [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry), and [time extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#timeExtent) filter. Only the features that satisfy the filter are displayed on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter) + */ + filter: FeatureFilter; /** * The layer being viewed. * @@ -44663,11 +48148,11 @@ declare namespace __esri { * @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; + highlight(target?: Graphic | Graphic[] | number | number[]): Handle; /** * 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). + * * In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only queries with [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) or [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) with an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `intersects` are supported. * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): @@ -44685,7 +48170,7 @@ declare namespace __esri { /** * 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). + * * In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only queries with [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) or [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) with an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `intersects` are supported. * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): @@ -44701,9 +48186,9 @@ declare namespace __esri { */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. To execute a query against all the features in a Feature Service rather than only those in the client, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. + * 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 along with their attributes specified in [availableFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields). For client-side attribute queries, relevant fields must exist in [availableFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields) list for the query to be successful. 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). + * * In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only queries with [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) or [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) with an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `intersects` are supported. * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): @@ -44714,14 +48199,14 @@ declare namespace __esri { * * [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. + * @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 along with their attributes specified in [availableFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#availableFields). 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** - * * 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). + * * In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only queries with [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) or [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) with an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `intersects` are supported. * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): @@ -44751,6 +48236,19 @@ declare namespace __esri { export const FeatureLayerView: FeatureLayerViewConstructor; interface FeatureLayerViewProperties extends LayerViewProperties { + /** + * The effect applied to the layer view. The effect allows for the selection of features via a [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter), and an [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) and [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) are applied to those features that respectively pass or fail the filter requirements. + * > **Known Limitations** FeatureEffect is 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-views-layers-FeatureLayerView.html#effect) + */ + effect?: FeatureEffectProperties; + /** + * The [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#where), [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry), and [time extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#timeExtent) filter. Only the features that satisfy the filter are displayed on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter) + */ + filter?: FeatureFilterProperties; /** * 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. * @@ -44765,6 +48263,153 @@ declare namespace __esri { maximumNumberOfFeaturesExceeded?: boolean; } + interface GeoJSONLayerView extends LayerView { + /** + * The effect applied to the layer view. The effect allows for the selection of features via a [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter), and an [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) and [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) are applied to those features that respectively pass or fail the filter requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#effect) + */ + effect: FeatureEffect; + /** + * The [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#where), [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry), and [time extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#timeExtent) filter. Only the features that satisfy the filter are displayed on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#filter) + */ + filter: FeatureFilter; + /** + * 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-GeoJSONLayerView.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-GeoJSONLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded: boolean; + + /** + * Highlights the given feature(s). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.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[]): Handle; + /** + * 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): + * * 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-views-layers-GeoJSONLayerView.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** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * 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-GeoJSONLayerView.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** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * 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-GeoJSONLayerView.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** + * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * 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-GeoJSONLayerView.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 GeoJSONLayerViewProperties extends LayerViewProperties { + /** + * The effect applied to the layer view. The effect allows for the selection of features via a [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter), and an [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) and [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) are applied to those features that respectively pass or fail the filter requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#effect) + */ + effect?: FeatureEffectProperties; + /** + * The [attribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#where), [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry), and [time extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#timeExtent) filter. Only the features that satisfy the filter are displayed on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#filter) + */ + filter?: FeatureFilterProperties; + /** + * 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-GeoJSONLayerView.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-GeoJSONLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded?: boolean; + } + + interface GeoRSSLayerView extends LayerView { + /** + * 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-GeoRSSLayerView.html#highlight) + * + * @param target The feature(s) to highlight. + * + */ + highlight(target?: Graphic | Graphic[]): Handle; + } + + interface GeoRSSLayerViewProperties extends LayerViewProperties {} + interface GraphicsLayerView extends LayerView { /** * Highlights the given feature(s). @@ -44775,7 +48420,7 @@ declare namespace __esri { * @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; + highlight(target?: Graphic | Graphic[] | number | number[]): Handle; /** * 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). * @@ -44786,18 +48431,6 @@ declare namespace __esri { 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; - } - - export const GraphicsLayerView: GraphicsLayerViewConstructor; - interface GraphicsLayerViewProperties extends LayerViewProperties {} interface ImageryLayerView extends LayerView { @@ -44872,12 +48505,6 @@ declare namespace __esri { readonly allVisiblePolylines: Collection; } - interface KMLLayerViewConstructor { - new (properties?: KMLLayerViewProperties): KMLLayerView; - } - - export const KMLLayerView: KMLLayerViewConstructor; - interface KMLLayerViewProperties extends LayerViewProperties {} /** @@ -44961,6 +48588,25 @@ declare namespace __esri { } interface SceneLayerView extends LayerView { + /** + * Applies a client-side [FeatureFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html) to the displayed data. For 3D object scene layers, only spatial filters are supported, that is, a filter where the geometry is set and spatialRelationship is one of `contains`, `intersects`, `disjoint`. For point scene layers, the full FeatureFilter functionality is supported. Only the features that satisfy the filter are displayed. Filters with unsupported fields are rejected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#filter) + */ + filter: FeatureFilter; + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to point scene layers. 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-SceneLayerView.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 point scene layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded: boolean; + /** * Highlights the given feature(s). * @@ -44969,10 +48615,11 @@ declare namespace __esri { * @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; + highlight(target?: Graphic | Graphic[] | number | number[]): Handle; /** * 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. + * > **Known Limitations** For [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only empty queries and queries with [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) or [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num)/[start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) are supported. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryExtent) * @@ -44983,6 +48630,7 @@ declare namespace __esri { /** * 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. + * > **Known Limitations** For [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only empty queries and queries with [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) or [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num)/[start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) are supported. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryFeatureCount) * @@ -44993,6 +48641,7 @@ declare namespace __esri { /** * 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. + * > **Known Limitations** For [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only empty queries and queries with [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) or [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num)/[start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) are supported. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryFeatures) * @@ -45003,6 +48652,7 @@ declare namespace __esri { /** * 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. + * > **Known Limitations** For [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only empty queries and queries with [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) or [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num)/[start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) are supported. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryObjectIds) * @@ -45012,20 +48662,27 @@ declare namespace __esri { queryObjectIds(params?: Query): IPromise; } - interface SceneLayerViewConstructor { + interface SceneLayerViewProperties extends LayerViewProperties { /** - * 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). + * Applies a client-side [FeatureFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html) to the displayed data. For 3D object scene layers, only spatial filters are supported, that is, a filter where the geometry is set and spatialRelationship is one of `contains`, `intersects`, `disjoint`. For point scene layers, the full FeatureFilter functionality is supported. Only the features that satisfy the filter are displayed. Filters with unsupported fields are rejected. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#filter) */ - - new (properties?: SceneLayerViewProperties): SceneLayerView; + filter?: FeatureFilterProperties; + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to point scene layers. 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-SceneLayerView.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 point scene layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded?: boolean; } - export const SceneLayerView: SceneLayerViewConstructor; - - 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. @@ -45040,20 +48697,20 @@ declare namespace __esri { */ 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. + * The geometry and attribute filter. Only the features that satisfy the filter are displayed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) */ - readonly filter: StreamLayerViewFilter; + readonly filter: FeatureFilter; /** - * 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). + * 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). **This property is deprecated. Use [queryFeatures](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#queryFeatures) method instead.** * * [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. + * 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. **The layer will now automatically connect when it is added to a view.** * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connect) * @@ -45061,7 +48718,7 @@ declare namespace __esri { */ connect(): IPromise; /** - * Closes the web socket connection with the stream service. This is called internally when the StreamLayer is removed from a view. To verify when the connection is closed, watch the [connectionStatus](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionStatus) property. + * Closes the web socket connection with the stream service. This is called internally when the StreamLayer is removed from a view. To verify when the connection is closed, watch the [connectionStatus](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionStatus) property. **The layer will now automatically disconnect when it is removed a view.** * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#disconnect) * @@ -45069,7 +48726,7 @@ declare namespace __esri { */ disconnect(): void; /** - * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) on the StreamLayerView. The filter is updated only on the layer view from which it is called. To update the filter on all layer views generated from a common layer, use the [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. If the input `filter` object is `undefined` or `null`, the spatial and attribute filters are removed. Filter changes only apply to incoming features. Features already displayed in the view will be removed automatically. + * **This method is deprecated. Update [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) directly instead.** 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) * @@ -45097,7 +48754,7 @@ 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). + * 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). **This property is deprecated. Use [queryFeatures](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#queryFeatures) method instead.** * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics) */ @@ -45106,21 +48763,6 @@ declare namespace __esri { 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. @@ -45136,7 +48778,243 @@ declare namespace __esri { where?: string; } - interface MapView extends View, BreakpointsOwner { + interface FeatureEffect extends Accessor, JSONSupport { + /** + * The graphical [css filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) operation applied to the features that do not meet the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter) requirements. Currently, [grayscale](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/grayscale), [sepia](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/sepia), [hue-rotate](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/hue-rotate), [invert](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/invert), [opacity](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/opacity), [brightness](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/brightness) and [contrast](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/contrast) css filter functions are supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) + */ + excludedEffect: string; + /** + * Indicates if labels for features that are [excluded](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) from the effect are visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedLabelsVisible) + * + * @default false + */ + excludedLabelsVisible: boolean; + /** + * The filter that drives the effect. Features that meet the requirements specified in the filter will have the [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) applied while features that do not meet meet the filter requirements will have the [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) applied. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter) + */ + filter: FeatureFilter; + /** + * The graphical [css filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) operation applied to the features that meet the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter) requirements. Currently, [grayscale](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/grayscale), [sepia](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/sepia), [hue-rotate](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/hue-rotate), [invert](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/invert), [opacity](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/opacity), [brightness](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/brightness) and [contrast](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/contrast) css filter functions are supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) + */ + includedEffect: string; + + /** + * Creates a deep clone of FeatureEffect object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#clone) + * + * + */ + clone(): FeatureEffect; + } + + interface FeatureEffectConstructor { + /** + * FeatureEffect allows you to emphasize or deemphasize features that satisfy a [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter) in 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). The [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) and [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) properties allow you to apply [CSS filters](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) to features that are either included or excluded from the filter. Typically, you use `includedEffect` to emphasize features that are included in the filter and `excludedEffect` to deemphasize features excluded from the filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html) + */ + + new (properties?: FeatureEffectProperties): FeatureEffect; + + fromJSON(json: any): FeatureEffect; + } + + export const FeatureEffect: FeatureEffectConstructor; + + interface FeatureEffectProperties { + /** + * The graphical [css filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) operation applied to the features that do not meet the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter) requirements. Currently, [grayscale](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/grayscale), [sepia](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/sepia), [hue-rotate](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/hue-rotate), [invert](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/invert), [opacity](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/opacity), [brightness](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/brightness) and [contrast](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/contrast) css filter functions are supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) + */ + excludedEffect?: string; + /** + * Indicates if labels for features that are [excluded](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) from the effect are visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedLabelsVisible) + * + * @default false + */ + excludedLabelsVisible?: boolean; + /** + * The filter that drives the effect. Features that meet the requirements specified in the filter will have the [includedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) applied while features that do not meet meet the filter requirements will have the [excludedEffect](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#excludedEffect) applied. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter) + */ + filter?: FeatureFilterProperties; + /** + * The graphical [css filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) operation applied to the features that meet the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#filter) requirements. Currently, [grayscale](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/grayscale), [sepia](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/sepia), [hue-rotate](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/hue-rotate), [invert](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/invert), [opacity](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/opacity), [brightness](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/brightness) and [contrast](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/contrast) css filter functions are supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureEffect.html#includedEffect) + */ + includedEffect?: string; + } + + interface FeatureFilter extends Accessor, JSONSupport { + /** + * Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry) in a spatial filter. The [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.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-views-layers-support-FeatureFilter.html#geometry). The filter will use that buffer to display 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-views-layers-support-FeatureFilter.html#spatialRelationship). + * > **Known Limitations** On 3D object scene layers in [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) `distance` is not supported . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#distance) + */ + distance: number; + /** + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#spatialRelationship) will indicate how the geometry should be used to filter 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-views-layers-support-FeatureFilter.html#geometry) + */ + geometry: Geometry; + /** + * An array of objectIds of the features to be filtered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#objectIds) + */ + objectIds: number[]; + /** + * For spatial filters, this parameter defines the spatial relationship to filter features in the layer view against the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). The spatial relationships discover how features are spatially related to each other. For example, you may want to know if a polygon representing a county completely contains points representing settlements. The spatial relationship is determined by whether the boundaries or interiors of a geometry intersect. + * * Boundary — The endpoints of all linear parts for line features, or the linear outline of a polygon. Only lines and polygons have boundaries. + * * Interior — Points are entirely interior and have no boundary. For lines and polygons, the interior is any part of the geometry that is not part of the boundary. + * + * + * The possible values for this parameter are described below and the images highlight the geometries returned for the specified spatial relationship for given geometries. The `intersects` spatial relationship returns features in the layer view that intersect the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). + * > **Known Limitations** The filter of [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) with 3D object scene layers only supports the spatialRelationsship `contains`, `intersects` and `disjoint`. + * ![intersects](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/intersects.png) The `contains` spatial relationship returns features in the layer view that are completely contained by the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). ![contains](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/contains.png) The `crosses` spatial relationship returns features in the layer view when the interior of a filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry) comes into contact with the interior or boundary of features in the layer view. In other words, the geometries share some interior area, but not all interior area. ![crosses](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/crosses.png) The `envelope-intersects` spatial relationship returns features in the layer view that intersect the envelope (or extent) of the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). ![envelope-intersects](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/envelope-intersects.png) The `overlaps` spatial relationship returns features in the layer view that overlap the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). Only features of the same geometry can be compared. ![overlaps](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/overlap.png) The `touches` spatial relationship returns features in the layer view that touch the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). The boundaries of the geometries intersect, but not their interiors. ![touches](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/touches.png) The `within` spatial relationship returns features in the layer view that completely contain the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). In other words, the filter geometry is completely `within` the features in the layer view. It is opposite of `contains`. ![within](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/within.png) The `disjoint` spatial relationship returns features in the layer view that do not intersect the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry) in anyway. Opposite of `intersects`. ![disjoint](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/disjoint.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#spatialRelationship) + * + * @default intersects + */ + spatialRelationship: string; + /** + * A range of time with start and end date. Only the features that fall within this time extent will be displayed. + * > **Known Limitations** On 3D object scene layers in [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) `timeExtent` is not supported . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#timeExtent) + * + * @default null + */ + timeExtent: TimeExtent; + /** + * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#distance) is specified in a spatial filter. If `units` is not specified, the unit is derived from the filter [geometry's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry) spatial reference. **Possible Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#units) + * + * @default null + */ + units: string; + /** + * A where clause for the feature filter. Any legal SQL92 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. The field to be used for `where` clause must be added to [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) list when the layer is initialized. + * > **Known Limitations** On 3D object scene layers in [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) `where` is not supported . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#where) + */ + where: string; + + /** + * Creates a deep clone of FeatureFilter object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#clone) + * + * + */ + clone(): FeatureFilter; + /** + * Internal method. Enables a filter for rendering. A filter that is not enabled will be ignored in 2D rendering. This property is used to defer applying the result of a filter when it is set for the first time until after MT features have had their filterFlags updated + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#enable) + * + * + */ + enable(): void; + } + + interface FeatureFilterConstructor { + /** + * This class defines parameters for setting a client-side filter on a [layer view](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html). Once a FeatureFilter object's properties are defined, it can be used to set the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter) property of the layer view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html) + */ + + new (properties?: FeatureFilterProperties): FeatureFilter; + + fromJSON(json: any): FeatureFilter; + } + + export const FeatureFilter: FeatureFilterConstructor; + + interface FeatureFilterProperties { + /** + * Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry) in a spatial filter. The [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.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-views-layers-support-FeatureFilter.html#geometry). The filter will use that buffer to display 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-views-layers-support-FeatureFilter.html#spatialRelationship). + * > **Known Limitations** On 3D object scene layers in [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) `distance` is not supported . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#distance) + */ + distance?: number; + /** + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#spatialRelationship) will indicate how the geometry should be used to filter 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-views-layers-support-FeatureFilter.html#geometry) + */ + geometry?: GeometryProperties; + /** + * An array of objectIds of the features to be filtered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#objectIds) + */ + objectIds?: number[]; + /** + * For spatial filters, this parameter defines the spatial relationship to filter features in the layer view against the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). The spatial relationships discover how features are spatially related to each other. For example, you may want to know if a polygon representing a county completely contains points representing settlements. The spatial relationship is determined by whether the boundaries or interiors of a geometry intersect. + * * Boundary — The endpoints of all linear parts for line features, or the linear outline of a polygon. Only lines and polygons have boundaries. + * * Interior — Points are entirely interior and have no boundary. For lines and polygons, the interior is any part of the geometry that is not part of the boundary. + * + * + * The possible values for this parameter are described below and the images highlight the geometries returned for the specified spatial relationship for given geometries. The `intersects` spatial relationship returns features in the layer view that intersect the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). + * > **Known Limitations** The filter of [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) with 3D object scene layers only supports the spatialRelationsship `contains`, `intersects` and `disjoint`. + * ![intersects](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/intersects.png) The `contains` spatial relationship returns features in the layer view that are completely contained by the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). ![contains](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/contains.png) The `crosses` spatial relationship returns features in the layer view when the interior of a filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry) comes into contact with the interior or boundary of features in the layer view. In other words, the geometries share some interior area, but not all interior area. ![crosses](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/crosses.png) The `envelope-intersects` spatial relationship returns features in the layer view that intersect the envelope (or extent) of the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). ![envelope-intersects](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/envelope-intersects.png) The `overlaps` spatial relationship returns features in the layer view that overlap the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). Only features of the same geometry can be compared. ![overlaps](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/overlap.png) The `touches` spatial relationship returns features in the layer view that touch the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). The boundaries of the geometries intersect, but not their interiors. ![touches](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/touches.png) The `within` spatial relationship returns features in the layer view that completely contain the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry). In other words, the filter geometry is completely `within` the features in the layer view. It is opposite of `contains`. ![within](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/within.png) The `disjoint` spatial relationship returns features in the layer view that do not intersect the filter [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry) in anyway. Opposite of `intersects`. ![disjoint](https://developers.arcgis.com/javascript/assets/img/apiref/layers/spatialRelationships/disjoint.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#spatialRelationship) + * + * @default intersects + */ + spatialRelationship?: string; + /** + * A range of time with start and end date. Only the features that fall within this time extent will be displayed. + * > **Known Limitations** On 3D object scene layers in [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) `timeExtent` is not supported . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#timeExtent) + * + * @default null + */ + timeExtent?: TimeExtentProperties; + /** + * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#distance) is specified in a spatial filter. If `units` is not specified, the unit is derived from the filter [geometry's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#geometry) spatial reference. **Possible Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#units) + * + * @default null + */ + units?: string; + /** + * A where clause for the feature filter. Any legal SQL92 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. The field to be used for `where` clause must be added to [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) list when the layer is initialized. + * > **Known Limitations** On 3D object scene layers in [SceneLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) `where` is not supported . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-support-FeatureFilter.html#where) + */ + where?: string; + } + + interface MapView extends View, MapViewBase, 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). * @@ -45206,53 +49084,15 @@ declare namespace __esri { * */ focus(): void; - /** - * Sets the view to a given target. The target parameter can be one of the following: - * * `[longitude, latitude]` pair of coordinates - * * [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) (or array of [Geometry[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html)) - * * [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 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. - * @param target.scale The [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) to go to. - * @param target.zoom The [MapView.zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) to go to. - * @param options Animation options. See properties below for object specifications. - * @param options.animate Indicates if the transition to the new view should be animated. 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; - /** - * 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. + * @param screenPoint The screen coordinates (or native mouse event) of the click on the view. * */ - hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; + hitTest(screenPoint: ScreenPoint | MouseEvent): 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. * @@ -45280,26 +49120,23 @@ declare namespace __esri { */ 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. + * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The screen point 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. + * @param screenPoint The location on the screen (or native mouse event) to convert. * */ - toMap(screenPoint: MapViewToMapScreenPoint): Point; + toMap(screenPoint: ScreenPoint | MouseEvent): 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). 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. + * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a screen point. The screen point 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; + toScreen(point: Point): ScreenPoint; on(name: "resize", eventHandler: MapViewResizeEventHandler): IHandle; @@ -45596,6 +49433,8 @@ declare namespace __esri { } export interface MapViewKeyUpEvent { + key: string; + native: any; stopPropagation: Function; @@ -45696,60 +49535,6 @@ declare namespace __esri { 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. @@ -45804,21 +49589,6 @@ declare namespace __esri { 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. @@ -45889,21 +49659,6 @@ declare namespace __esri { 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; @@ -46040,6 +49795,26 @@ declare namespace __esri { width: number; } + /** + * An object representing a point on the screen. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#ScreenPoint) + */ + export interface ScreenPoint extends Object { + /** + * The x coordinate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#ScreenPoint) + */ + x: number; + /** + * The y coordinate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#ScreenPoint) + */ + y: number; + } + /** * Object returned when [takeScreenshot()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) promise resolves: * @@ -46060,6 +49835,97 @@ declare namespace __esri { data: ImageData; } + interface MapViewBase { + /** + * Sets the view to a given target. The target parameter can be one of the following: + * * `[longitude, latitude]` pair of coordinates + * * [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) (or array of [Geometry[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html)) + * * [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-MapViewBase.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-MapViewBase.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-MapViewBase.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-MapViewBase.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-MapViewBase.html#center) to go to. + * @param target.scale The [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#scale) to go to. + * @param target.zoom The [MapView.zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#zoom) to go to. + * @param options Animation options. See properties below for object specifications. + * @param options.animate Indicates if the transition to the new view should be animated. 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 | MapViewBaseGoToTarget, + options?: MapViewBaseGoToOptions + ): IPromise; + } + + interface MapViewBaseConstructor { + new (): MapViewBase; + } + + export const MapViewBase: MapViewBaseConstructor; + + export interface MapViewBaseGoToOptions 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-MapViewBase.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-MapViewBase.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-MapViewBase.html#goTo) + * + * @default ease + */ + easing?: string | Function; + } + + export interface MapViewBaseGoToTarget extends Object { + /** + * The target of the animation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#goTo) + */ + target?: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint; + /** + * The [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#center) to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#goTo) + */ + center?: number[]; + /** + * The [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#scale) to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#goTo) + */ + scale?: number; + /** + * The [MapView.zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#zoom) to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapViewBase.html#goTo) + */ + zoom?: number; + } + export interface MapViewDragEventOrigin extends Object { x: number; @@ -46223,6 +50089,9 @@ declare namespace __esri { * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; * + * // Enable displaying shadows cast by the sun + * view.environment.lighting.directShadowsEnabled = true; + * * // Set a background color * var view = new SceneView({ * container: "view", @@ -46250,6 +50119,12 @@ declare namespace __esri { * @default null */ extent: Extent; + /** + * The view for the ground of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#groundView) + */ + readonly groundView: GroundView; /** * 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. * @@ -46350,24 +50225,20 @@ declare namespace __esri { 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`. + * Returns graphics that intersect the specified screen coordinate. 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), [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html) and [SceneView.graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#graphics). If no options are specified, graphics that are behind the ground surface will not be returned unless the ground surface is semi-transparent. Otherwise, using the [map.ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) in the include and exclude options determines whether the ground surface prevents hit testing graphics that are under it. Starting with version 4.11, if a label intersects the specified screen coordinates then the result of the hitTest will contain the graphic associated with that label. * * [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. + * @param screenPoint The screen coordinates (or native mouse event) of the click on the view. + * @param options Intersection test options. By default the [map.ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) is excluded if its opacity is smaller than one. + * @param options.include A list of layers and graphics to include for intersection testing. All layers and graphics will be included if include is not specified. + * @param options.exclude A list of layers and graphics to include for intersection testing. No layers or graphics will be excluded if exclude is not specified. * */ - hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; + hitTest( + screenPoint: SceneViewScreenPoint | MouseEvent, + options?: SceneViewHitTestOptions + ): 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. * @@ -46380,7 +50251,7 @@ declare namespace __esri { */ 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)). + * 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, 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) * @@ -46398,23 +50269,22 @@ declare namespace __esri { * * [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. + * @param screenPoint The location on the screen (or native mouse event) to convert. + * @param options Intersection test options. By default only the [map.ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) and any [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) are included. + * @param options.include A list of layers and graphics to include for intersection testing. All layers and graphics will be included if include is not specified. + * @param options.exclude A list of layers and graphics to include for intersection testing. No layers or graphics will be excluded if exclude is not specified. * */ - toMap(screenPoint: SceneViewToMapScreenPoint, mapPoint?: Point): Point; + toMap(screenPoint: SceneViewScreenPoint | MouseEvent, options?: SceneViewToMapOptions): 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. * * [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; + toScreen(point: Point): SceneViewScreenPoint; on(name: "resize", eventHandler: SceneViewResizeEventHandler): IHandle; @@ -46550,6 +50420,9 @@ declare namespace __esri { * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; * + * // Enable displaying shadows cast by the sun + * view.environment.lighting.directShadowsEnabled = true; + * * // Set a background color * var view = new SceneView({ * container: "view", @@ -46727,6 +50600,18 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ results: SceneViewHitTestResultResults[]; + /** + * Ground intersection result. The ground hit result will always be returned, even if the ground was excluded from the [hitTest](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ + ground: HitTestResultGround; + /** + * The screen coordinates (or native mouse event) of the click on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ + screenPoint: SceneViewScreenPoint | MouseEvent; } export interface SceneViewHoldEvent { @@ -46769,6 +50654,13 @@ declare namespace __esri { y: number; } + /** + * A layer or graphic to be used in [toMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) and [hitTest](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) filter options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#IntersectItem) + */ + export type IntersectItem = Graphic | Layer | BuildingSublayer; + export interface SceneViewKeyDownEvent { key: string; @@ -46784,6 +50676,8 @@ declare namespace __esri { } export interface SceneViewKeyUpEvent { + key: string; + native: any; stopPropagation: Function; @@ -47238,7 +51132,7 @@ declare namespace __esri { */ 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. + * 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. For more control on which 3D objects cast shadows use the `castShadows` property available on [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#castShadows), [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#castShadows), [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#castShadows), and [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#castShadows). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) * @@ -47273,7 +51167,7 @@ declare namespace __esri { */ 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. + * 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. For more control on which 3D objects cast shadows use the `castShadows` property available on [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#castShadows), [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#castShadows), [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#castShadows), and [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#castShadows). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) * @@ -47436,19 +51330,25 @@ declare namespace __esri { fillOpacity?: number; } - export interface SceneViewHitTestScreenPoint extends Object { + export interface SceneViewHitTestOptions extends Object { /** - * The horizontal screen coordinate of the click on the view. + * A list of layers and graphics to include for intersection testing. All layers and graphics will be included if include is not specified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) */ - x: number; + include?: + | (IntersectItem | Collection | IntersectItem[] | Ground)[] + | Collection + | IntersectItem; /** - * The vertical screen coordinate of the click on the view. + * A list of layers and graphics to include for intersection testing. No layers or graphics will be excluded if exclude is not specified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) */ - y: number; + exclude?: + | (IntersectItem | Collection | IntersectItem[] | Ground)[] + | Collection + | IntersectItem; } export interface SceneViewTakeScreenshotOptions extends Object { @@ -47515,18 +51415,44 @@ declare namespace __esri { height?: number; } - export interface SceneViewToMapScreenPoint extends Object { + export interface SceneViewToMapOptions extends Object { /** - * The horizontal screen coordinate to convert. + * A list of layers and graphics to include for intersection testing. All layers and graphics will be included if include is not specified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) */ - x: number; + include?: + | (IntersectItem | Collection | IntersectItem[] | Ground)[] + | Collection + | IntersectItem; /** - * The vertical screen coordinate to convert. + * A list of layers and graphics to include for intersection testing. No layers or graphics will be excluded if exclude is not specified. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) */ + exclude?: + | (IntersectItem | Collection | IntersectItem[] | Ground)[] + | Collection + | IntersectItem; + } + + /** + * An object representing a point on the screen. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ScreenPoint) + */ + export interface SceneViewScreenPoint extends Object { + /** + * The x coordinate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ScreenPoint) + */ + x: number; + /** + * The y coordinate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ScreenPoint) + */ y: number; } @@ -47556,9 +51482,24 @@ declare namespace __esri { y: number; } + export interface HitTestResultGround extends Object { + /** + * The point at which the ground was hit while performing the hitTest. This may be `null` when the ground was not hit at all (for example by clicking on the sky). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ + mapPoint: Point; + /** + * The distance from camera position to the ground hit. The distance will be `0` if the ground was not hit at all. In global scenes the distance will be in meters while in local scenes the distance will be in the unit of the spatial reference of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ + distance: 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. + * A graphic present in the view that intersects the input screen coordinates. Starting with version 4.11, if a label intersects the input screen coordinates the corresponding graphic is returned. 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. Some layers do not have a [graphic.geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry) (for example: [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) and [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) `PointCloudLayer`) The [graphic.attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) only includes attributes which are loaded by the client, for this reason it can be a subset of all attributes. [FeatureLayer.outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) with `["*"]` can be used to force all attributes to be present. The [graphic.symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) exists only for graphics coming from [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) or [view.graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) but it is possible to compute the displayed symbology with [getDisplayedSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#getDisplayedSymbol). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ @@ -47569,6 +51510,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ mapPoint: Point; + /** + * The distance from the camera position to the point geometry hit on this graphic. In global scenes the distance will be in meters while in local scenes the distance will be in the unit of the spatial reference of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ + distance: number; } interface DefaultUI extends UI { @@ -47644,10 +51591,10 @@ declare namespace __esri { * * @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 + * @param component.position The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | manual * @param component.index 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. - * @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 The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | 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:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | 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. * */ @@ -47657,7 +51604,7 @@ declare namespace __esri { * * [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 + * @param position The position from which to remove all components. If not specified, `manual` is used by default. **Possible Values:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | manual * */ empty(position?: string): void; @@ -47668,8 +51615,8 @@ declare namespace __esri { * * @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 + * @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:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | 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:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | manual * */ move(component: Widget | HTMLElement | string | any[] | UIMoveComponent, position?: string): void; @@ -47727,7 +51674,7 @@ declare namespace __esri { */ 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 + * The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | manual * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ @@ -47742,7 +51689,7 @@ declare namespace __esri { 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 + * The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Possible Values:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | manual * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ @@ -47763,14 +51710,14 @@ declare namespace __esri { */ 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 + * 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:** bottom-leading | bottom-left | bottom-right | bottom-trailing | top-leading | top-left | top-right | top-trailing | manual * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) */ position?: string; } - interface View extends Accessor, corePromise, DOMContainer { + interface View extends Accessor, corePromise, Evented, 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. * @@ -47789,12 +51736,6 @@ declare namespace __esri { * [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. * @@ -47839,7 +51780,7 @@ declare namespace __esri { * 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). + * * The view has a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference), a [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#center), and a [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#scale). These also can be inferred by setting an [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#extent). * * * 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. @@ -47875,8 +51816,6 @@ declare namespace __esri { * 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; /** @@ -47913,6 +51852,13 @@ declare namespace __esri { */ new (properties?: ViewProperties): View; + + /** + * Contains the collection of active views on the page. Only views that are [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ready) appear in the collection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#views) + */ + readonly views: Collection; } export const View: ViewConstructor; @@ -48158,7 +52104,7 @@ 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). + * 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). It defines the content, style, and bookmarks of your webmap, and it can be shared across multiple ArcGIS web and desktop applications. The webmap is saved as a JSON document that can be consumed by the ArcGIS API for JavaScript via the WebMap class to easily create compelling 2D applications. The JSON document is written according to the [webmap specification](https://developers.arcgis.com/web-map-specification/). Although you can easily create your own webmaps, there are many sample [webmaps in ArcGIS Online](https://webmaps.maps.arcgis.com/home/group.html?id=bf19f0a0871649c49f6743dbe8138ecb) that you can use to get started with the API. You may modify or add new content to these webmaps. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html) */ @@ -48213,6 +52159,51 @@ declare namespace __esri { widgets?: any; } + interface ColorBackground extends JSONSupport { + /** + * The color of the background. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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-webmap-background-ColorBackground.html#color) + * + * @default black + */ + color: Color; + /** + * For ColorBackground the type is always `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-background-ColorBackground.html#type) + */ + readonly type: string; + + /** + * Creates a deep clone of the object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-background-ColorBackground.html#clone) + * + * + */ + clone(): ColorBackground; + } + + interface ColorBackgroundConstructor { + new (properties?: ColorBackgroundProperties): ColorBackground; + + fromJSON(json: any): ColorBackground; + } + + export const ColorBackground: ColorBackgroundConstructor; + + interface ColorBackgroundProperties { + /** + * The color of the background. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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-webmap-background-ColorBackground.html#color) + * + * @default black + */ + color?: Color | number[] | string; + } + interface Bookmark extends Accessor { /** * The extent of the specified bookmark item. @@ -48271,6 +52262,14 @@ declare namespace __esri { } interface InitialViewProperties extends Accessor, corePromise { + /** + * The background color 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#background) + * + * @default null + */ + background: ColorBackground; /** * 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. * @@ -48301,6 +52300,14 @@ declare namespace __esri { export const InitialViewProperties: InitialViewPropertiesConstructor; interface InitialViewPropertiesProperties { + /** + * The background color 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#background) + * + * @default null + */ + background?: ColorBackgroundProperties; /** * 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. * @@ -48821,9 +52828,9 @@ declare namespace __esri { interface BackgroundProperties {} - interface ColorBackground extends Background, JSONSupport { + interface backgroundColorBackground 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. + * The color of the background. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -48838,26 +52845,26 @@ declare namespace __esri { * * */ - clone(): ColorBackground; + clone(): backgroundColorBackground; } - interface ColorBackgroundConstructor { + interface backgroundColorBackgroundConstructor { /** * 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?: backgroundColorBackgroundProperties): backgroundColorBackground; - fromJSON(json: any): ColorBackground; + fromJSON(json: any): backgroundColorBackground; } - export const ColorBackground: ColorBackgroundConstructor; + export const backgroundColorBackground: backgroundColorBackgroundConstructor; - interface ColorBackgroundProperties extends BackgroundProperties { + interface backgroundColorBackgroundProperties 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. + * The color of the background. This can be autocast with an array of rgb(a) values, named string, hex string or an hsl(a) string, 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) * @@ -49649,13 +53656,7 @@ declare namespace __esri { * * [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; + iconClass: 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 * @@ -49716,6 +53717,12 @@ declare namespace __esri { export const AreaMeasurement2D: AreaMeasurement2DConstructor; interface AreaMeasurement2DProperties extends WidgetProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#iconClass) + */ + iconClass?: 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 * @@ -49790,13 +53797,14 @@ declare namespace __esri { */ readonly modes: string[]; /** - * The ViewModel's state. **Possible Values:** disabled | ready | measuring + * The ViewModel's state. **Possible Values:** disabled | ready | measuring | measured * * Value | Description * ------------|------------- * disabled | not ready yet * ready | ready for measuring * measuring | measuring has started + * measured | measuring has finished * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#state) @@ -49985,6 +53993,7 @@ declare namespace __esri { * disabled | not ready yet * ready | ready for measuring * measuring | currently measuring + * measured | measuring has finished * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#state) @@ -50116,7 +54125,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#iconClass) */ - readonly iconClass: string; + iconClass: string; /** * Text used to split attribution by [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) * @@ -50125,12 +54134,6 @@ declare namespace __esri { * @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. * @@ -50167,6 +54170,12 @@ declare namespace __esri { export const Attribution: AttributionConstructor; interface AttributionProperties extends WidgetProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#iconClass) + */ + iconClass?: string; /** * Text used to split attribution by [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) * @@ -50266,12 +54275,6 @@ declare namespace __esri { * [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). * @@ -50750,19 +54753,13 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) */ - readonly bookmarks: Collection; + 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; + iconClass: string; /** * The view from which the widget will operate. * @@ -50808,6 +54805,18 @@ declare namespace __esri { export const Bookmarks: BookmarksConstructor; interface BookmarksProperties extends WidgetProperties, GoToProperties { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) + */ + bookmarks?: CollectionProperties; + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#iconClass) + */ + iconClass?: string; /** * The view from which the widget will operate. * @@ -50834,7 +54843,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) */ - readonly bookmarks: Collection; + bookmarks: Collection; /** * The view model's state. **Possible Values:** loading | disabled * @@ -50868,6 +54877,12 @@ declare namespace __esri { export const BookmarksViewModel: BookmarksViewModelConstructor; interface BookmarksViewModelProperties extends GoToProperties { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) + */ + bookmarks?: CollectionProperties; /** * The view from which the widget will operate. * @@ -51142,13 +55157,7 @@ declare namespace __esri { * * [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; + iconClass: 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). * @@ -51193,6 +55202,12 @@ declare namespace __esri { export const Compass: CompassConstructor; interface CompassProperties extends WidgetProperties, GoToProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#iconClass) + */ + iconClass?: 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). * @@ -51779,13 +55794,7 @@ declare namespace __esri { * * [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; + iconClass: string; /** * The maximum number of stops allowed for routing. * @@ -51874,6 +55883,12 @@ declare namespace __esri { export const Directions: DirectionsConstructor; interface DirectionsProperties extends WidgetProperties, GoToProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#iconClass) + */ + iconClass?: string; /** * The maximum number of stops allowed for routing. * @@ -51974,7 +55989,7 @@ declare namespace __esri { * * @default null | 'Driving Time' */ - readonly selectedTravelMode: DirectionsViewModelSelectedTravelMode; + 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. * @@ -52073,6 +56088,15 @@ declare namespace __esri { * */ highlightSegment(maneuver: Graphic): void; + /** + * This method should be called to load the view model's routing resources. + * > You must first call this before using `DirectionsViewModel`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#load) + * + * + */ + load(): IPromise; /** * Resets the state of the ViewModel, clearing off all the input stops, and results in the widget. The results persist in the map. * @@ -52092,12 +56116,6 @@ 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; } @@ -52138,6 +56156,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeSymbol) */ routeSymbol?: SimpleLineSymbolProperties; + /** + * 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' + */ + selectedTravelMode?: DirectionsViewModelSelectedTravelMode; /** * An array of graphics that define the stop locations along the route. * @@ -52465,7 +56491,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ - sources?: Collection; + sources?: Collection; /** * Indicates whether to display suggestions as the user enters input text in the widget. * @@ -52576,6 +56602,7 @@ declare namespace __esri { * disabled | not ready yet * ready | ready for measuring * measuring | currently measuring + * measured | measuring has finished * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#state) @@ -52706,13 +56733,7 @@ declare namespace __esri { * * [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; + iconClass: 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 * @@ -52771,6 +56792,12 @@ declare namespace __esri { export const DistanceMeasurement2D: DistanceMeasurement2DConstructor; interface DistanceMeasurement2DProperties extends WidgetProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#iconClass) + */ + iconClass?: 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 * @@ -52843,13 +56870,14 @@ declare namespace __esri { */ readonly modes: string[]; /** - * The view model's state. **Possible Values:** disabled | ready | measuring + * The view model's state. **Possible Values:** disabled | ready | measuring | measured * * Value | Description * ------------|------------- * disabled | not ready yet * ready | ready for measuring * measuring | measuring has started + * measured | measuring has finished * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#state) @@ -52925,6 +56953,787 @@ declare namespace __esri { geometry: any; } + interface Editor extends Widget { + /** + * A property indicating the current active workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#activeWorkflow) + */ + readonly activeWorkflow: Workflow; + /** + * An array of string values which specifies what end users are allowed to edit. For example, a feature layer with full editing privileges may be available. But you may only want the end user to have the ability to update existing features. Set the `allowedWorkflows` to only `update`. + * + * Possible Value | Description | Example + * ---------------|------------|---------- + * create | Indicated in the widget via the `Add feature` option. This allows the end user to create new features in the feature service. | ![combinedcreate](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/editor_combined_create.png) + * update | Indicated in the widget via the `Edit feature` option. This allows the end user to update and/or delete features in the feature service. | ![combinedupdate](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/editor_combined_update.png) + * + * > These workflows are only enabled if the feature service allows these operations. For example, if a feature service is only enabled to allow updates, `Add features` is not enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#allowedWorkflows) + */ + allowedWorkflows: string[]; + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#iconClass) + */ + readonly iconClass: string; + /** + * An array of editing configurations for individual layers. If you have an editable feature layer but do not want the end user to do any type of editing, you can limit this by setting the `enabled` property to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#layerInfos) + */ + layerInfos: LayerInfo[]; + /** + * This property allows customization of supporting Editor widgets and their default behavior. These widgets include [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html), [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html), and [Sketch](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html). + * > This property is useful for basic overrides of the default widgets. There may be some limitations to what the Editor can do with these overridden properties. For example, the Editor will always disable the `multipleSelectionEnabled` property in [Sketch.defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) no matter what is set within this property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#supportingWidgetDefaults) + */ + supportingWidgetDefaults: SupportingWidgetDefaults; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). This view provides the editable layers for the Editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.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 module:esri/widgets/Editor/EditorToggleViewModel class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#viewModel) + */ + viewModel: EditorViewModel; + + /** + * Cancels any active workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#cancelWorkflow) + * + * + */ + cancelWorkflow(): void; + /** + * This is applicable if there is an active update workflow. If so, this method deletes the workflow feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#deleteFeatureFromWorkflow) + * + * + */ + deleteFeatureFromWorkflow(): 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-Editor.html#render) + * + * + */ + render(): any; + /** + * Initiates the `create` workflow by displaying the panel where feature creation begins. This method takes a [CreationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#CreationInfo) object containing the layer(s) and template(s) to use. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startCreateWorkflowAtFeatureCreation) + * + * @param creationInfo An object containing information needed to create a new feature using the Editor widget. + * + */ + startCreateWorkflowAtFeatureCreation(creationInfo: CreationInfo): void; + /** + * This method starts the Editor workflow where it waits for the feature to be selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startCreateWorkflowAtFeatureEdit) + * + * @param feature The feature to be edited. + * + */ + startCreateWorkflowAtFeatureEdit(feature: Graphic): void; + /** + * Initiates the `create` workflow by displaying the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) panel. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startCreateWorkflowAtFeatureTypeSelection) + * + * + */ + startCreateWorkflowAtFeatureTypeSelection(): void; + /** + * Starts the `update` workflow at the feature geometry and attribute editing panel. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startUpdateWorkflowAtFeatureEdit) + * + * @param feature The feature to be updated. + * + */ + startUpdateWorkflowAtFeatureEdit(feature: Graphic): void; + /** + * Starts the `update` workflow using the current selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startUpdateWorkflowAtFeatureSelection) + * + * + */ + startUpdateWorkflowAtFeatureSelection(): void; + /** + * This method starts the Editor workflow where it waits for multiple features to be selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#startUpdateWorkflowAtMultipleFeatureSelection) + * + * @param candidates An array of features to be updated. + * + */ + startUpdateWorkflowAtMultipleFeatureSelection(candidates: Graphic[]): void; + } + + interface EditorConstructor { + /** + * This widget provides an out-of-the-box editing experience to help streamline the editing experience within a web application. The widget has two different [Workflows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html), `create` and `update`. These workflows allow you to either add features or edit and/or delete existing features within an editable feature layer. The widget automatically recognizes if there are editable feature layers within the map. If it recognizes that they are editable, the layers can be used by the widget. In addition, it is also possible to configure how the `Editor` behaves by setting its [layerInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#layerInfos) property. This property takes an array of configuration objects which allow you to configure the editing experience for these layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html) + */ + + new (properties?: EditorProperties): Editor; + } + + export const Editor: EditorConstructor; + + interface EditorProperties extends WidgetProperties { + /** + * An array of string values which specifies what end users are allowed to edit. For example, a feature layer with full editing privileges may be available. But you may only want the end user to have the ability to update existing features. Set the `allowedWorkflows` to only `update`. + * + * Possible Value | Description | Example + * ---------------|------------|---------- + * create | Indicated in the widget via the `Add feature` option. This allows the end user to create new features in the feature service. | ![combinedcreate](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/editor_combined_create.png) + * update | Indicated in the widget via the `Edit feature` option. This allows the end user to update and/or delete features in the feature service. | ![combinedupdate](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/editor_combined_update.png) + * + * > These workflows are only enabled if the feature service allows these operations. For example, if a feature service is only enabled to allow updates, `Add features` is not enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#allowedWorkflows) + */ + allowedWorkflows?: string[]; + /** + * An array of editing configurations for individual layers. If you have an editable feature layer but do not want the end user to do any type of editing, you can limit this by setting the `enabled` property to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#layerInfos) + */ + layerInfos?: LayerInfo[]; + /** + * This property allows customization of supporting Editor widgets and their default behavior. These widgets include [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html), [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html), and [Sketch](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html). + * > This property is useful for basic overrides of the default widgets. There may be some limitations to what the Editor can do with these overridden properties. For example, the Editor will always disable the `multipleSelectionEnabled` property in [Sketch.defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) no matter what is set within this property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#supportingWidgetDefaults) + */ + supportingWidgetDefaults?: SupportingWidgetDefaults; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). This view provides the editable layers for the Editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.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 module:esri/widgets/Editor/EditorToggleViewModel class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#viewModel) + */ + viewModel?: EditorViewModelProperties; + } + + interface EditorViewModel extends Accessor { + /** + * A property indicating the current active workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#activeWorkflow) + */ + readonly activeWorkflow: Workflow; + /** + * An array of string values which specifies what end users are allowed edit. For example, a feature layer with full editing privileges may be available. But you may only want the end user to have the ability to update existing features. Set the `allowedWorkflows` to only `update`. + * + * Possible Value | Description + * ---------------|------------ + * create | Indicated in the widget via the `Add feature` option. This allows the end user to create new features in the feature service. + * update | Indicated in the widget via the `Edit feature` option. This allows the end user to update and/or delete features in the feature service. + * + * > These workflows are only enabled if the feature service allows these operations. For example, if a feature service is only enabled to allow updates, 'Add features' is not enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#allowedWorkflows) + */ + allowedWorkflows: string[]; + /** + * Convenience property that reads whether there are any editable layers that support the `create` workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#canCreate) + */ + readonly canCreate: boolean; + /** + * Convenience property that reads whether there are any editable layers that support the `update` workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#canUpdate) + */ + readonly canUpdate: boolean; + /** + * A collection of editable items based on configuration and available layers on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#editableItems) + */ + readonly editableItems: Collection; + /** + * An array of objects containing information specific to any failed editing operations. In addition to the error(s), options to `retry()` or `cancel()` are provided. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#failures) + */ + readonly failures: EditorViewModelFailures[]; + /** + * The [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html) for supporting the editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#featureFormViewModel) + */ + featureFormViewModel: FeatureFormViewModel; + /** + * The [FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html) for supporting the editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#featureTemplatesViewModel) + */ + featureTemplatesViewModel: FeatureTemplatesViewModel; + /** + * An array of editing configurations for individual layers. If you have an editable feature layer but do not want the end user to do any type of editing, you can limit this by setting the `enabled` property to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#layerInfos) + */ + layerInfos: LayerInfo[]; + /** + * The [SketchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) for supporting the editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#sketchViewModel) + */ + sketchViewModel: SketchViewModel; + /** + * 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. + * editing-new-feature | The Editor is currently editing (creating) a new feature. + * editing-existing-feature | The Editor is currently editing an existing feature. + * awaiting-update-feature-candidate | The period when the application is awaiting the user's input after clicking update and multiple features are returned. Specify the feature to update. + * awaiting-feature-creation-info | This is the first step in the `create` workflow. A [CreationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#CreationInfo) is required. + * awaiting-feature-to-update | This is the first step in the `update` workflow. A [feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) is required. + * awaiting-feature-to-create | The waiting period for when a feature is created beforte attribute/geometry edits can be performed. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * When `true`, there is at least one edit request being processed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#syncing) + */ + readonly syncing: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). This view provides the editable layers for the Editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#view) + */ + view: MapView; + + /** + * Cancels any active workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#cancelWorkflow) + * + * + */ + cancelWorkflow(): void; + /** + * This is applicable if there is an active update workflow. If so, this method deletes the workflow feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#deleteFeatureFromWorkflow) + * + * + */ + deleteFeatureFromWorkflow(): void; + /** + * Initiates the `create` workflow by displaying the panel where feature creation begins. This method takes a [CreationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#CreationInfo) object containing the layer(s) and template(s) to use. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateWorkflowAtFeatureCreation) + * + * @param creationInfo An object containing information needed to create a new feature using the Editor widget. + * + */ + startCreateWorkflowAtFeatureCreation(creationInfo: CreationInfo): void; + /** + * This method starts the Editor workflow where it waits for the feature to be selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateWorkflowAtFeatureEdit) + * + * @param feature The feature to be updated. + * + */ + startCreateWorkflowAtFeatureEdit(feature: Graphic): void; + /** + * Initiates the `create` workflow by displaying the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) panel. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateWorkflowAtFeatureTypeSelection) + * + * + */ + startCreateWorkflowAtFeatureTypeSelection(): void; + /** + * Starts the update workflow at the feature geometry and attribute editing panel. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startUpdateWorkflowAtFeatureEdit) + * + * @param feature The feature to be updated. + * + */ + startUpdateWorkflowAtFeatureEdit(feature: Graphic): void; + /** + * Starts the `update` workflow using the current selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startUpdateWorkflowAtFeatureSelection) + * + * + */ + startUpdateWorkflowAtFeatureSelection(): void; + /** + * Starts the Editor workflow where it waits for multiple features to be selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startUpdateWorkflowAtMultipleFeatureSelection) + * + * + */ + startUpdateWorkflowAtMultipleFeatureSelection(): void; + } + + interface EditorViewModelConstructor { + new (properties?: EditorViewModelProperties): EditorViewModel; + } + + export const EditorViewModel: EditorViewModelConstructor; + + interface EditorViewModelProperties { + /** + * An array of string values which specifies what end users are allowed edit. For example, a feature layer with full editing privileges may be available. But you may only want the end user to have the ability to update existing features. Set the `allowedWorkflows` to only `update`. + * + * Possible Value | Description + * ---------------|------------ + * create | Indicated in the widget via the `Add feature` option. This allows the end user to create new features in the feature service. + * update | Indicated in the widget via the `Edit feature` option. This allows the end user to update and/or delete features in the feature service. + * + * > These workflows are only enabled if the feature service allows these operations. For example, if a feature service is only enabled to allow updates, 'Add features' is not enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#allowedWorkflows) + */ + allowedWorkflows?: string[]; + /** + * The [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html) for supporting the editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#featureFormViewModel) + */ + featureFormViewModel?: FeatureFormViewModelProperties; + /** + * The [FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html) for supporting the editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#featureTemplatesViewModel) + */ + featureTemplatesViewModel?: FeatureTemplatesViewModelProperties; + /** + * An array of editing configurations for individual layers. If you have an editable feature layer but do not want the end user to do any type of editing, you can limit this by setting the `enabled` property to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#layerInfos) + */ + layerInfos?: LayerInfo[]; + /** + * The [SketchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) for supporting the editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#sketchViewModel) + */ + sketchViewModel?: SketchViewModelProperties; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). This view provides the editable layers for the Editor widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#view) + */ + view?: MapViewProperties; + } + + /** + * The editable item available within the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#EditableItem) + */ + export interface EditableItem extends Object { + /** + * *Read-only* The feature layer associated with the editable item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#EditableItem) + */ + layer: FeatureLayer; + /** + * *Read-only* The workflow type that this item supports. Can be either, `update` or `create`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#EditableItem) + */ + supports: string; + } + + export interface EditorViewModelFailures extends Object { + /** + * The readonly error message. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#failures) + */ + error: Error; + } + + interface Workflow extends Accessor { + /** + * Shared workflow data. Can be either a [CreateWorkflowData](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#CreateWorkflowData) or a [UpdateWorkflowData](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#UpdateWorkflowData). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#data) + */ + readonly data: CreateWorkflowData | UpdateWorkflowData; + /** + * This property indicates whether there is a next step in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#hasNextStep) + */ + readonly hasNextStep: boolean; + /** + * This property indicates if there is a previous step in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#hasPreviousStep) + */ + readonly hasPreviousStep: boolean; + /** + * Indicates whether the workflow is considered active. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#started) + * + * @default false + */ + started: boolean; + /** + * The name of the current step in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#stepId) + */ + readonly stepId: string; + /** + * Value indicating the workflow type. + * + * Possible Value | Description | Example + * ---------------|------------|---------- + * create | Indicated in the widget via the `Add feature` option. This allows the end user to create new features in the feature service. | ![combinedcreate](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/editor_combined_create.png) + * update | Indicated in the widget via the `Edit feature` option. This allows the end user to update and/or delete features in the feature service. | ![combinedupdate](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/editor_combined_update.png) + * + * > These workflows are only enabled if the feature service allows these operations. For example, if a feature service is only enabled to allow updates, `Add features` is not enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#type) + */ + readonly type: string; + + /** + * Cancels the active workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#cancel) + * + * + */ + cancel(): void; + /** + * Call this method when the workflow is considered finished. This method is used to help process the editing results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#commit) + * + * + */ + commit(): void; + /** + * Moves to the next step in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#next) + * + * + */ + next(): void; + /** + * Moves to the previous step in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#previous) + * + * + */ + previous(): void; + /** + * Resets the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#reset) + * + * + */ + reset(): void; + /** + * Starts the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#start) + * + * + */ + start(): void; + } + + interface WorkflowConstructor { + /** + * This class helps manage different stages of an editing workflow. A workflow can be thought of as one of two options: `create` and/or `update`. If adding a new feature, the `create` option is used whereas if editing an existing feature, the `update` option is used. Updating includes both editing geometry and attribute data and deleting features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html) + */ + + new (properties?: WorkflowProperties): Workflow; + } + + export const Workflow: WorkflowConstructor; + + interface WorkflowProperties { + /** + * Indicates whether the workflow is considered active. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#started) + * + * @default false + */ + started?: boolean; + } + + /** + * This object contains data for the `create` workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#CreateWorkflowData) + */ + export interface CreateWorkflowData extends Object { + /** + * The [creationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#CreationInfo) associated with the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#CreateWorkflowData) + */ + creationInfo: CreationInfo; + /** + * The edits used to keep track of a feature being modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#CreateWorkflowData) + */ + edits: Edits; + /** + * The associated [EditorViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html) for this workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#CreateWorkflowData) + */ + viewModel: EditorViewModel; + } + + /** + * Object used to keep track of a feature being modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#Edits) + */ + export interface Edits extends Object { + /** + * The feature to be edited. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#Edits) + */ + feature: Graphic; + /** + * *Read-only* When true, the edited feature has been modified from its original state. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#Edits) + */ + modified: boolean; + } + + /** + * This object contains data for the `update` workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#UpdateWorkflowData) + */ + export interface UpdateWorkflowData extends Object { + /** + * An array of features to be updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#UpdateWorkflowData) + */ + candidates: Graphic[]; + /** + * The [editable item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#EditableItem) available within the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#UpdateWorkflowData) + */ + editableItem: EditableItem; + /** + * The edits used to keep track of a feature being modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#UpdateWorkflowData) + */ + edits: Edits; + /** + * The associated [EditorViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html) for this workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#UpdateWorkflowData) + */ + viewModel: EditorViewModel; + } + + /** + * The information needed for creating a new feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#CreationInfo) + */ + export interface CreationInfo extends Object { + /** + * The associated feature layer where the new feature is created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#CreationInfo) + */ + layer: FeatureLayer; + /** + * The associated feature template used to create the new feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#CreationInfo) + */ + template: FeatureTemplate; + } + + /** + * Editor configurations used for an array of fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#LayerInfo) + */ + export interface LayerInfo extends Object { + /** + * The associated feature layer containing the editable fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#LayerInfo) + */ + layer: FeatureLayer; + /** + * The configuration options for displaying an array of fields within the widget. Take note that all fields except for `editor`, `globalID`, `objectID`, and system maintained area and length fields will be included. Otherwise, it is up to the developer to set the right field(s) to override and display. + * > If this is set, in addition to overrides in the [supportingWidgetDefaults](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#supportingWidgetDefaults), the overrides specified in the [supportingWidgetDefaults](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#supportingWidgetDefaults) property take precedence. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#LayerInfo) + */ + fieldConfig?: FieldConfig[]; + /** + * Indicates whether to enable editing on the layer. Defaults to `true` if service supports it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#LayerInfo) + */ + enabled?: boolean; + /** + * Indicates whether to enable `Add feature` functionality. Defaults to `true` if service supports it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#LayerInfo) + */ + addEnabled?: boolean; + /** + * Indicates whether to enable `Update feature` functionality. Defaults to `true` if service supports it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#LayerInfo) + */ + updateEnabled?: boolean; + /** + * Indicates whether to enable the ability to delete features. Defaults to `true` if service supports it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#LayerInfo) + */ + deleteEnabled?: boolean; + } + + /** + * Set this to customize any supporting Editor widgets default behavior. These widgets include [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html), [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html), and [Sketch](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#SupportingWidgetDefaults) + */ + export interface SupportingWidgetDefaults extends Object { + /** + * An object containing properties specific for customizing 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-Editor.html#SupportingWidgetDefaults) + */ + featureForm?: SupportingWidgetDefaultsFeatureForm; + /** + * An object containing properties specific for customizing 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-Editor.html#SupportingWidgetDefaults) + */ + featureTemplates?: SupportingWidgetDefaultsFeatureTemplates; + /** + * An object containing properties specific for customizng 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-Editor.html#SupportingWidgetDefaults) + */ + sketch?: SupportingWidgetDefaultsSketch; + } + + export interface SupportingWidgetDefaultsFeatureForm extends Object { + /** + * An array of [FieldConfig](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html) objects to use within the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html). + * > Any [field configurations](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html) set within the [layerInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#layerInfos) property will be overridden if it is set here in the [supportingWidgetDefaults](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#supportingWidgetDefaults) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#SupportingWidgetDefaults) + */ + fieldConfig?: FieldConfig[]; + /** + * String indicating the [[groupDisplay]](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#groupDisplay) and how they will be displayed to the end user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#SupportingWidgetDefaults) + */ + groupDisplay?: string; + } + + export interface SupportingWidgetDefaultsFeatureTemplates extends Object { + /** + * Aids in managing various template items and how they display within the widget. Please refer to [groupBy API reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#groupBy) for additional information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#SupportingWidgetDefaults) + */ + groupBy?: string | GroupByFunction; + /** + * Indicates whether the [templates filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterEnabled) displays. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#SupportingWidgetDefaults) + */ + filterEnabled?: boolean; + } + + export interface SupportingWidgetDefaultsSketch extends Object { + /** + * An object containing the [updateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) 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-Editor.html#SupportingWidgetDefaults) + */ + updateOptions?: any; + /** + * The marker symbol used to symbolize any point feature updates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#SupportingWidgetDefaults) + */ + markerSymbol?: SimpleMarkerSymbol; + /** + * The polygon symbol used to symbolize any polygon feature updates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#SupportingWidgetDefaults) + */ + polygonSymbol?: SimpleFillSymbol; + /** + * The line symbol used to symbolize any line feature updates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#SupportingWidgetDefaults) + */ + polylineSymbol?: SimpleLineSymbol; + } + interface Expand extends Widget { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. @@ -53217,6 +58026,14 @@ declare namespace __esri { } interface Feature extends Widget { + /** + * Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. (Supported for [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), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), and [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#defaultPopupTemplateEnabled) + * + * @default false + */ + defaultPopupTemplateEnabled: boolean; /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. * @@ -53226,53 +58043,67 @@ declare namespace __esri { */ graphic: Graphic; /** - * The title for the feature. + * A reference to the [view's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). Use this property when needing to get access to the underlying layers within the map. This can then be used within [Arcade](https://developers.arcgis.com/arcade) expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#map) + * + * @default null + */ + map: Map; + /** + * The spatial reference used for [Arcade](https://developers.arcgis.com/arcade) operations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#spatialReference) + * + * @default null + */ + spatialReference: SpatialReference; + /** + * The title for the feature. You can disable this via the [visibleElements](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#visibleElements) property. * * [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; + /** + * The visible elements that are displayed within the widget's [graphic.popupTemplate.content](esri-PopupTemplate.html#content). This property provides the ability to turn individual elements of the widget's display on/off. See the [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) documentation for additional information on how these elements work. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#visibleElements) + */ + visibleElements: VisibleElements; /** - * 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. + * Paginates to a specified [media](esri-popup-content-MediaContent.html) info object. For example, you may have [media](esri-popup-content-MediaContent.html) 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. + * @param contentElementIndex The index position of the [media](esri-popup-content-MediaContent.html) content element to be updated. + * @param mediaInfoIndex The index position of the [media](esri-popup-content-MediaContent.html) info object you wish to display. * */ goToMedia(contentElementIndex: number, mediaInfoIndex: number): void; /** - * Paginates to the next [media](esri-PopupTemplate.html#media) info. + * Paginates to the next [media](esri-popup-content-MediaContent.html) 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. + * @param contentElementIndex The index position of the [media](esri-popup-content-MediaContent.html) 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. + * Paginates to the previous [media](esri-popup-content-MediaContent.html) info in the specified [media](esri-popup-content-MediaContent.html) 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. + * @param contentElementIndex The index position of the [media](esri-popup-content-MediaContent.html) content element. * */ previousMedia(contentElementIndex: number): void; @@ -53293,6 +58124,14 @@ declare namespace __esri { export const Feature: FeatureConstructor; interface FeatureProperties extends WidgetProperties { + /** + * Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. (Supported for [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), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), and [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#defaultPopupTemplateEnabled) + * + * @default false + */ + defaultPopupTemplateEnabled?: boolean; /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. * @@ -53302,34 +58141,56 @@ declare namespace __esri { */ 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. + * A reference to the [view's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). Use this property when needing to get access to the underlying layers within the map. This can then be used within [Arcade](https://developers.arcgis.com/arcade) expressions. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#view) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#map) * * @default null */ - view?: MapViewProperties | SceneViewProperties; + map?: MapProperties; + /** + * The spatial reference used for [Arcade](https://developers.arcgis.com/arcade) operations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#spatialReference) + * + * @default null + */ + spatialReference?: SpatialReferenceProperties; /** * 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; + /** + * The visible elements that are displayed within the widget's [graphic.popupTemplate.content](esri-PopupTemplate.html#content). This property provides the ability to turn individual elements of the widget's display on/off. See the [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) documentation for additional information on how these elements work. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#visibleElements) + */ + visibleElements?: VisibleElements; } interface FeatureViewModel extends Accessor { /** - * The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the feature. + * The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.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; + readonly content: Content[] | Widget | HTMLElement | string; + /** + * Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. (Supported for [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), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), and [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#defaultPopupTemplateEnabled) + * + * @default false + */ + defaultPopupTemplateEnabled: boolean; /** * 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. + * * per an individual content element. This element is defined with a [fieldsContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-FieldsContent.html) popup element set on the PopupTemplate content property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#formattedAttributes) * @@ -53344,28 +58205,38 @@ declare namespace __esri { * @default null */ graphic: Graphic; + /** + * A read-only property containing metadata regarding the last edit performed on a feature. This object has the following properties: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#lastEditInfo) + */ + readonly lastEditInfo: FeatureViewModelLastEditInfo; + /** + * A reference to the [view's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). Use this property when needing to get access to the underlying layers within the map. This can then be used within [Arcade](https://developers.arcgis.com/arcade) expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#map) + * + * @default null + */ + map: Map; + /** + * The spatial reference used for [Arcade](https://developers.arcgis.com/arcade) operations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#spatialReference) + * + * @default null + */ + spatialReference: SpatialReference; /** * 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; } @@ -53377,6 +58248,14 @@ declare namespace __esri { export const FeatureViewModel: FeatureViewModelConstructor; interface FeatureViewModelProperties { + /** + * Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. (Supported for [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), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), and [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#defaultPopupTemplateEnabled) + * + * @default false + */ + defaultPopupTemplateEnabled?: boolean; /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. * @@ -53386,13 +58265,21 @@ declare namespace __esri { */ graphic?: GraphicProperties; /** - * The view associated with the Feature instance. + * A reference to the [view's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). Use this property when needing to get access to the underlying layers within the map. This can then be used within [Arcade](https://developers.arcgis.com/arcade) expressions. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#view) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#map) * * @default null */ - view?: MapViewProperties | SceneViewProperties; + map?: MapProperties; + /** + * The spatial reference used for [Arcade](https://developers.arcgis.com/arcade) operations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#spatialReference) + * + * @default null + */ + spatialReference?: SpatialReferenceProperties; } export interface FeatureViewModelFormattedAttributes extends Object { @@ -53403,13 +58290,82 @@ declare namespace __esri { */ 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`. + * The formatted attributes for an individual content element. This is derived from the module:esri/PopupTemplate PopupTemplate, or per an individual content element. This element is defined with a [fieldsContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-FieldsContent.html) popup element set on the PopupTemplate's [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-Feature-FeatureViewModel.html#formattedAttributes) */ content?: any; } + export interface FeatureViewModelLastEditInfo extends Object { + /** + * User who performed the last edit on a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#lastEditInfo) + */ + user: string; + /** + * Date that the edit was performed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#lastEditInfo) + */ + date: string; + /** + * The type of edit that was performed on the feature. **Possible values:** edit | create + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#lastEditInfo) + */ + type: string; + } + + export interface VisibleContentElements extends Object { + /** + * Indicates whether to display any [AttachmentsContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-AttachmentsContent.html) elements. Default is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#VisibleContentElements) + */ + attachments?: boolean; + /** + * Indicates whether to display any [FieldsContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-FieldsContent.html) elements. Default is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#VisibleContentElements) + */ + fields?: boolean; + /** + * Indicates whether to display any [MediaContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-MediaContent.html) elements. Default is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#VisibleContentElements) + */ + media?: boolean; + /** + * Indicates whether to display any [TextContent](https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-TextContent.html) elements. Default is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#VisibleContentElements) + */ + text?: boolean; + } + + export interface VisibleElements extends Object { + /** + * Indicates whether the title associated with the feature displays. Default value is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#VisibleElements) + */ + title?: boolean; + /** + * Indicates whether content for the Feature displays, can also indicate the specific types of content elements by setting it via [VisibleContentElements](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#VisibleContentElements). The default value is `true`, everything displays. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#VisibleElements) + */ + content?: boolean | VisibleContentElements; + /** + * Indicates whether [lastEditInfo](esri-widgets-Feature-FeatureViewModel.html#lastEditInfo) is displayed within the feature. Default value is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#VisibleElements) + */ + lastEditInfo?: boolean; + } + 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. @@ -53419,7 +58375,7 @@ declare namespace __esri { feature: Graphic; /** * 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. + * > When not set, all fields except for `editor`, `globalID`, `objectID`, and system maintained area and length 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) */ @@ -53498,7 +58454,7 @@ declare namespace __esri { feature?: GraphicProperties; /** * 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. + * > When not set, all fields except for `editor`, `globalID`, `objectID`, and system maintained area and length 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) */ @@ -53540,7 +58496,7 @@ declare namespace __esri { feature: Graphic; /** * 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. + * > When not set, all fields except for `editor`, `globalID`, `objectID`, and system maintained area and length 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) */ @@ -53571,6 +58527,12 @@ declare namespace __esri { * @default disabled */ readonly state: string; + /** + * Indicates whether all input fields are valid. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#valid) + */ + valid: boolean; /** * Convenience method to find input fields. @@ -53620,7 +58582,7 @@ declare namespace __esri { feature?: GraphicProperties; /** * 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. + * > When not set, all fields except for `editor`, `globalID`, `objectID`, and system maintained area and length 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) */ @@ -53631,6 +58593,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#layer) */ layer?: FeatureLayerProperties; + /** + * Indicates whether all input fields are valid. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#valid) + */ + valid?: boolean; } interface FieldConfig extends Accessor { @@ -53706,6 +58674,15 @@ declare namespace __esri { * @default false */ required: boolean; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that controls this field's visibility. The field will only display if this expression is `true`. [![featureFormFieldVisibility](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureform-fieldvisilbility.png)](https://developers.arcgis.com/javascript/latest/sample-code/sandbox/sandbox.html?sample=editing-featureform-fieldvisibility) + * > This only affects how the field is rendered. It does not have any impact on the attribute's values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#visibilityExpression) + * + * @default null + */ + visibilityExpression: string; } interface FieldConfigConstructor { @@ -53787,6 +58764,15 @@ declare namespace __esri { * @default false */ required?: boolean; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that controls this field's visibility. The field will only display if this expression is `true`. [![featureFormFieldVisibility](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureform-fieldvisilbility.png)](https://developers.arcgis.com/javascript/latest/sample-code/sandbox/sandbox.html?sample=editing-featureform-fieldvisibility) + * > This only affects how the field is rendered. It does not have any impact on the attribute's values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#visibilityExpression) + * + * @default null + */ + visibilityExpression?: string; } interface FieldGroupConfig extends Accessor { @@ -53808,6 +58794,15 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#label) */ label: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that controls this field's visibility. The field will only display if this expression is `true`. [![featureFormFieldVisibility](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureform-fieldvisilbility.png)](https://developers.arcgis.com/javascript/latest/sample-code/sandbox/sandbox.html?sample=editing-featureform-fieldvisibility) + * > This only affects how the field is rendered. It does not have any impact on the attribute's values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#visibilityExpression) + * + * @default null + */ + visibilityExpression: string; } interface FieldGroupConfigConstructor { @@ -53835,6 +58830,15 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#label) */ label?: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that controls this field's visibility. The field will only display if this expression is `true`. [![featureFormFieldVisibility](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureform-fieldvisilbility.png)](https://developers.arcgis.com/javascript/latest/sample-code/sandbox/sandbox.html?sample=editing-featureform-fieldvisibility) + * > This only affects how the field is rendered. It does not have any impact on the attribute's values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#visibilityExpression) + * + * @default null + */ + visibilityExpression?: string; } interface InputField extends Accessor { @@ -53967,6 +58971,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#description) */ description: string; + /** + * The result of `visibilityExpression`. Note, if `visibilityExpression` is not defined, the value of this property will be `undefined`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#evaluatedVisibility) + */ + readonly evaluatedVisibility: boolean; /** * The input fields belonging to this group. * @@ -53979,6 +58989,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#label) */ readonly label: string; + /** + * Arcade expression to determine whether this group is visible or not + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#visibilityExpression) + * + * @default null + */ + visibilityExpression: string; /** * The group's visibility. * @@ -54000,6 +59018,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#description) */ description?: string; + /** + * Arcade expression to determine whether this group is visible or not + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#visibilityExpression) + * + * @default null + */ + visibilityExpression?: string; } interface FeatureTemplates extends Widget { @@ -54017,6 +59043,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction) */ filterFunction: FilterFunction; + /** + * Text used to filter items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterText) + */ + filterText: string; /** * 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. * @@ -54084,6 +59116,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction) */ filterFunction?: FilterFunction; + /** + * Text used to filter items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterText) + */ + filterText?: string; /** * 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. * @@ -54168,13 +59206,21 @@ declare namespace __esri { readonly state: string; /** - * Use this method to apply a filter on the items. + * This method updates the [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) with the provided filter. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#refresh) * * */ refresh(): void; + /** + * Fires when a [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#select) + * + * + */ + select(): void; } interface FeatureTemplatesViewModelConstructor { @@ -54247,6 +59293,14 @@ declare namespace __esri { */ readonly thumbnail: HTMLElement; + /** + * Creates a deep clone of the template item object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#clone) + * + * + */ + clone(): TemplateItem; /** * Fetches the thumbnail used to display the template item. * @@ -54298,7 +59352,7 @@ declare namespace __esri { */ 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). + * The label 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) */ @@ -54455,13 +59509,7 @@ declare namespace __esri { * * [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; + iconClass: 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. * @@ -54523,6 +59571,12 @@ declare namespace __esri { export const Home: HomeConstructor; interface HomeProperties extends WidgetProperties, GoToProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#iconClass) + */ + iconClass?: 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. * @@ -54623,13 +59677,7 @@ declare namespace __esri { * * [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; + iconClass: 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. * @@ -54690,6 +59738,12 @@ declare namespace __esri { export const LayerList: LayerListConstructor; interface LayerListProperties extends WidgetProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#iconClass) + */ + iconClass?: 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. * @@ -54967,18 +60021,18 @@ declare namespace __esri { export type ListItemCreatedHandler = (event: any) => void; interface Legend extends Widget { + /** + * Collection of [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) objects used by the legend view to display data in the legend. The legend widget watches this property to hide or display the layer's legend when an [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) is removed from or added to this collection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#activeLayerInfos) + */ + activeLayerInfos: Collection; /** * 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; + iconClass: 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. * @@ -54999,6 +60053,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.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 [LegendViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-LegendViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#viewModel) + */ + viewModel: LegendViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. @@ -55023,6 +60083,18 @@ declare namespace __esri { export const Legend: LegendConstructor; interface LegendProperties extends WidgetProperties { + /** + * Collection of [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) objects used by the legend view to display data in the legend. The legend widget watches this property to hide or display the layer's legend when an [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) is removed from or added to this collection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#activeLayerInfos) + */ + activeLayerInfos?: CollectionProperties; + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#iconClass) + */ + iconClass?: 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. * @@ -55043,8 +60115,771 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.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 [LegendViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-LegendViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#viewModel) + */ + viewModel?: LegendViewModelProperties; } + interface LegendViewModel extends Accessor { + /** + * Collection of [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) objects used by the legend view to display data in the legend. Use this property to hide or display the layer's symbols in the legend when an [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) is removed from or added to this collection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-LegendViewModel.html#activeLayerInfos) + */ + activeLayerInfos: Collection; + /** + * Specifies a subset of the layers in the map to display in the legend. If this property is not set, all operational layers in the map will display in the legend. This property can be used to control layer display order 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-LegendViewModel.html#layerInfos) + */ + layerInfos: LegendViewModelLayerInfos[]; + /** + * The view model's state. **Possible Values:** ready | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-LegendViewModel.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-Legend-LegendViewModel.html#view) + */ + view: MapView | SceneView; + } + + interface LegendViewModelConstructor { + new (properties?: LegendViewModelProperties): LegendViewModel; + } + + export const LegendViewModel: LegendViewModelConstructor; + + interface LegendViewModelProperties { + /** + * Collection of [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) objects used by the legend view to display data in the legend. Use this property to hide or display the layer's symbols in the legend when an [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) is removed from or added to this collection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-LegendViewModel.html#activeLayerInfos) + */ + activeLayerInfos?: CollectionProperties; + /** + * Specifies a subset of the layers in the map to display in the legend. If this property is not set, all operational layers in the map will display in the legend. This property can be used to control layer display order 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-LegendViewModel.html#layerInfos) + */ + layerInfos?: LegendViewModelLayerInfos[]; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-LegendViewModel.html#view) + */ + view?: MapViewProperties | SceneViewProperties; + } + + export interface LegendViewModelLayerInfos extends Object { + /** + * Specify a title for the layer. If no title is specified the service name is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-LegendViewModel.html#layerInfos) + */ + title?: string; + /** + * A layer to add to the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-LegendViewModel.html#layerInfos) + */ + layer?: Layer; + } + + interface ActiveLayerInfo extends Accessor { + /** + * A collection of child activeLayerInfos. This only applies to renderers of [Sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) or the children of [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#children) + */ + children: Collection; + /** + * Indicates if the legend's display of the layer's renderer is driven by the scale of the view. This is true of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) renderers, any renderer that uses a `valueExpression` (Arcade expression), or another renderer such as [DotDensityRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#isScaleDriven) + */ + isScaleDriven: boolean; + /** + * The layer represented by the ActiveLayerInfo object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#layer) + */ + layer: Layer; + /** + * The legendElements is constructed using the layer [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). It reflects the actual structure of the legend. Each `legendElement` has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElements) + */ + legendElements: LegendElement[]; + /** + * The ActiveLayerInfo of the parent [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) or [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#parent) + */ + parent: ActiveLayerInfo; + /** + * Indicates if the activeLayerInfo is ready. It is set to `true` when all its [legendElements](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElements) are computed. It is set to `false` when the layer renderer changes so that the legendElements can recomputed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ready) + */ + ready: boolean; + /** + * The scale of the view instance in which the Legend is rendered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#scale) + */ + scale: number; + /** + * The text string that represents the legend's title. This value is read from the `layerInfo` of the corresponding layer in the legend. If not provided, this value comes from the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#title) of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#title) + */ + title: string; + /** + * The version of the ActiveLayerInfo. It increases by `1` whenever [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ready) property of ActiveLayerInfo changes. This property should watched in the view for ActiveLayerInfo changes and update the DOM accordingly. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#version) + */ + version: number; + /** + * The view in which the Legend is rendered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#view) + */ + view: View; + } + + interface ActiveLayerInfoConstructor { + new (properties?: ActiveLayerInfoProperties): ActiveLayerInfo; + } + + export const ActiveLayerInfo: ActiveLayerInfoConstructor; + + interface ActiveLayerInfoProperties { + /** + * A collection of child activeLayerInfos. This only applies to renderers of [Sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) or the children of [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#children) + */ + children?: CollectionProperties; + /** + * Indicates if the legend's display of the layer's renderer is driven by the scale of the view. This is true of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) renderers, any renderer that uses a `valueExpression` (Arcade expression), or another renderer such as [DotDensityRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-DotDensityRenderer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#isScaleDriven) + */ + isScaleDriven?: boolean; + /** + * The layer represented by the ActiveLayerInfo object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#layer) + */ + layer?: LayerProperties; + /** + * The legendElements is constructed using the layer [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). It reflects the actual structure of the legend. Each `legendElement` has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElements) + */ + legendElements?: LegendElement[]; + /** + * The ActiveLayerInfo of the parent [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) or [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#parent) + */ + parent?: ActiveLayerInfoProperties; + /** + * Indicates if the activeLayerInfo is ready. It is set to `true` when all its [legendElements](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElements) are computed. It is set to `false` when the layer renderer changes so that the legendElements can recomputed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ready) + */ + ready?: boolean; + /** + * The scale of the view instance in which the Legend is rendered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#scale) + */ + scale?: number; + /** + * The text string that represents the legend's title. This value is read from the `layerInfo` of the corresponding layer in the legend. If not provided, this value comes from the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#title) of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#title) + */ + title?: string; + /** + * The version of the ActiveLayerInfo. It increases by `1` whenever [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ready) property of ActiveLayerInfo changes. This property should watched in the view for ActiveLayerInfo changes and update the DOM accordingly. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#version) + */ + version?: number; + /** + * The view in which the Legend is rendered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#view) + */ + view?: ViewProperties; + } + + /** + * Describes the schema of the ColorRampElement used as a [legendElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElement). See the table below for more details of the properties in this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampElement) + */ + export interface ColorRampElement extends Object { + /** + * The type of this element is always `color-ramp`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampElement) + */ + type: string; + /** + * The title of the color ramp as displayed in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampElement) + */ + title: string | RampTitle; + /** + * The color of the border surrounding the ramp. This corresponds with the outline color defined in the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampElement) + */ + borderColor: Color; + /** + * The overlay color of the color ramp. This is typically transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampElement) + */ + overlayColor: Color; + /** + * The individual color stops rendered in the legend that correspond to the color visual variable in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampElement) + */ + infos: ColorRampStop[]; + } + + /** + * Describes the schema of the ColorRampStop element. Each ColorRampStop represents a single stop of the [ColorVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html) referenced in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampStop) + */ + export interface ColorRampStop extends Object { + /** + * The label in the legend describing features with the given `color` and `value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampStop) + */ + label: string; + /** + * The value of the color visual variable [stop](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampStop) + */ + value: number; + /** + * The color of the visual variable [stop](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampStop) + */ + color: Color; + /** + * A number between `0` and `1` describing the position of the label on the color ramp. For example, in a color ramp with three stops, the first stop would have an offset of `0`, the second `0.5`, and the third `1`. These offsets are equally spaced for any given number of labels in the color ramp. The interval of each offset value is equal to 1 divided by the number of stops minus 1. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ColorRampStop) + */ + offset: number; + } + + /** + * Describes the schema of the HeatmapRampElement used as a [legendElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElement). See the table below for more details of the properties in this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampElement) + */ + export interface HeatmapRampElement extends Object { + /** + * The type of this element is always `heatmap-ramp`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampElement) + */ + type: string; + /** + * The title of the heatmap ramp as displayed in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampElement) + */ + title?: string | RampTitle; + /** + * The individual color stops rendered in the legend that correspond to the heatmap colorStops in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampElement) + */ + infos: HeatmapRampStop[]; + } + + /** + * Describes the schema of the HeatmapRampStop element. Each HeatmapRampStop represents a single `colorStop` of the [Heatmap color stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) referenced in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampStop) + */ + export interface HeatmapRampStop extends Object { + /** + * The label of the color stop displayed in the legend. Typically only the first and last stops have labels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampStop) + */ + label: string; + /** + * The ratio of a pixel's intensity value to the minPixelIntensity of the renderer. The ratio of each pixel is matched to the corresponding color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampStop) + */ + ratio: number; + /** + * The color of the pixel corresponding to the appropriate pixel `ratio`. This value is typically between `0` and `1`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampStop) + */ + color: Color; + /** + * A number between `0` and `1` describing the position of the label on the ramp. For example, in a ramp with three stops, the first stop would have an offset of `0`, the second `0.5`, and the third `1`. These offset values are equally spaced for any given number of labels in the ramp. The interval of each offset value is equal to 1 divided by the number of stops minus 1. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#HeatmapRampStop) + */ + offset: number; + } + + /** + * Properties defining the scheme of each of the ImageSymbolTableElementInfo. This applies only to ImageryLayer renderers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ImageSymbolTableElementInfo) + */ + export interface ImageSymbolTableElementInfo extends Object { + /** + * The label of the category corresponding to the given image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ImageSymbolTableElementInfo) + */ + label?: string; + /** + * The data URI of the image representing a colored pixel in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ImageSymbolTableElementInfo) + */ + src: string; + /** + * The opacity of the image (`0` to `1`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ImageSymbolTableElementInfo) + */ + opacity: number; + /** + * The width of the image in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ImageSymbolTableElementInfo) + */ + width?: number; + /** + * The height of the image in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#ImageSymbolTableElementInfo) + */ + height?: number; + } + + /** + * Properties defining the scheme of each of the supported [legendElements](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElements). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#LegendElement) + */ + export type LegendElement = + | SymbolTableElement + | ColorRampElement + | OpacityRampElement + | SizeRampElement + | HeatmapRampElement + | RelationshipRampElement; + + /** + * Describes the schema of the OpacityRampElement used as a [legendElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElement). See the table below for more details of the properties in this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampElement) + */ + export interface OpacityRampElement extends Object { + /** + * The type of this element is always `opacity-ramp`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampElement) + */ + type: string; + /** + * The title of the opacity ramp as displayed in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampElement) + */ + title?: string | RampTitle; + /** + * The color of the border surrounding the ramp. This corresponds with the outline color defined in the default symbol of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampElement) + */ + borderColor: Color; + /** + * The overlay color of the color ramp. This is typically transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampElement) + */ + overlayColor: Color; + /** + * The individual opacity stops rendered in the legend that correspond to the opacity visual variable in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampElement) + */ + infos: OpacityRampStop[]; + } + + /** + * Describes the schema of the OpacityRampStop element. Each OpacityRampStop represents a single stop of the [OpacityVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html) referenced in the renderer. The opacity value of each stop is indicated in the [alpha](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#a) property of the `color` object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampStop) + */ + export interface OpacityRampStop extends Object { + /** + * The label in the legend describing features with the given `color` and `value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampStop) + */ + label: string; + /** + * The value of the opacity visual variable [stop](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampStop) + */ + value: number; + /** + * The color of the visual variable [stop](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops). The opacity corresponding to the given `value` is indicated in the [alpha](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#a) property of the color object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampStop) + */ + color: Color; + /** + * A number between `0` and `1` describing the position of the label on the ramp. For example, in a ramp with three stops, the first stop would have an offset of `0`, the second `0.5`, and the third `1`. These offsets are equally spaced for any given number of labels in the ramp. The interval of each offset value is equal to 1 divided by the number of stops minus 1. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#OpacityRampStop) + */ + offset: number; + } + + /** + * Describes the schema of the RampTitle element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RampTitle) + */ + export interface RampTitle extends Object { + /** + * The field name used in a visual variable of a renderer. This is used in the generated title of the corresponding ramp in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RampTitle) + */ + field: string; + /** + * If provided, the normalization field name used in a visual variable of a renderer. This is used in the generated title of the corresponding ramp in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RampTitle) + */ + normField: string; + /** + * If `true`, the legend formats to display the field and normalization field as a ratio. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RampTitle) + */ + ratio: boolean; + /** + * If `true`, the legend formats to display the field and normalization field as a percentage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RampTitle) + */ + ratioPercent: boolean; + /** + * If `true`, the legend formats to display the field and normalization field as a percentage of total. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RampTitle) + */ + ratioPercentTotal: boolean; + } + + /** + * Describes the schema of the RelationshipLabels element. These labels are rendered in the corners of the square that represent the relationship renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipLabels) + */ + export interface RelationshipLabels extends Object { + /** + * The label corresponding with the top corner of the legend if the focus is set to `HH`. This describes values that are considered high in both field 1 and field 2 (HH). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipLabels) + */ + top: string; + /** + * The label corresponding with the bottom corner of the legend if the focus is set to `HH`. This describes values that are considered low in both field 1 and field 2 (LL). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipLabels) + */ + bottom: string; + /** + * The label corresponding with the left corner of the legend (if the focus is set to `HH`). This describes features where the value of field 1 is high and the value of field 2 is low (HL). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipLabels) + */ + left: string; + /** + * The label corresponding with the right corner of the legend (if the focus is set to `HH`). This describes features where the value of field 2 is high and the value of field 1 is low (LH). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipLabels) + */ + right: string; + } + + /** + * Describes the schema of the RelationshipRampElement used as a [legendElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElement). See the table below for more details of the properties in this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + export interface RelationshipRampElement extends Object { + /** + * The type of this element is always `relationship-ramp`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + type: string; + /** + * The number of classes for each field comprising the renderer. Can either be 2, 3, or 4. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + numClasses: number; + /** + * Determines the orientation of the Legend. Values can be `HH`, `HL`, `LH`, `LL`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + focus: string; + /** + * A 2-dimensional array of colors as displayed in the legend grid. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + colors: Color[][]; + /** + * The labels for each corner of the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + labels: RelationshipLabels; + /** + * The rotation of the legend in degrees (0-360). `0` degrees displays the legend as a square with the `LL` cell in the bottom left corner of the legend and the `HH` cell in the top right corner. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + rotation: number; + /** + * The title of the renderer as displayed in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + title?: string; + /** + * Info objects associated with the relationship renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RelationshipRampElement) + */ + infos?: any[]; + } + + /** + * Describes the schema of the RendererTitle element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RendererTitle) + */ + export interface RendererTitle extends Object { + /** + * The title of the renderer as displayed in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RendererTitle) + */ + title?: string; + /** + * The field name used in the renderer. This is used in the generated title of the renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RendererTitle) + */ + field: string; + /** + * If a normalization field is provided to the renderer, this field is also used in the generated title for the renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RendererTitle) + */ + normField: string; + /** + * Indicates if a percentage is used in the normalization of the renderer. This is used to create a more readable legend for that scenario. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#RendererTitle) + */ + normByPct: boolean; + } + + /** + * Describes the schema of the SizeRampElement used as a [legendElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElement). See the table below for more details of the properties in this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampElement) + */ + export interface SizeRampElement extends Object { + /** + * The type of this element is always `size-ramp`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampElement) + */ + type: string; + /** + * The title of the size ramp as displayed in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampElement) + */ + title?: string | RampTitle; + /** + * The individual size stops rendered in the legend that correspond to the size visual variable in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampElement) + */ + infos: SizeRampStop[]; + } + + /** + * Describes the schema of the SizeRampStop element. Each SizeRampStop represents a single stop of the [SizeVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) referenced in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampStop) + */ + export interface SizeRampStop extends Object { + /** + * The label in the legend describing features with the given `symbol` and `value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampStop) + */ + label: string; + /** + * The value of the size visual variable [stop](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampStop) + */ + value?: any; + /** + * The symbol corresponding to the value of the stop in the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampStop) + */ + symbol: Symbol; + /** + * The size of the visual variable [stop](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampStop) + */ + size?: number; + /** + * The width of the outline in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampStop) + */ + outlineSize?: number; + /** + * The HTML element rendered in the legend representing features with the given value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SizeRampStop) + */ + preview?: HTMLElement; + } + + /** + * Describes the schema of the SymbolTableElement used as a [legendElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#legendElement). This legend element is used for [UniqueValueRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html) and [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html). See the table below for more details of the properties in this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElement) + */ + export interface SymbolTableElement extends Object { + /** + * The type of this element is always `symbol-table`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElement) + */ + type: string; + /** + * The title of the renderer as displayed in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElement) + */ + title?: string | RendererTitle; + /** + * Only used for renderers set to ImageryLayers. Indicates the type of renderer set on the layer (e.g. `stretched` or `Unique Values`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElement) + */ + legendType?: string; + /** + * An array of each symbol/category/break rendered for the symbol table. For example, this may be individual breaks for a ClassBreaksRenderer, or unique values for a UniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElement) + */ + infos: SymbolTableElementType[]; + } + + /** + * Properties defining the scheme of the SymbolTableElementInfo. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElementInfo) + */ + export interface SymbolTableElementInfo extends Object { + /** + * The title of the renderer as displayed in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElementInfo) + */ + label: string | RampTitle; + /** + * The value corresponding with the given `symbol` in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElementInfo) + */ + value?: any; + /** + * The symbol for the corresponding `value` in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElementInfo) + */ + symbol: Symbol; + /** + * The size of the symbol in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElementInfo) + */ + size?: number; + /** + * A preview of the symbol element as displayed in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElementInfo) + */ + preview?: HTMLElement; + } + + /** + * Properties defining the scheme of each SymbolTableElementType. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html#SymbolTableElementType) + */ + export type SymbolTableElementType = ImageSymbolTableElementInfo | SymbolTableElementInfo; + 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. @@ -55119,12 +60954,6 @@ declare namespace __esri { * [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). * @@ -55299,13 +61128,7 @@ declare namespace __esri { * * [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; + iconClass: string; /** * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. * @@ -55364,6 +61187,12 @@ declare namespace __esri { export const NavigationToggle: NavigationToggleConstructor; interface NavigationToggleProperties extends WidgetProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#iconClass) + */ + iconClass?: string; /** * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. * @@ -55474,6 +61303,19 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ actions: Collection; + /** + * Indicates whether [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) within the popup should display in a menu item. + * + * | actionsMenuEnabled = false | actionsMenuEnabled = true | + * | -------------------------- | ------------------------- | + * | ![actions49](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/410/popup-actions-49.png) | ![actions410](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/410/popup-actions-410.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actionsMenuEnabled) + * + * @default true + */ + actionsMenuEnabled: boolean; /** * Position of the popup in relation to the selected feature. **Possible Values:** auto | top-center | top-right | bottom-left | bottom-center | bottom-right | Function * @@ -55526,6 +61368,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#currentDockPosition) */ readonly currentDockPosition: string; + /** + * Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. (Supported for [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), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) and [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) + * + * @default false + */ + defaultPopupTemplateEnabled: boolean; /** * 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. * @@ -55734,6 +61584,19 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ actions?: CollectionProperties; + /** + * Indicates whether [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) within the popup should display in a menu item. + * + * | actionsMenuEnabled = false | actionsMenuEnabled = true | + * | -------------------------- | ------------------------- | + * | ![actions49](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/410/popup-actions-49.png) | ![actions410](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/410/popup-actions-410.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actionsMenuEnabled) + * + * @default true + */ + actionsMenuEnabled?: boolean; /** * Position of the popup in relation to the selected feature. **Possible Values:** auto | top-center | top-right | bottom-left | bottom-center | bottom-right | Function * @@ -55780,6 +61643,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) */ content?: string | HTMLElement | WidgetProperties; + /** + * Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. (Supported for [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), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) and [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled) + * + * @default false + */ + defaultPopupTemplateEnabled?: boolean; /** * 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. * @@ -55899,6 +61770,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) */ content: string | HTMLElement | Widget; + /** + * Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. (Supported for [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), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) and [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#defaultPopupTemplateEnabled) + * + * @default false + */ + defaultPopupTemplateEnabled: boolean; /** * The number of selected [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) available to the popup. * @@ -56082,6 +61961,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) */ content?: string | HTMLElement | WidgetProperties; + /** + * Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the `createPopupTemplate` method. (Supported for [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), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) and [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#defaultPopupTemplateEnabled) + * + * @default false + */ + defaultPopupTemplateEnabled?: 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-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. * @@ -56305,13 +62192,7 @@ declare namespace __esri { * * [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; + iconClass: string; /** * The URL of the REST endpoint of the Export Web Map Task. * @@ -56360,6 +62241,12 @@ declare namespace __esri { export const Print: PrintConstructor; interface PrintProperties extends WidgetProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#iconClass) + */ + iconClass?: string; /** * The URL of the REST endpoint of the Export Web Map Task. * @@ -56763,13 +62650,21 @@ 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. + * The current active menu of the Search widget. **Possible Values:** none | suggestion | source | warning + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeMenu) + * + * @default none + */ + activeMenu: string; + /** + * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) object currently selected. Can be either a [LayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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; + readonly activeSource: LayerSearchSource | LocatorSearchSource; /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -56786,6 +62681,12 @@ declare namespace __esri { * @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.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.html#event:search-complete) event handler and get the results through the event object. * @@ -56794,12 +62695,18 @@ declare namespace __esri { * @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 [LayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html) 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.html#defaultSources) + */ + readonly defaultSources: Collection; /** * 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; + 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). * @@ -56808,12 +62715,6 @@ declare namespace __esri { * @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) * > 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). @@ -56856,11 +62757,9 @@ declare namespace __esri { */ 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. + * A customized [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for the selected feature. Note that any templates defined on [allSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allSources) take precedence over those defined directly on the template. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) - * - * @default null */ popupTemplate: PopupTemplate; /** @@ -56912,7 +62811,7 @@ declare namespace __esri { readonly selectedResult: SearchResult; /** * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: - * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + * * [LayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html) * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) * * @@ -56921,7 +62820,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ - sources: Collection; + sources: Collection; /** * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). This is available if working with a 10.3 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`. * @@ -57014,6 +62913,14 @@ declare namespace __esri { export const widgetsSearch: widgetsSearchConstructor; interface widgetsSearchProperties extends WidgetProperties, GoToProperties { + /** + * The current active menu of the Search widget. **Possible Values:** none | suggestion | source | warning + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeMenu) + * + * @default none + */ + activeMenu?: string; /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -57038,6 +62945,12 @@ declare namespace __esri { * @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) + */ + 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). * @@ -57088,11 +63001,9 @@ declare namespace __esri { */ 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. + * A customized [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for the selected feature. Note that any templates defined on [allSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allSources) take precedence over those defined directly on the template. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) - * - * @default null */ popupTemplate?: PopupTemplateProperties; /** @@ -57125,7 +63036,7 @@ declare namespace __esri { searchTerm?: string; /** * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: - * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + * * [LayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html) * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) * * @@ -57134,7 +63045,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ - sources?: CollectionProperties; + sources?: CollectionProperties; /** * Enable suggestions for the widget. This is only available if working with a 10.3 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`. * @@ -57157,121 +63068,121 @@ declare namespace __esri { viewModel?: SearchViewModelProperties; } - interface FeatureLayerSearchSource extends SearchSource, JSONSupport { + interface LayerSearchSource 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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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. + * The layer queried in the search. This is **required**. + * > 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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#layer) */ - featureLayer: FeatureLayer; + layer: Layer; /** * The name of the source for display. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#name) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#clone) * * */ - clone(): FeatureLayerSearchSource; + clone(): LayerSearchSource; } - interface FeatureLayerSearchSourceConstructor { + interface LayerSearchSourceConstructor { /** - * 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. + * The following properties define a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html) */ - new (properties?: FeatureLayerSearchSourceProperties): FeatureLayerSearchSource; + new (properties?: LayerSearchSourceProperties): LayerSearchSource; - fromJSON(json: any): FeatureLayerSearchSource; + fromJSON(json: any): LayerSearchSource; } - export const FeatureLayerSearchSource: FeatureLayerSearchSourceConstructor; + export const LayerSearchSource: LayerSearchSourceConstructor; - interface FeatureLayerSearchSourceProperties extends SearchSourceProperties { + interface LayerSearchSourceProperties 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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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. + * The layer queried in the search. This is **required**. + * > 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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#layer) */ - featureLayer?: FeatureLayerProperties; + layer?: LayerProperties; /** * The name of the source for display. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#name) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.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) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#suggestionTemplate) */ suggestionTemplate?: string; } @@ -57522,7 +63433,7 @@ declare namespace __esri { popupEnabled: boolean; /** * The popup template used to display search results. If no popup is needed, set the source's popupTemplate to `null`. - * > This property should be set in instances where there is no existing [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) configured. For example, [feature sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) will default to any existing [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) configured on the layer. + * > 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-LayerSearchSource.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) */ @@ -57573,6 +63484,25 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#zoomScale) */ zoomScale: number; + + /** + * Method to provide parameters for a given search source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#getResults) + * + * @param resultsParams An object that is passed as a parameter to get search results. + * + */ + getResults(resultsParams: GetResultsParameters): IPromise; + /** + * Method to provide parameters for search suggestions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#getSuggestions) + * + * @param suggestionsParams An object that is passed as a parameter for search suggestions. + * + */ + getSuggestions(suggestionsParams: GetSuggestionsParameters): IPromise; } interface SearchSourceConstructor { @@ -57642,7 +63572,7 @@ declare namespace __esri { popupEnabled?: boolean; /** * The popup template used to display search results. If no popup is needed, set the source's popupTemplate to `null`. - * > This property should be set in instances where there is no existing [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) configured. For example, [feature sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) will default to any existing [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) configured on the layer. + * > 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-LayerSearchSource.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) */ @@ -57695,6 +63625,94 @@ declare namespace __esri { zoomScale?: number; } + /** + * Specifies the object that is passed as a parameter to [getResults()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#getResults). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetResultsParameters) + */ + export interface GetResultsParameters extends Object { + /** + * The key field used to find the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetResultsParameters) + */ + exactMatch?: boolean; + /** + * The location value used by the Search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetResultsParameters) + */ + location?: Point; + /** + * Indicates the maximum number of search results to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetResultsParameters) + */ + maxResults?: number; + /** + * Indicates the index of the search source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetResultsParameters) + */ + sourceIndex?: number; + /** + * Indicates the Spatial Refeference defined by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetResultsParameters) + */ + spatialReference?: SpatialReference; + /** + * Indicates the Suggest Result that triggered the search for a result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetResultsParameters) + */ + suggestResult?: SuggestResult; + /** + * Indicates the view provided to the Search Widget using the source. + * + * [Read more...](global.html) + */ + view?: MapView | SceneView; + } + + /** + * Specifies the object that is passed as a parameter to [getSuggestions()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#getSuggestions). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetSuggestionsParameters) + */ + export interface GetSuggestionsParameters extends Object { + /** + * 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#GetSuggestionsParameters) + */ + maxSuggestions?: number; + /** + * Indicates the index of the search source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetSuggestionsParameters) + */ + sourceIndex?: number; + /** + * Indicates the Spatial Refeference defined by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetSuggestionsParameters) + */ + spatialReference?: SpatialReference; + /** + * Indicates search term used to find a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#GetSuggestionsParameters) + */ + suggestTerm?: string; + /** + * Indicates the view provided to the Search Widget using the source. + * + * [Read more...](global.html) + */ + view?: MapView | SceneView; + } + export interface SearchSourceFilter extends Object { /** * The where clause specified for filtering suggests or search results. @@ -57703,7 +63721,7 @@ declare namespace __esri { */ where?: string; /** - * The filter geometry for suggests or search results. + * The filter geometry for suggests or search results. [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) is the only supported geometry when working with [locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) sources. See [Find Address Candidates](https://developers.arcgis.com/rest/services-reference/find-address-candidates.htm) for additional information. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) */ @@ -57712,11 +63730,11 @@ 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). + * 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-Layer.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; + readonly activeSource: LayerSearchSource | LocatorSearchSource; /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -57738,7 +63756,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allSources) */ - readonly allSources: Collection; + readonly allSources: Collection; /** * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#event:search-complete) event handler and get the results through the event object. * @@ -57748,11 +63766,11 @@ declare namespace __esri { */ autoSelect: boolean; /** - * A read-only property that is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of 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. + * A read-only property that is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [LayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html) and/or [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html). This property may contain [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) [locators](http://enterprise.arcgis.com/en/server/latest/publish-services/windows/geocode-services.htm) and any web map or web scene [configurable search sources](http://doc.arcgis.com/en/arcgis-online/create-maps/configure-feature-search.htm). This property is used to populate the Search UI if the [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) property is not set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) */ - readonly defaultSources: Collection; + readonly defaultSources: Collection; /** * The default [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the search result. * @@ -57892,8 +63910,8 @@ declare namespace __esri { */ readonly selectedSuggestion: Geometry | SearchViewModelSuggestResult; /** - * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: - * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + * The Search widget may be used to search features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.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: + * * [LayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html) * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) * * @@ -57901,7 +63919,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) */ - sources: Collection; + sources: Collection; /** * The current state of the widget. This property was removed from [Search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) and should now be accessed within the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html). **Possible Values:** ready | disabled | searching | loading * @@ -58125,8 +64143,8 @@ declare namespace __esri { */ searchTerm?: string; /** - * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: - * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + * The Search widget may be used to search features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.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: + * * [LayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html) * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) * * @@ -58134,7 +64152,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) */ - sources?: CollectionProperties; + sources?: CollectionProperties; /** * The millisecond delay after keyup and before making a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) network request. * @@ -58801,12 +64819,18 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#createGraphic) */ readonly createGraphic: Graphic; + /** + * Default update options set for the Sketch widget. 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.html#update) method is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) + */ + readonly defaultUpdateOptions: SketchDefaultUpdateOptions; /** * 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; + 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. * @@ -58834,11 +64858,11 @@ declare namespace __esri { */ 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. + * 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 Sketch widget to a specific view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#view) */ - view: MapView; + view: MapView | SceneView; /** * 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. * @@ -58869,7 +64893,7 @@ declare namespace __esri { */ 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. + * 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. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#create) * @@ -58923,28 +64947,28 @@ declare namespace __esri { * * [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 graphics A graphic or 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.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. + * transform | This is the *default* tool for graphics with a [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometry, [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometry or graphics that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) with a [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting the `enableRotation`, `enableScaling` or `preserveAspectRatio` arguments when calling the `update` method or setting them on the [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) property when the Sketch widget initializes. + * reshape | This tool 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 a single graphic that has a [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) geometry. + * move | This is the *default* tool for graphics with a [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry that do not use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). 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 the `move` operation is built into both the `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.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` and is always `true` when transforming points that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). * @param updateOptions.toggleToolOnClick Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. * */ - update(graphics: Graphic[], updateOptions?: SketchUpdateUpdateOptions): void; + update(graphics: Graphic | Graphic[], updateOptions?: SketchUpdateUpdateOptions): IPromise; } 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. + * Sketch widget provides a simple UI for creating and updating graphics on 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 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) */ @@ -58955,6 +64979,12 @@ declare namespace __esri { export const Sketch: SketchConstructor; interface SketchProperties extends WidgetProperties { + /** + * The Sketch widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#iconClass) + */ + 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. * @@ -58970,11 +65000,11 @@ declare namespace __esri { */ 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. + * 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 Sketch widget to a specific view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#view) */ - view?: MapViewProperties; + view?: MapViewProperties | SceneViewProperties; /** * 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. * @@ -58997,11 +65027,11 @@ declare namespace __esri { */ 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. + * Default update options set for the SketchViewModel. Update options set on this property will be overridden by options passed to the [update()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) method. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) */ - readonly defaultUpdateOptions: SketchViewModelDefaultUpdateOptions; + 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. * @@ -59078,7 +65108,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#view) */ - view: MapView; + view: MapView | SceneView; /** * 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`. @@ -59097,7 +65127,7 @@ declare namespace __esri { */ complete(): void; /** - * 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. + * 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. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#create) * @@ -59143,23 +65173,23 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) * - * @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 graphics A graphic or 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. + * transform | This is the *default* tool for graphics with a [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometry, [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometry or graphics that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) with a [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting the `enableRotation`, `enableScaling` or `preserveAspectRatio` arguments when calling the `update` method or setting them on the [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) property when the Sketch widget initializes. + * reshape | This tool 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 a single graphic that has a [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) geometry. + * move | This is the *default* tool for graphics with a [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry that do not use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). 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 the `move` operation is built into both the `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.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` and is always `true` when transforming points that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). * @param updateOptions.toggleToolOnClick Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. * */ - update(graphics: Graphic[], updateOptions?: SketchViewModelUpdateUpdateOptions): void; + update(graphics: Graphic | Graphic[], updateOptions?: SketchViewModelUpdateUpdateOptions): IPromise; } interface SketchViewModelConstructor { @@ -59175,6 +65205,12 @@ declare namespace __esri { export const SketchViewModel: SketchViewModelConstructor; interface SketchViewModelProperties { + /** + * Default update options set for the SketchViewModel. Update options set on this property will be overridden by options passed to the [update()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + */ + 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. * @@ -59239,7 +65275,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#view) */ - view?: MapViewProperties; + view?: MapViewProperties | SceneViewProperties; } export interface SketchViewModelCreateCreateOptions extends Object { @@ -59260,13 +65296,13 @@ declare namespace __esri { 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. + * Name of the update tool. The default tool is `transform` for graphics with polygon and polyline geometries and `move` for graphics with point and multipoint geometries. However, if a graphic with point geometry uses a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), the default tool is `transform`. * * [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. + * 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#defaultUpdateOptions) * @@ -59274,7 +65310,7 @@ declare namespace __esri { */ enableRotation?: boolean; /** - * Indicates if the `scale` operation will be enabled when updating graphics. + * 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#defaultUpdateOptions) * @@ -59282,7 +65318,15 @@ declare namespace __esri { */ 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`. + * Indicates whether more than one selection can be made at once. This pertains to shift+click interaction with the `transform` tool. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default true + */ + multipleSelectionEnabled?: 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` and is always `true` when transforming points that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) * @@ -59305,9 +65349,9 @@ declare namespace __esri { * * 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. + * transform | This is the *default* tool for graphics with a [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometry, [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometry or graphics that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) with a [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting the `enableRotation`, `enableScaling` or `preserveAspectRatio` arguments when calling the `update` method or setting them on the [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) property when the Sketch widget initializes. + * reshape | This tool 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 a single graphic that has a [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) geometry. + * move | This is the *default* tool for graphics with a [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry that do not use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). 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 the `move` operation is built into both the `transform` and `reshape` tools by default. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) @@ -59330,7 +65374,7 @@ declare namespace __esri { */ 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`. + * 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` and is always `true` when transforming points that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) * @@ -59510,15 +65554,64 @@ declare namespace __esri { mode?: string; } + export interface SketchDefaultUpdateOptions extends Object { + /** + * Name of the update tool. The default tool is `transform` for graphics with polygon and polyline geometries and `move` for graphics with point and multipoint geometries. However, if a graphic with point geometry uses a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), the default tool is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) + */ + 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#defaultUpdateOptions) + * + * @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#defaultUpdateOptions) + * + * @default true + */ + enableScaling?: boolean; + /** + * Indicates whether more than one selection can be made at once. This pertains to shift+click interaction with the `transform` tool. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) + * + * @default true + */ + multipleSelectionEnabled?: 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` and is always `true` when transforming points that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.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.html#defaultUpdateOptions) + * + * @default true + */ + toggleToolOnClick?: boolean; + } + 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. + * transform | This is the *default* tool for graphics with a [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometry, [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometry or graphics that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) with a [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting the `enableRotation`, `enableScaling` or `preserveAspectRatio` arguments when calling the `update` method or setting them on the [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) property when the Sketch widget initializes. + * reshape | This tool 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 a single graphic that has a [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) geometry. + * move | This is the *default* tool for graphics with a [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry that do not use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). 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 the `move` operation is built into both the `transform` and `reshape` tools by default. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) @@ -59541,7 +65634,7 @@ declare namespace __esri { */ 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`. + * 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` and is always `true` when transforming points that use a [3D object symbol layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) * @@ -59683,6 +65776,7 @@ declare namespace __esri { * disabled | not ready yet * ready | ready for slicing * slicing | currently slicing + * sliced | finished slicing * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#state) @@ -59966,13 +66060,7 @@ declare namespace __esri { * * [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; + 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-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). * @@ -60071,6 +66159,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#graphic) */ graphic?: GraphicProperties; + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.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-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). * @@ -60389,16 +66483,15 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id) */ id: string; + /** + * The widget's label. This property is useful whenever the widget is controlled by another one (e.g. [Expand](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html)) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#label) + */ + label: string; /** * 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) * @@ -60480,6 +66573,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id) */ id?: string; + /** + * The widget's label. This property is useful whenever the widget is controlled by another one (e.g. [Expand](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html)) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#label) + */ + label?: string; } interface Widgette { @@ -60547,13 +66646,7 @@ declare namespace __esri { * * [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; + iconClass: string; /** * Determines the layout/orientation of the Zoom widget. **Possible Values:** vertical | horizontal * @@ -60614,6 +66707,12 @@ declare namespace __esri { export const Zoom: ZoomConstructor; interface ZoomProperties extends WidgetProperties { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#iconClass) + */ + iconClass?: string; /** * Determines the layout/orientation of the Zoom widget. **Possible Values:** vertical | horizontal * @@ -60841,6 +66940,11 @@ declare module "esri/PopupTemplate" { export = PopupTemplate; } +declare module "esri/TimeExtent" { + import TimeExtent = __esri.TimeExtent; + export = TimeExtent; +} + declare module "esri/Viewpoint" { import Viewpoint = __esri.Viewpoint; export = Viewpoint; @@ -60926,11 +67030,6 @@ declare module "esri/geometry/Polyline" { export = Polyline; } -declare module "esri/geometry/ScreenPoint" { - import ScreenPoint = __esri.ScreenPoint; - export = ScreenPoint; -} - declare module "esri/geometry/SpatialReference" { import SpatialReference = __esri.SpatialReference; export = SpatialReference; @@ -60951,6 +67050,16 @@ declare module "esri/geometry/support/MeshComponent" { export = MeshComponent; } +declare module "esri/geometry/support/MeshMaterial" { + import MeshMaterial = __esri.MeshMaterial; + export = MeshMaterial; +} + +declare module "esri/geometry/support/MeshTexture" { + import MeshTexture = __esri.MeshTexture; + export = MeshTexture; +} + declare module "esri/geometry/support/ValueMeshColor" { import ValueMeshColor = __esri.ValueMeshColor; export = ValueMeshColor; @@ -61011,6 +67120,11 @@ declare module "esri/layers/FeatureLayer" { export = FeatureLayer; } +declare module "esri/layers/GeoJSONLayer" { + import GeoJSONLayer = __esri.GeoJSONLayer; + export = GeoJSONLayer; +} + declare module "esri/layers/GeoRSSLayer" { import GeoRSSLayer = __esri.GeoRSSLayer; export = GeoRSSLayer; @@ -61261,6 +67375,11 @@ declare module "esri/layers/support/TileMatrixSet" { export = TileMatrixSet; } +declare module "esri/layers/support/TimeInfo" { + import TimeInfo = __esri.TimeInfo; + export = TimeInfo; +} + declare module "esri/layers/support/WMSSublayer" { import WMSSublayer = __esri.WMSSublayer; export = WMSSublayer; @@ -61321,6 +67440,11 @@ declare module "esri/renderers/ClassBreaksRenderer" { export = ClassBreaksRenderer; } +declare module "esri/renderers/DotDensityRenderer" { + import DotDensityRenderer = __esri.DotDensityRenderer; + export = DotDensityRenderer; +} + declare module "esri/renderers/HeatmapRenderer" { import HeatmapRenderer = __esri.HeatmapRenderer; export = HeatmapRenderer; @@ -61341,6 +67465,11 @@ declare module "esri/renderers/UniqueValueRenderer" { export = UniqueValueRenderer; } +declare module "esri/renderers/StretchRenderer" { + import StretchRenderer = __esri.StretchRenderer; + export = StretchRenderer; +} + declare module "esri/renderers/PointCloudRenderer" { import PointCloudRenderer = __esri.PointCloudRenderer; export = PointCloudRenderer; @@ -61366,6 +67495,11 @@ declare module "esri/renderers/PointCloudUniqueValueRenderer" { export = PointCloudUniqueValueRenderer; } +declare module "esri/renderers/support/AttributeColorInfo" { + import AttributeColorInfo = __esri.AttributeColorInfo; + export = AttributeColorInfo; +} + declare module "esri/renderers/support/AuthoringInfo" { import AuthoringInfo = __esri.AuthoringInfo; export = AuthoringInfo; @@ -61431,109 +67565,99 @@ declare module "esri/support/actions/ActionToggle" { export = ActionToggle; } -declare module "esri/support/ExpressionInfo" { +declare module "esri/popup/ExpressionInfo" { import ExpressionInfo = __esri.ExpressionInfo; export = ExpressionInfo; } -declare module "esri/support/FieldInfo" { +declare module "esri/popup/FieldInfo" { import FieldInfo = __esri.FieldInfo; export = FieldInfo; } -declare module "esri/support/LayerOptions" { +declare module "esri/popup/LayerOptions" { import LayerOptions = __esri.LayerOptions; export = LayerOptions; } -declare module "esri/support/RelatedRecordsInfo" { +declare module "esri/popup/RelatedRecordsInfo" { import RelatedRecordsInfo = __esri.RelatedRecordsInfo; export = RelatedRecordsInfo; } -declare module "esri/support/ContentElement/Attachments" { - import Attachments = __esri.Attachments; - export = Attachments; +declare module "esri/popup/content/AttachmentsContent" { + import AttachmentsContent = __esri.AttachmentsContent; + export = AttachmentsContent; } -declare module "esri/support/ContentElement/ContentElement" { - import ContentElementContentElement = __esri.ContentElementContentElement; - export = ContentElementContentElement; +declare module "esri/popup/content/BarChartMediaInfo" { + import BarChartMediaInfo = __esri.BarChartMediaInfo; + export = BarChartMediaInfo; } -declare module "esri/support/ContentElement/Fields" { - import Fields = __esri.Fields; - export = Fields; +declare module "esri/popup/content/ColumnChartMediaInfo" { + import ColumnChartMediaInfo = __esri.ColumnChartMediaInfo; + export = ColumnChartMediaInfo; } -declare module "esri/support/ContentElement/Media" { - import Media = __esri.Media; - export = Media; +declare module "esri/popup/content/Content" { + import Content = __esri.Content; + export = Content; } -declare module "esri/support/ContentElement/Text" { - import Text = __esri.Text; - export = Text; +declare module "esri/popup/content/FieldsContent" { + import FieldsContent = __esri.FieldsContent; + export = FieldsContent; } -declare module "esri/support/ContentElement/Media/BarChart" { - import BarChart = __esri.BarChart; - export = BarChart; +declare module "esri/popup/content/ImageMediaInfo" { + import ImageMediaInfo = __esri.ImageMediaInfo; + export = ImageMediaInfo; } -declare module "esri/support/ContentElement/Media/Chart" { - import Chart = __esri.Chart; - export = Chart; +declare module "esri/popup/content/MediaContent" { + import MediaContent = __esri.MediaContent; + export = MediaContent; } -declare module "esri/support/ContentElement/Media/ColumnChart" { - import ColumnChart = __esri.ColumnChart; - export = ColumnChart; +declare module "esri/popup/content/LineChartMediaInfo" { + import LineChartMediaInfo = __esri.LineChartMediaInfo; + export = LineChartMediaInfo; } -declare module "esri/support/ContentElement/Media/LineChart" { - import LineChart = __esri.LineChart; - export = LineChart; +declare module "esri/popup/content/PieChartMediaInfo" { + import PieChartMediaInfo = __esri.PieChartMediaInfo; + export = PieChartMediaInfo; } -declare module "esri/support/ContentElement/Media/Media" { - import MediaMedia = __esri.MediaMedia; - export = MediaMedia; +declare module "esri/popup/content/TextContent" { + import TextContent = __esri.TextContent; + export = TextContent; } -declare module "esri/support/ContentElement/Media/PieChart" { - import PieChart = __esri.PieChart; - export = PieChart; +declare module "esri/popup/content/support/ChartMediaInfoValue" { + import ChartMediaInfoValue = __esri.ChartMediaInfoValue; + export = ChartMediaInfoValue; } -declare module "esri/support/ContentElement/Media/Chart/Series" { - import Series = __esri.Series; - export = Series; +declare module "esri/popup/content/support/ChartMediaInfoValueSeries" { + import ChartMediaInfoValueSeries = __esri.ChartMediaInfoValueSeries; + export = ChartMediaInfoValueSeries; } -declare module "esri/support/ContentElement/Media/Chart/Value" { - import Value = __esri.Value; - export = Value; +declare module "esri/popup/content/support/ImageMediaInfoValue" { + import ImageMediaInfoValue = __esri.ImageMediaInfoValue; + export = ImageMediaInfoValue; } -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" { +declare module "esri/popup/support/FieldInfoFormat" { import FieldInfoFormat = __esri.FieldInfoFormat; export = FieldInfoFormat; } -declare module "esri/support/RelatedRecordsInfo/FieldOrder" { - import FieldOrder = __esri.FieldOrder; - export = FieldOrder; +declare module "esri/popup/support/RelatedRecordsInfoFieldOrder" { + import RelatedRecordsInfoFieldOrder = __esri.RelatedRecordsInfoFieldOrder; + export = RelatedRecordsInfoFieldOrder; } declare module "esri/symbols/ExtrudeSymbol3DLayer" { @@ -61756,6 +67880,11 @@ declare module "esri/tasks/support/AddressCandidate" { export = AddressCandidate; } +declare module "esri/tasks/support/AlgorithmicColorRamp" { + import AlgorithmicColorRamp = __esri.AlgorithmicColorRamp; + export = AlgorithmicColorRamp; +} + declare module "esri/tasks/support/AreasAndLengthsParameters" { import AreasAndLengthsParameters = __esri.AreasAndLengthsParameters; export = AreasAndLengthsParameters; @@ -61781,6 +67910,11 @@ declare module "esri/tasks/support/ClosestFacilitySolveResult" { export = ClosestFacilitySolveResult; } +declare module "esri/tasks/support/ColorRamp" { + import ColorRamp = __esri.ColorRamp; + export = ColorRamp; +} + declare module "esri/tasks/support/DataFile" { import DataFile = __esri.DataFile; export = DataFile; @@ -61876,6 +68010,11 @@ declare module "esri/tasks/support/LinearUnit" { export = LinearUnit; } +declare module "esri/tasks/support/MultipartColorRamp" { + import MultipartColorRamp = __esri.MultipartColorRamp; + export = MultipartColorRamp; +} + declare module "esri/tasks/support/NAMessage" { import NAMessage = __esri.NAMessage; export = NAMessage; @@ -62042,7 +68181,7 @@ declare module "esri/views/layers/LayerView" { } declare module "esri/views/layers/CSVLayerView" { - import CSVLayerView = __esri.CSVLayerView; + type CSVLayerView = __esri.CSVLayerView; export = CSVLayerView; } @@ -62051,8 +68190,18 @@ declare module "esri/views/layers/FeatureLayerView" { export = FeatureLayerView; } +declare module "esri/views/layers/GeoJSONLayerView" { + type GeoJSONLayerView = __esri.GeoJSONLayerView; + export = GeoJSONLayerView; +} + +declare module "esri/views/layers/GeoRSSLayerView" { + type GeoRSSLayerView = __esri.GeoRSSLayerView; + export = GeoRSSLayerView; +} + declare module "esri/views/layers/GraphicsLayerView" { - import GraphicsLayerView = __esri.GraphicsLayerView; + type GraphicsLayerView = __esri.GraphicsLayerView; export = GraphicsLayerView; } @@ -62062,12 +68211,12 @@ declare module "esri/views/layers/ImageryLayerView" { } declare module "esri/views/layers/KMLLayerView" { - import KMLLayerView = __esri.KMLLayerView; + type KMLLayerView = __esri.KMLLayerView; export = KMLLayerView; } declare module "esri/views/layers/SceneLayerView" { - import SceneLayerView = __esri.SceneLayerView; + type SceneLayerView = __esri.SceneLayerView; export = SceneLayerView; } @@ -62076,6 +68225,16 @@ declare module "esri/views/layers/StreamLayerView" { export = StreamLayerView; } +declare module "esri/views/layers/support/FeatureFilter" { + import FeatureFilter = __esri.FeatureFilter; + export = FeatureFilter; +} + +declare module "esri/views/layers/support/FeatureEffect" { + import FeatureEffect = __esri.FeatureEffect; + export = FeatureEffect; +} + declare module "esri/views/ui/UI" { import UI = __esri.UI; export = UI; @@ -62091,41 +68250,51 @@ declare module "esri/views/2d/ViewState" { export = ViewState; } -declare module "esri/views/2d/draw/Draw" { +declare module "esri/views/draw/Draw" { import Draw = __esri.Draw; export = Draw; } -declare module "esri/views/2d/draw/DrawAction" { +declare module "esri/views/draw/DrawAction" { import DrawAction = __esri.DrawAction; export = DrawAction; } -declare module "esri/views/2d/draw/PointDrawAction" { +declare module "esri/views/draw/PointDrawAction" { import PointDrawAction = __esri.PointDrawAction; export = PointDrawAction; } -declare module "esri/views/2d/draw/PolylineDrawAction" { +declare module "esri/views/draw/PolylineDrawAction" { import PolylineDrawAction = __esri.PolylineDrawAction; export = PolylineDrawAction; } -declare module "esri/views/2d/draw/PolygonDrawAction" { +declare module "esri/views/draw/PolygonDrawAction" { import PolygonDrawAction = __esri.PolygonDrawAction; export = PolygonDrawAction; } -declare module "esri/views/2d/draw/MultipointDrawAction" { +declare module "esri/views/draw/MultipointDrawAction" { import MultipointDrawAction = __esri.MultipointDrawAction; export = MultipointDrawAction; } -declare module "esri/views/2d/draw/SegmentDrawAction" { +declare module "esri/views/draw/SegmentDrawAction" { import SegmentDrawAction = __esri.SegmentDrawAction; export = SegmentDrawAction; } +declare module "esri/views/2d/layers/BaseLayerView2D" { + import BaseLayerView2D = __esri.BaseLayerView2D; + export = BaseLayerView2D; +} + +declare module "esri/views/2d/layers/BaseLayerViewGL2D" { + import BaseLayerViewGL2D = __esri.BaseLayerViewGL2D; + export = BaseLayerViewGL2D; +} + declare module "esri/webmap/Bookmark" { import Bookmark = __esri.Bookmark; export = Bookmark; @@ -62136,6 +68305,11 @@ declare module "esri/webmap/InitialViewProperties" { export = InitialViewProperties; } +declare module "esri/webmap/background/ColorBackground" { + import ColorBackground = __esri.ColorBackground; + export = ColorBackground; +} + declare module "esri/webscene/ApplicationProperties" { import ApplicationProperties = __esri.ApplicationProperties; export = ApplicationProperties; @@ -62192,8 +68366,8 @@ declare module "esri/webscene/background/Background" { } declare module "esri/webscene/background/ColorBackground" { - import ColorBackground = __esri.ColorBackground; - export = ColorBackground; + import backgroundColorBackground = __esri.backgroundColorBackground; + export = backgroundColorBackground; } declare module "esri/widgets/AreaMeasurement2D" { @@ -62256,6 +68430,11 @@ declare module "esri/widgets/DistanceMeasurement2D" { export = DistanceMeasurement2D; } +declare module "esri/widgets/Editor" { + import Editor = __esri.Editor; + export = Editor; +} + declare module "esri/widgets/Expand" { import Expand = __esri.Expand; export = Expand; @@ -62431,6 +68610,16 @@ declare module "esri/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewMode export = DistanceMeasurement2DViewModel; } +declare module "esri/widgets/Editor/EditorViewModel" { + import EditorViewModel = __esri.EditorViewModel; + export = EditorViewModel; +} + +declare module "esri/widgets/Editor/Workflow" { + import Workflow = __esri.Workflow; + export = Workflow; +} + declare module "esri/widgets/Expand/ExpandViewModel" { import ExpandViewModel = __esri.ExpandViewModel; export = ExpandViewModel; @@ -62506,6 +68695,16 @@ declare module "esri/widgets/LayerList/ListItemPanel" { export = ListItemPanel; } +declare module "esri/widgets/Legend/LegendViewModel" { + import LegendViewModel = __esri.LegendViewModel; + export = LegendViewModel; +} + +declare module "esri/widgets/Legend/support/ActiveLayerInfo" { + import ActiveLayerInfo = __esri.ActiveLayerInfo; + export = ActiveLayerInfo; +} + declare module "esri/widgets/Locate/LocateViewModel" { import LocateViewModel = __esri.LocateViewModel; export = LocateViewModel; @@ -62536,9 +68735,9 @@ declare module "esri/widgets/ScaleBar/ScaleBarViewModel" { export = ScaleBarViewModel; } -declare module "esri/widgets/Search/FeatureLayerSearchSource" { - import FeatureLayerSearchSource = __esri.FeatureLayerSearchSource; - export = FeatureLayerSearchSource; +declare module "esri/widgets/Search/LayerSearchSource" { + import LayerSearchSource = __esri.LayerSearchSource; + export = LayerSearchSource; } declare module "esri/widgets/Search/LocatorSearchSource" { @@ -62561,6 +68760,11 @@ declare module "esri/widgets/Search/SearchViewModel" { export = SearchViewModel; } +declare module "esri/widgets/Sketch/SketchViewModel" { + import SketchViewModel = __esri.SketchViewModel; + export = SketchViewModel; +} + declare module "esri/widgets/Slice/SliceViewModel" { import SliceViewModel = __esri.SliceViewModel; export = SliceViewModel; @@ -62576,11 +68780,6 @@ declare module "esri/widgets/Zoom/ZoomViewModel" { export = ZoomViewModel; } -declare module "esri/widgets/Sketch/SketchViewModel" { - import SketchViewModel = __esri.SketchViewModel; - export = SketchViewModel; -} - declare module "esri/core/Evented" { import Evented = __esri.Evented; export = Evented; @@ -62601,11 +68800,6 @@ declare module "esri/core/Promise" { export = corePromise; } -declare module "esri/layers/DynamicLayer" { - import DynamicLayer = __esri.DynamicLayer; - export = DynamicLayer; -} - declare module "esri/layers/mixins/ArcGISCachedService" { import ArcGISCachedService = __esri.ArcGISCachedService; export = ArcGISCachedService; @@ -62646,6 +68840,11 @@ declare module "esri/layers/mixins/SublayersOwner" { export = SublayersOwner; } +declare module "esri/layers/mixins/TemporalLayer" { + import TemporalLayer = __esri.TemporalLayer; + export = TemporalLayer; +} + declare module "esri/renderers/mixins/VisualVariablesRenderer" { import VisualVariablesRenderer = __esri.VisualVariablesRenderer; export = VisualVariablesRenderer; @@ -62656,6 +68855,16 @@ declare module "esri/support/actions/ActionBase" { export = ActionBase; } +declare module "esri/popup/content/mixins/ChartMediaInfo" { + import ChartMediaInfo = __esri.ChartMediaInfo; + export = ChartMediaInfo; +} + +declare module "esri/popup/content/mixins/MediaInfo" { + import MediaInfo = __esri.MediaInfo; + export = MediaInfo; +} + declare module "esri/support/LayersMixin" { import LayersMixin = __esri.LayersMixin; export = LayersMixin; @@ -62671,6 +68880,11 @@ declare module "esri/views/DOMContainer" { export = DOMContainer; } +declare module "esri/views/MapViewBase" { + import MapViewBase = __esri.MapViewBase; + export = MapViewBase; +} + declare module "esri/widgets/Widgette" { import Widgette = __esri.Widgette; export = Widgette; @@ -62806,11 +69020,21 @@ declare module "esri/geometry/support/webMercatorUtils" { export = webMercatorUtils; } +declare module "esri/layers/support/fieldUtils" { + import fieldUtils = __esri.fieldUtils; + export = fieldUtils; +} + declare module "esri/renderers/smartMapping/creators/color" { import color = __esri.color; export = color; } +declare module "esri/renderers/smartMapping/creators/heatmap" { + import heatmap = __esri.heatmap; + export = heatmap; +} + declare module "esri/renderers/smartMapping/creators/location" { import location = __esri.location; export = location; @@ -62851,6 +69075,11 @@ declare module "esri/renderers/smartMapping/statistics/classBreaks" { export = classBreaks; } +declare module "esri/renderers/smartMapping/statistics/heatmapStatistics" { + import heatmapStatistics = __esri.heatmapStatistics; + export = heatmapStatistics; +} + declare module "esri/renderers/smartMapping/statistics/histogram" { import histogram = __esri.histogram; export = histogram; @@ -62871,6 +69100,11 @@ declare module "esri/renderers/smartMapping/symbology/color" { export = symbologyColor; } +declare module "esri/renderers/smartMapping/symbology/heatmap" { + import symbologyHeatmap = __esri.symbologyHeatmap; + export = symbologyHeatmap; +} + declare module "esri/renderers/smartMapping/symbology/location" { import symbologyLocation = __esri.symbologyLocation; export = symbologyLocation; @@ -62901,9 +69135,9 @@ declare module "esri/renderers/support/jsonUtils" { export = supportJsonUtils; } -declare module "esri/support/ContentElement" { - import ContentElement = __esri.ContentElement; - export = ContentElement; +declare module "esri/popup/content" { + import content = __esri.content; + export = content; } declare module "esri/symbols/support/jsonUtils" { @@ -62916,9 +69150,9 @@ declare module "esri/symbols/support/symbolPreview" { export = symbolPreview; } -declare module "esri/views/2d/layers/BaseLayerView2D" { - import BaseLayerView2D = __esri.BaseLayerView2D; - export = BaseLayerView2D; +declare module "esri/symbols/support/symbolUtils" { + import symbolUtils = __esri.symbolUtils; + export = symbolUtils; } declare module "esri/views/3d/externalRenderers" { diff --git a/types/arcgis-js-api/tslint.json b/types/arcgis-js-api/tslint.json index e3610fefae..89955128d5 100644 --- a/types/arcgis-js-api/tslint.json +++ b/types/arcgis-js-api/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/arcgis-js-api/v3/index.d.ts b/types/arcgis-js-api/v3/index.d.ts index e38c5c0356..e595cdb9cc 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.27 +// Type definitions for ArcGIS API for JavaScript 3.28 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Bjorn Svensson @@ -3477,19 +3477,19 @@ declare module "esri/basemaps" { var basemaps: { /** The Light Gray Canvas basemap is designed to be used as a neutral background map for overlaying and emphasizing other map layers. */ gray: any; - /** The World Imagery map is a detailed imagery map layer and labels that is designed to be used as a basemap for various maps and applications. */ + /** The World Imagery with Labels map is a detailed imagery map layer and labels that is designed to be used as a basemap for various maps and applications: https://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer */ hybrid: any; /** The Ocean Basemap is designed to be used as a basemap by marine GIS professionals and as a reference map by anyone interested in ocean data. */ oceans: any; /** The OpenStreetMap is a community map layer that is designed to be used as a basemap for various maps and applications. */ osm: any; - /** The World Imagery map is a detailed imagery map layer that is designed to be used as a basemap for various maps and applications. */ + /** The World Imagery map is a detailed imagery map layer that is designed to be used as a basemap for various maps and applications: https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer. */ satellite: any; - /** The Streets basemap presents a multiscale street map for the world. */ + /** The Streets basemap presents a multiscale street map for the world: https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer. */ streets: any; /** The Terrain with Labels basemap is designed to be used to overlay and emphasize other thematic map layers. */ terrain: any; - /** The Topographic map includes boundaries, cities, water features, physiographic features, parks, landmarks, transportation, and buildings. */ + /** The Topographic map includes boundaries, cities, water features, physiographic features, parks, landmarks, transportation, and buildings: https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer */ topo: any; }; export = basemaps; @@ -9228,8 +9228,9 @@ declare module "esri/lang" { * @param data The data object used in the substitution. * @param template The template used for the substitution. * @param first When true, returns only the first property found in the data object. + * @param format The format object used in the substitution. */ - substitute(data: any, template?: string, first?: boolean): string; + substitute(data: any, template?: string, first?: boolean, format?: any): string; /** * Iterates through the argument array and searches for the identifier to which the argument value matches. * @param array The argument array for testing. @@ -10000,6 +10001,8 @@ declare module "esri/layers/FeatureLayer" { displayField: string; /** Indicates the field names for the editor fields. */ editFieldsInfo: any; + /** Applicable to ArcGIS Online hosted feature services. */ + editingInfo: any; /** The array of fields in the layer. */ fields: Field[]; /** The full extent of the layer. */ @@ -10054,6 +10057,8 @@ declare module "esri/layers/FeatureLayer" { supportsAttachmentsByUploadId: boolean; /** When true, the layer supports the Calculate REST operation when updating features. */ supportsCalculate: boolean; + /** If true, the layer supports a user-defined field description. */ + supportsFieldDescription: boolean; /** When true, the layer supports statistical functions in query operations. */ supportsStatistics: boolean; /** When true, the layer is suspended. */ @@ -10468,6 +10473,8 @@ declare module "esri/layers/Field" { class Field { /** The alias name for the field. */ alias: string; + /** A string that describes the default value set for a field. */ + defaultValue: string; /** Domain associated with the field. */ domain: Domain; /** Indicates whether the field is editable. */ diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index a9cafca24b..a25b018c11 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -41,6 +41,8 @@ declare namespace archiver { class ArchiverError extends Error { code: string; // Since archiver format support is modular, we cannot enumerate all possible error codes, as the modules can throw arbitrary ones. data: any; + path?: any; + constructor(code: string, data: any); } diff --git a/types/archiver/tslint.json b/types/archiver/tslint.json index 10e16aef18..7bfbd50b5b 100644 --- a/types/archiver/tslint.json +++ b/types/archiver/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "ban-types": false, + "npm-naming": false, "dt-header": false } } diff --git a/types/archy/tslint.json b/types/archy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/archy/tslint.json +++ b/types/archy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/argv/tslint.json b/types/argv/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/argv/tslint.json +++ b/types/argv/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/array-foreach/tslint.json b/types/array-foreach/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/array-foreach/tslint.json +++ b/types/array-foreach/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asana/tslint.json b/types/asana/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asana/tslint.json +++ b/types/asana/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asciify/tslint.json b/types/asciify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asciify/tslint.json +++ b/types/asciify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/asn1js/tslint.json b/types/asn1js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/asn1js/tslint.json +++ b/types/asn1js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aspnet-identity-pw/tslint.json b/types/aspnet-identity-pw/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aspnet-identity-pw/tslint.json +++ b/types/aspnet-identity-pw/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/assertsharp/tslint.json b/types/assertsharp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/assertsharp/tslint.json +++ b/types/assertsharp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts b/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts index b02c707d81..838ac825ea 100644 --- a/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts +++ b/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts @@ -8,15 +8,21 @@ const config: webpack.Configuration = { filename: 'assets.json' }), new AssetsPlugin({ + entrypoints: true, filename: 'assets.json', fullPath: false, + fileTypes: ['css'], includeManifest: true, + includeAllFileTypes: false, + keepInMemory: true, + manifestFirst: true, path: '/foo/bar', prettyPrint: true, processOutput: (assets) => ( 'window.assets = ' + JSON.stringify(assets) ), update: true, + useCompilerPath: true, metadata: { meta: 'data' }, diff --git a/types/assets-webpack-plugin/index.d.ts b/types/assets-webpack-plugin/index.d.ts index 63563d6298..397002add3 100644 --- a/types/assets-webpack-plugin/index.d.ts +++ b/types/assets-webpack-plugin/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for assets-webpack-plugin 3.5 +// Type definitions for assets-webpack-plugin 3.9 // Project: https://github.com/ztoben/assets-webpack-plugin // Definitions by: Michael Strobel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,18 +16,36 @@ declare namespace AssetsWebpackPlugin { type ProcessOutputFn = (assets: Assets) => string; interface Options { + /** + * If the "entrypoints" option is given, the output will be limited to the entrypoints and the chunks associated with them. + * false by default + */ + entrypoints?: boolean; + /** * Name for the created json file. * "webpack-assets.json" by default */ filename?: string; + /** + * When set and "includeAllFileTypes" is set false, only assets matching these types will be included in the assets file. + * ['js', 'css'] by default + */ + fileTypes?: string[]; + /** * If false the output will not include the full path of the generated file. * true by default */ fullPath?: boolean; + /** + * When set false, falls back to the "fileTypes" option array to decide which file types to include in the assets file. + * true by default + */ + includeAllFileTypes?: boolean; + /** * Inserts the manifest javascript as a text property in your assets. * Accepts the name of your manifest chunk. @@ -38,6 +56,19 @@ declare namespace AssetsWebpackPlugin { */ includeManifest?: boolean; + /** + * When set the assets file will only be generated in memory while running webpack-dev-server and not written to disk. + * false by default + */ + keepInMemory?: boolean; + + /** + * Orders the assets output so that manifest is the first entry. + * This is useful for cases where script tags are generated from the assets json output, and order of import is important. + * false by default + */ + manifestFirst?: boolean; + /** * Inject metadata into the output file. All values will be injected into the key "metadata" */ @@ -66,6 +97,12 @@ declare namespace AssetsWebpackPlugin { * false by default */ update?: boolean; + + /** + * Will override the path to use the compiler output path set in your webpack config. + * false by default + */ + useCompilerPath?: boolean; } } diff --git a/types/async-polling/tslint.json b/types/async-polling/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/async-polling/tslint.json +++ b/types/async-polling/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/async-retry/async-retry-tests.ts b/types/async-retry/async-retry-tests.ts index 20dfc62c4b..83b5ac84cf 100644 --- a/types/async-retry/async-retry-tests.ts +++ b/types/async-retry/async-retry-tests.ts @@ -7,6 +7,7 @@ const o: Options = { minTimeout: 3, maxTimeout: 4, randomize: true, + forever: false, onRetry: (e: Error) => 42 }; diff --git a/types/async-retry/index.d.ts b/types/async-retry/index.d.ts index 6b50c71b63..1ef5fe8be9 100644 --- a/types/async-retry/index.d.ts +++ b/types/async-retry/index.d.ts @@ -1,8 +1,12 @@ -// Type definitions for async-retry 1.2 +// Type definitions for async-retry 1.4 // Project: https://github.com/zeit/async-retry#readme // Definitions by: Albert Wu // Pablo Rodríguez +// Rafał Sawicki // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { OperationOptions } from 'retry'; declare function AsyncRetry( fn: AsyncRetry.RetryFunction, @@ -10,13 +14,8 @@ declare function AsyncRetry( ): Promise; declare namespace AsyncRetry { - interface Options { - retries?: number; - factor?: number; - minTimeout?: number; - maxTimeout?: number; - randomize?: boolean; - onRetry?: (e: Error) => any; + interface Options extends OperationOptions { + onRetry?: (e: Error, attempt: number) => any; } type RetryFunction = (bail: (e: Error) => void, attempt: number) => A|Promise; diff --git a/types/async-writer/tslint.json b/types/async-writer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/async-writer/tslint.json +++ b/types/async-writer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/atmosphere.js/tslint.json b/types/atmosphere.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/atmosphere.js/tslint.json +++ b/types/atmosphere.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/atob/atob-tests.ts b/types/atob/atob-tests.ts index e2e2618387..e9ec4589a5 100644 --- a/types/atob/atob-tests.ts +++ b/types/atob/atob-tests.ts @@ -1,3 +1,3 @@ -import atob from 'atob'; +import atob = require('atob'); atob('foo'); diff --git a/types/atob/index.d.ts b/types/atob/index.d.ts index 1feb3481e8..0da09c74b5 100644 --- a/types/atob/index.d.ts +++ b/types/atob/index.d.ts @@ -4,4 +4,5 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -export default function(str: string): string; +export = _default; +declare function _default(str: string): string; diff --git a/types/atpl/tslint.json b/types/atpl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/atpl/tslint.json +++ b/types/atpl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth-header/index.d.ts b/types/auth-header/index.d.ts index fab462be9e..d5b5a27f77 100644 --- a/types/auth-header/index.d.ts +++ b/types/auth-header/index.d.ts @@ -7,7 +7,7 @@ type Params = | Array<[string, string | ReadonlyArray]> | {[key: string]: string | ReadonlyArray}; -export {Params}; +export { Params }; export interface TokenOptions { scheme: string; diff --git a/types/auth0-angular/tslint.json b/types/auth0-angular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0-angular/tslint.json +++ b/types/auth0-angular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index 6353cc1e40..61ab9bd524 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -179,7 +179,7 @@ webAuth.popup.signupAndLogin({ email: "", password: "", connection: "" }, (err, // do something with data }); -webAuth.login({username: 'bar', password: 'foo'}, (err, data) => {}); +webAuth.login({username: 'bar', password: 'foo', state: '1234'}, (err, data) => {}); webAuth.crossOriginAuthenticationCallback(); diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 7e43da1c89..ac2d32c5ac 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Adrian Chia // Matt Durrant // Peter Blazejewicz +// Bartosz Kotrys // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -703,6 +704,15 @@ export interface CrossOriginLoginOptions { email?: string; password: string; realm?: string; + domain?: string; + clientID?: string; + redirectUri?: string; + responseType?: string; + responseMode?: string; + state?: string; + nonce?: string; + scope?: string; + audience?: string; } export interface LogoutOptions { diff --git a/types/auth0.widget/tslint.json b/types/auth0.widget/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0.widget/tslint.json +++ b/types/auth0.widget/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/auth0/tslint.json b/types/auth0/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/auth0/tslint.json +++ b/types/auth0/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/autobahn/autobahn-tests.ts b/types/autobahn/autobahn-tests.ts index 8f05c25141..420d95a3d1 100644 --- a/types/autobahn/autobahn-tests.ts +++ b/types/autobahn/autobahn-tests.ts @@ -46,4 +46,31 @@ function test_client() { if (!connection.isOpen && !connection.isRetrying && connection.session == null) { connection.open(); } + + var { isConnected, transport: { info: { protocol, type, url } }, defer } = connection; + console.log(isConnected, protocol, type, url, defer); +} + +function test_custom_transport_factory() { + autobahn.transports.register('custom', CustomTransportFactory) + + var CustomFactoryFactory = autobahn.transports.get(''); + var customFactory = new CustomFactoryFactory({}); + var customTransport = customFactory.create() + console.log(customTransport.info); +} + +class CustomTransportFactory { + create(): autobahn.ITransport { + return { + onopen() {}, + onmessage(message: any[]) {}, + onclose(details: autobahn.ICloseEventDetails) {}, + send(message: any[]) {}, + close(errorCode: number, reason?: string) {}, + info: {type: 'custom'} + }; + } + + type: autobahn.TransportType = 'custom' } diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index 9c1d66fb85..cfa07c3518 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for AutobahnJS 0.9 -// Project: http://autobahn.ws/js/, https://github.com/crossbario/autobahn-js -// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier +// Type definitions for AutobahnJS 18.10 +// Project: https://crossbar.io/autobahn/, https://github.com/crossbario/autobahn-js +// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier , Fran Rodriguez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -190,9 +190,12 @@ declare namespace autobahn { export class Connection { constructor(options?: IConnectionOptions); - isOpen: boolean; - isRetrying: boolean; - session?: Session; + readonly isConnected: boolean; + readonly isOpen: boolean; + readonly isRetrying: boolean; + readonly transport: ITransport; + readonly session?: Session; + readonly defer?: DeferFactory; open(): void; @@ -205,7 +208,7 @@ declare namespace autobahn { interface ITransportDefinition { url?: string; protocols?: string[]; - type: string; + type: TransportType; } type DeferFactory = () => When.Promise; @@ -226,7 +229,7 @@ declare namespace autobahn { url?: string; protocols?: string[]; onchallenge?: OnChallengeHandler; - realm?: string; + realm: string; authmethods?: string[]; authid?: string; } @@ -237,6 +240,19 @@ declare namespace autobahn { code: number; } + type DefaultTransportType = 'websocket' | 'longpoll' | 'rawsocket'; + + // Workaround to get intellisense on type unions of 'literals' | string. + // See https://github.com/Microsoft/TypeScript/issues/29729 + type CustomTransportType = string & { zz_IGNORE_ME?: never }; + type TransportType = DefaultTransportType | CustomTransportType; + + interface ITransportInfo { + url?: string; + protocol?: string; + type: TransportType; + } + interface ITransport { onopen: () => void; onmessage: (message: any[]) => void; @@ -244,19 +260,23 @@ declare namespace autobahn { send(message: any[]): void; close(errorCode: number, reason?: string): void; + info: ITransportInfo; } interface ITransportFactory { - // constructor(options: any); - type: string; + type: TransportType; create(): ITransport; } + + interface ITransportFactoryFactory { + new (options: any): ITransportFactory; + } interface ITransports { - register(name: string, factory: any): void; - isRegistered(name: string): boolean; - get(name: string): any; - list(): string[]; + register(name: TransportType, factory: ITransportFactoryFactory): void; + isRegistered(name: TransportType): boolean; + get(name: TransportType): ITransportFactoryFactory; + list(): TransportType[]; } interface ILog { diff --git a/types/autolinker/tslint.json b/types/autolinker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/autolinker/tslint.json +++ b/types/autolinker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/autoprefixer-core/tslint.json b/types/autoprefixer-core/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/autoprefixer-core/tslint.json +++ b/types/autoprefixer-core/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/autoprefixer/index.d.ts b/types/autoprefixer/index.d.ts index faf11371db..1681c5d838 100644 --- a/types/autoprefixer/index.d.ts +++ b/types/autoprefixer/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for autoprefixer 9.1 +// Type definitions for autoprefixer 9.4 // Project: https://github.com/postcss/autoprefixer // Definitions by: Armando Meziat , murt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,7 +15,7 @@ declare namespace autoprefixer { remove?: boolean; supports?: boolean; flexbox?: boolean | 'no-2009'; - grid?: boolean; + grid?: boolean | 'autoplace' | 'no-autoplace'; stats?: any; ignoreUnknownVersions?: boolean; } diff --git a/types/avoscloud-sdk/tslint.json b/types/avoscloud-sdk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/avoscloud-sdk/tslint.json +++ b/types/avoscloud-sdk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/awesomplete/awesomplete-tests.ts b/types/awesomplete/awesomplete-tests.ts index a3c66875a4..b019e25ca3 100644 --- a/types/awesomplete/awesomplete-tests.ts +++ b/types/awesomplete/awesomplete-tests.ts @@ -46,7 +46,7 @@ new Awesomplete('input[data-multiple]', { return Awesomplete.FILTER_CONTAINS(text, input.match(/[^,]*$/)[0]); }, - replace: (text: string) => { + replace(text: string) { const before = this.input.value.match(/^.+,\s*|/)[0]; this.input.value = `${before}${text}, `; } diff --git a/types/aws-iot-device-sdk/tslint.json b/types/aws-iot-device-sdk/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aws-iot-device-sdk/tslint.json +++ b/types/aws-iot-device-sdk/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aws-lambda-mock-context/tslint.json b/types/aws-lambda-mock-context/tslint.json index bafaae7817..f6fabe4180 100644 --- a/types/aws-lambda-mock-context/tslint.json +++ b/types/aws-lambda-mock-context/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // TODO + "npm-naming": false, "dt-header": false } } diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index ad063c20b6..edc2015616 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -8,10 +8,14 @@ declare let num: number; declare let error: Error; declare let bool: boolean; declare let boolOrUndefined: boolean | undefined; +declare let boolOrNumOrStr: boolean | number | string; declare let numOrUndefined: number | undefined; declare let apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; declare let apiGwEvtReqCtxOpt: AWSLambda.APIGatewayEventRequestContext | null | undefined; declare let apiGwEvt: AWSLambda.APIGatewayEvent; +declare let albEvtReqCtx: AWSLambda.ALBEventRequestContext; +declare let albEvt: AWSLambda.ALBEvent; +declare let albRes: AWSLambda.ALBResult; declare let customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent; declare let clientCtx: AWSLambda.ClientContext; declare let clientCtxOrUndefined: AWSLambda.ClientContext | undefined; @@ -125,6 +129,27 @@ str = apiGwEvt.stageVariables!["example"]; apiGwEvtReqCtx = apiGwEvt.requestContext; str = apiGwEvt.resource; +/* Application Load Balancer Event Request Context */ +str = albEvtReqCtx.elb.targetGroupArn; + +/* Application Load Balancer Event */ +str = albEvt.httpMethod; +str = albEvt.path; +str = albEvt.queryStringParameters!["example"]; +str = albEvt.headers!["example"]; +str = albEvt.multiValueQueryStringParameters!["example"][0]; +str = albEvt.multiValueHeaders!["example"][0]; +strOrNull = albEvt.body; +bool = albEvt.isBase64Encoded; + +/* Application Load Balancer Result */ +num = albRes.statusCode; +str = albRes.statusDescription; +boolOrNumOrStr = albRes.headers!["example"]; +boolOrNumOrStr = albRes.multiValueHeaders!["example"][0]; +str = albRes.body; +bool = albRes.isBase64Encoded; + /* API Gateway CustomAuthorizer Event */ str = customAuthorizerEvt.type; str = customAuthorizerEvt.methodArn; @@ -879,6 +904,33 @@ const inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { // Test using default Callback type still works. const defaultCallbackHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +const albSyncHandler: AWSLambda.ALBHandler = ( + event: AWSLambda.ALBEvent, + context: AWSLambda.Context, + cb: AWSLambda.ALBCallback, +) => { + cb(null, { + statusCode: 200, + statusDescription: '200 OK', + headers: { }, + body: '', + isBase64Encoded: false, + }); +}; +const albAsyncHandler: AWSLambda.ALBHandler = async ( + event: AWSLambda.ALBEvent, + context: AWSLambda.Context, + cb: AWSLambda.ALBCallback, +) => { + return { + statusCode: 200, + statusDescription: '200 OK', + headers: { }, + body: '', + isBase64Encoded: false, + }; +}; + // Specific types let s3Handler: AWSLambda.S3Handler = (event: AWSLambda.S3Event, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; // Test old name @@ -1003,7 +1055,15 @@ const SQSEvent: AWSLambda.SQSEvent = { SenderId: "594035263019", ApproximateFirstReceiveTimestamp: "1529104986230" }, - messageAttributes: {}, + messageAttributes: { + testAttr: { + stringValue: "100", + binaryValue: "base64Str", + stringListValues: [], + binaryListValues: [], + dataType: "Number" + } + }, md5OfBody: "9bb58f26192e4ba00f01e2e7b136bbd8", eventSource: "aws:sqs", eventSourceARN: "arn:aws:sqs:us-west-2:594035263019:NOTFIFOQUEUE", @@ -1039,6 +1099,10 @@ const SQSMessageNode8AsyncHandler: AWSLambda.SQSHandler = async ( event; str = event.Records[0].messageId; anyObj = event.Records[0].body; + strOrUndefined = event.Records[0].messageAttributes.testAttr.stringValue; + strOrUndefined = event.Records[0].messageAttributes.testAttr.binaryValue; + str = event.Records[0].messageAttributes.testAttr.dataType; + // $ExpectType Context context; str = context.functionName; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 3301feebb5..72a0edabf9 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -26,6 +26,9 @@ // James Gregory // Erik Dalén // Loïk Gaonac'h +// Roberto Zen +// Richard Cornelissen +// Grzegorz Redlicki // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -34,7 +37,7 @@ export interface APIGatewayEventRequestContext { accountId: string; apiId: string; authorizer?: AuthResponseContext | null; - connectedAt: number; + connectedAt?: number; connectionId?: string; domainName?: string; eventType?: string; @@ -84,6 +87,24 @@ export interface APIGatewayProxyEvent { } export type APIGatewayEvent = APIGatewayProxyEvent; // Old name +// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html +export interface ALBEventRequestContext { + elb: { + targetGroupArn: string; + }; +} +export interface ALBEvent { + requestContext: ALBEventRequestContext; + httpMethod: string; + path: string; + queryStringParameters?: { [parameter: string]: string }; // URL encoded + headers?: { [header: string]: string }; + multiValueQueryStringParameters?: { [parameter: string]: string[] }; // URL encoded + multiValueHeaders?: { [header: string]: string[] }; + body: string | null; + isBase64Encoded: boolean; +} + // API Gateway CustomAuthorizer "event" export interface CustomAuthorizerEvent { type: string; @@ -472,6 +493,15 @@ export interface APIGatewayProxyResult { } export type ProxyResult = APIGatewayProxyResult; // Old name +export interface ALBResult { + statusCode: number; + statusDescription: string; + headers?: { [header: string]: boolean | number | string }; + multiValueHeaders?: { [header: string]: Array }; + body: string; + isBase64Encoded: boolean; +} + /** * API Gateway CustomAuthorizer AuthResponse. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output @@ -535,10 +565,10 @@ export type StatementResource = MaybeStatementPrincipal & ({ Resource: string | export type StatementPrincipal = MaybeStatementResource & ({ Principal: PrincipalValue } | { NotPrincipal: PrincipalValue }); /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. - * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output + * https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html */ export interface AuthResponseContext { - [name: string]: any; + [name: string]: boolean | number | string; } /** @@ -877,11 +907,17 @@ export interface SQSRecordAttributes { SenderId: string; ApproximateFirstReceiveTimestamp: string; } + +export type SQSMessageAttributeDataType = 'String' | 'Number' | 'Binary' | string; + export interface SQSMessageAttribute { - Name: string; - Type: string; - Value: string; + stringValue?: string; + binaryValue?: string; + stringListValues: never[]; // Not implemented. Reserved for future use. + binaryListValues: never[]; // Not implemented. Reserved for future use. + dataType: SQSMessageAttributeDataType; } + export interface SQSMessageAttributes { [name: string]: SQSMessageAttribute; } @@ -1050,6 +1086,9 @@ export type APIGatewayProxyCallback = Callback; export type ProxyHandler = APIGatewayProxyHandler; // Old name export type ProxyCallback = APIGatewayProxyCallback; // Old name +export type ALBHandler = Handler; +export type ALBCallback = Callback; + // TODO: IoT export type CodePipelineHandler = Handler; diff --git a/types/aws-lambda/tslint.json b/types/aws-lambda/tslint.json index bafaae7817..f6fabe4180 100644 --- a/types/aws-lambda/tslint.json +++ b/types/aws-lambda/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // TODO + "npm-naming": false, "dt-header": false } } diff --git a/types/aws4/tslint.json b/types/aws4/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/aws4/tslint.json +++ b/types/aws4/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/axe-webdriverjs/axe-webdriverjs-tests.ts b/types/axe-webdriverjs/axe-webdriverjs-tests.ts index 47eeadc8c5..963e430c62 100644 --- a/types/axe-webdriverjs/axe-webdriverjs-tests.ts +++ b/types/axe-webdriverjs/axe-webdriverjs-tests.ts @@ -20,7 +20,11 @@ const inTest = async (webDriver: WebDriver) => { .disableRules("rule") .disableRules(["rule", "rule"]) .configure(spec) - .analyze((internalResults: AxeAnalysis) => {}); + .analyze((err: Error | null, internalResults: AxeAnalysis) => {}); + + const deprecatedAnalysis: AxeAnalysis = await AxeBuilder(webDriver).analyze( + (internalResults: AxeAnalysis) => {} + ); const inapplicable: Result[] = analysis.inapplicable; const incomplete: Result[] = analysis.incomplete; diff --git a/types/axe-webdriverjs/index.d.ts b/types/axe-webdriverjs/index.d.ts index 3c8ae27249..4c08cdb5c7 100644 --- a/types/axe-webdriverjs/index.d.ts +++ b/types/axe-webdriverjs/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for axe-webdriverjs 2.0 +// Type definitions for axe-webdriverjs 2.1 // Project: https://github.com/dequelabs/axe-webdriverjs#readme -// Definitions by: My Self +// Definitions by: Joshua Goldberg +// Tyler Krupicka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 import { Result, RunOptions, Spec } from "axe-core"; import { WebDriver } from "selenium-webdriver"; @@ -16,6 +17,9 @@ export interface AxeAnalysis { violations: Result[]; } +export type DeprecatedAnalyzeCallback = (results: AxeAnalysis) => void; +export type AnalyzeCallback = (err: Error | null, results: AxeAnalysis) => void; + export interface AxeBuilder { /** * Includes a selector in analysis. @@ -74,7 +78,9 @@ export interface AxeBuilder { * Perform analysis and retrieve results. * @param callback Function to execute when analysis completes. */ - analyze(callback: (results: AxeAnalysis) => void): Promise; + analyze( + callback?: AnalyzeCallback | DeprecatedAnalyzeCallback + ): Promise; } export const AxeBuilder: { diff --git a/types/axel/tslint.json b/types/axel/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/axel/tslint.json +++ b/types/axel/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure-mobile-services-client/tslint.json b/types/azure-mobile-services-client/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure-mobile-services-client/tslint.json +++ b/types/azure-mobile-services-client/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure-sb/index.d.ts b/types/azure-sb/index.d.ts index acb0bed06a..cf458d4080 100644 --- a/types/azure-sb/index.d.ts +++ b/types/azure-sb/index.d.ts @@ -4,25 +4,31 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -export import ServiceBusService = require('./lib/servicebusservice'); -export import NotificationHubService = require('./lib/notificationhubservice'); -export import WrapService = require('./lib/wrapservice'); +export import ServiceBusService = require("./lib/servicebusservice"); +export import NotificationHubService = require("./lib/notificationhubservice"); +export import WrapService = require("./lib/wrapservice"); -export function createServiceBusService(namespaceOrConnectionString?: string, - accessKey?: string, - issuer?: string, - acsNamespace?: string, - host?: string, - authenticationProvider?: object): ServiceBusService; +export function createServiceBusService( + namespaceOrConnectionString?: string, + accessKey?: string, + issuer?: string, + acsNamespace?: string, + host?: string, + authenticationProvider?: object +): ServiceBusService; -export function createNotificationHubService(hubName: string, - endpointOrConnectionString?: string, - sharedAccessKeyName?: string, - sharedAccessKeyValue?: string): NotificationHubService; +export function createNotificationHubService( + hubName: string, + endpointOrConnectionString?: string, + sharedAccessKeyName?: string, + sharedAccessKeyValue?: string +): NotificationHubService; -export function createWrapService(acsHost: string, - issuer?: string, - accessKey?: string): WrapService; +export function createWrapService( + acsHost: string, + issuer?: string, + accessKey?: string +): WrapService; export namespace Azure.ServiceBus { export type Duration = string; @@ -33,12 +39,12 @@ export namespace Azure.ServiceBus { } export interface ReceiveQueueMessageOptions { + isPeekLock?: boolean; timeoutIntervalInS?: number; } - export interface ReceiveSubscriptionMessageOptions extends ReceiveQueueMessageOptions { - isPeekLock?: boolean; - } + export interface ReceiveSubscriptionMessageOptions + extends ReceiveQueueMessageOptions {} interface IBrokerPropertiesResponse { readonly DeliveryCount: number; @@ -150,21 +156,21 @@ export namespace Azure.ServiceBus { readonly expiredPushChannel?: string; tags?: Array; templates?: { - [name: string]: { - body: string; - headers?: any; - expiry?: string; - tags?: Array; - }; + [name: string]: { + body: string; + headers?: any; + expiry?: string; + tags?: Array; + }; }; secondaryTile?: { - [titleId: string]: { - pushChannel: string; - tags?: Array; - templates?: any; - }; + [titleId: string]: { + pushChannel: string; + tags?: Array; + templates?: any; + }; }; - } + } export interface Response { body: Dictionary; @@ -185,23 +191,23 @@ export namespace Azure.ServiceBus { export namespace Results.Models { export enum EntityStatus { - Active = 'Active', - Creating = 'Creating', - Deleting = 'Deleting', - Disabled = 'Disabled', - ReceiveDisabled = 'ReceiveDisabled', - Renaming = 'Renaming', - Restoring = 'Restoring', - SendDisabled = 'SendDisabled', - Unknown = 'Unknown' + Active = "Active", + Creating = "Creating", + Deleting = "Deleting", + Disabled = "Disabled", + ReceiveDisabled = "ReceiveDisabled", + Renaming = "Renaming", + Restoring = "Restoring", + SendDisabled = "SendDisabled", + Unknown = "Unknown" } export enum EntityAvailabilityStatus { - Available = 'Available', - Limited = 'Limited', - Renaming = 'Renaming', - Restoring = 'Restoring', - Unknown = 'Unknown' + Available = "Available", + Limited = "Limited", + Renaming = "Renaming", + Restoring = "Restoring", + Unknown = "Unknown" } interface Base { @@ -240,11 +246,12 @@ export namespace Azure.ServiceBus { // [x: string]: string | Dictionary; // } - export const ActiveMessageCount = 'd2p1:ActiveMessageCount'; - export const DeadLetterMessageCount = 'd2p1:DeadLetterMessageCount'; - export const ScheduledMessageCount = 'd2p1:ScheduledMessageCount'; - export const TransferMessageCount = 'd2p1:TransferMessageCount'; - export const TransferDeadLetterMessageCount = 'd2p1:TransferDeadLetterMessageCount'; + export const ActiveMessageCount = "d2p1:ActiveMessageCount"; + export const DeadLetterMessageCount = "d2p1:DeadLetterMessageCount"; + export const ScheduledMessageCount = "d2p1:ScheduledMessageCount"; + export const TransferMessageCount = "d2p1:TransferMessageCount"; + export const TransferDeadLetterMessageCount = + "d2p1:TransferDeadLetterMessageCount"; export interface Topic extends ExtendedBase { AccessedAt: DateString; @@ -314,31 +321,43 @@ export namespace Azure.ServiceBus { /* * Callbacks */ - export type ResponseCallback = (error: Error | null, response: Response) => void; + export type ResponseCallback = ( + error: Error | null, + response: Response + ) => void; - export type ResultAndResponseCallback = (error: Error | null, - result: boolean | Results.Models.Base | Results.Models.Base[], - response: Response) => void; + export type ResultAndResponseCallback = ( + error: Error | null, + result: boolean | Results.Models.Base | Results.Models.Base[], + response: Response + ) => void; - export type TypedResultAndResponseCallback = (error: Error | null, - result: T, - response: Response) => void; + export type TypedResultAndResponseCallback = ( + error: Error | null, + result: T, + response: Response + ) => void; /* * Options interfaces with all properties as optional */ export type BrokerProperties = Partial; - export type BrokerPropertiesResponse = IBrokerPropertiesResponse & Partial; + export type BrokerPropertiesResponse = IBrokerPropertiesResponse & + Partial; export type CreateQueueOptions = Partial; export type CreateTopicOptions = Partial; - export type CreateTopicIfNotExistsOptions = Partial; + export type CreateTopicIfNotExistsOptions = Partial< + ICreateTopicIfNotExistsOptions + >; export type CreateSubscriptionOptions = Partial; export type ListSubscriptionsOptions = Partial; export type ListRulesOptions = Partial; export type ListTopicsOptions = Partial; export type ListQueuesOptions = Partial; export type CreateRuleOptions = Partial; - export type CreateNotificationHubOptions = Partial; + export type CreateNotificationHubOptions = Partial< + ICreateNotificationHubOptions + >; export type ListNotificationHubsOptions = Partial; export type MessageOrName = Message | string; diff --git a/types/azure-sb/tslint.json b/types/azure-sb/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure-sb/tslint.json +++ b/types/azure-sb/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/azure/tslint.json b/types/azure/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/azure/tslint.json +++ b/types/azure/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/babel-types/babel-types-tests.ts b/types/babel-types/babel-types-tests.ts index 8ffb1b32de..921608924c 100644 --- a/types/babel-types/babel-types-tests.ts +++ b/types/babel-types/babel-types-tests.ts @@ -53,6 +53,12 @@ traverse(ast, { } }); +// Node type checks +t.isIdentifier(t.identifier("id")); +t.isIdentifier(exp); +t.isIdentifier(null); +t.isIdentifier(undefined); + // TypeScript Types // TODO: Test all variants of these functions' signatures diff --git a/types/babel-types/index.d.ts b/types/babel-types/index.d.ts index d37cdf0a76..f0d781a7ed 100644 --- a/types/babel-types/index.d.ts +++ b/types/babel-types/index.d.ts @@ -1514,246 +1514,246 @@ export function TSUndefinedKeyword(): TSUndefinedKeyword; export function TSUnionType(types: TSType[]): TSUnionType; export function TSVoidKeyword(): TSVoidKeyword; -export function isArrayExpression(node: object, opts?: object): node is ArrayExpression; -export function isAssignmentExpression(node: object, opts?: object): node is AssignmentExpression; -export function isBinaryExpression(node: object, opts?: object): node is BinaryExpression; -export function isDirective(node: object, opts?: object): node is Directive; -export function isDirectiveLiteral(node: object, opts?: object): node is DirectiveLiteral; -export function isBlockStatement(node: object, opts?: object): node is BlockStatement; -export function isBreakStatement(node: object, opts?: object): node is BreakStatement; -export function isCallExpression(node: object, opts?: object): node is CallExpression; -export function isCatchClause(node: object, opts?: object): node is CatchClause; -export function isConditionalExpression(node: object, opts?: object): node is ConditionalExpression; -export function isContinueStatement(node: object, opts?: object): node is ContinueStatement; -export function isDebuggerStatement(node: object, opts?: object): node is DebuggerStatement; -export function isDoWhileStatement(node: object, opts?: object): node is DoWhileStatement; -export function isEmptyStatement(node: object, opts?: object): node is EmptyStatement; -export function isExpressionStatement(node: object, opts?: object): node is ExpressionStatement; -export function isFile(node: object, opts?: object): node is File; -export function isForInStatement(node: object, opts?: object): node is ForInStatement; -export function isForStatement(node: object, opts?: object): node is ForStatement; -export function isFunctionDeclaration(node: object, opts?: object): node is FunctionDeclaration; -export function isFunctionExpression(node: object, opts?: object): node is FunctionExpression; -export function isIdentifier(node: object, opts?: object): node is Identifier; -export function isIfStatement(node: object, opts?: object): node is IfStatement; -export function isLabeledStatement(node: object, opts?: object): node is LabeledStatement; -export function isStringLiteral(node: object, opts?: object): node is StringLiteral; -export function isNumericLiteral(node: object, opts?: object): node is NumericLiteral; -export function isNullLiteral(node: object, opts?: object): node is NullLiteral; -export function isBooleanLiteral(node: object, opts?: object): node is BooleanLiteral; -export function isRegExpLiteral(node: object, opts?: object): node is RegExpLiteral; -export function isLogicalExpression(node: object, opts?: object): node is LogicalExpression; -export function isMemberExpression(node: object, opts?: object): node is MemberExpression; -export function isNewExpression(node: object, opts?: object): node is NewExpression; -export function isProgram(node: object, opts?: object): node is Program; -export function isObjectExpression(node: object, opts?: object): node is ObjectExpression; -export function isObjectMethod(node: object, opts?: object): node is ObjectMethod; -export function isObjectProperty(node: object, opts?: object): node is ObjectProperty; -export function isRestElement(node: object, opts?: object): node is RestElement; -export function isReturnStatement(node: object, opts?: object): node is ReturnStatement; -export function isSequenceExpression(node: object, opts?: object): node is SequenceExpression; -export function isSwitchCase(node: object, opts?: object): node is SwitchCase; -export function isSwitchStatement(node: object, opts?: object): node is SwitchStatement; -export function isThisExpression(node: object, opts?: object): node is ThisExpression; -export function isThrowStatement(node: object, opts?: object): node is ThrowStatement; -export function isTryStatement(node: object, opts?: object): node is TryStatement; -export function isUnaryExpression(node: object, opts?: object): node is UnaryExpression; -export function isUpdateExpression(node: object, opts?: object): node is UpdateExpression; -export function isVariableDeclaration(node: object, opts?: object): node is VariableDeclaration; -export function isVariableDeclarator(node: object, opts?: object): node is VariableDeclarator; -export function isWhileStatement(node: object, opts?: object): node is WhileStatement; -export function isWithStatement(node: object, opts?: object): node is WithStatement; -export function isAssignmentPattern(node: object, opts?: object): node is AssignmentPattern; -export function isArrayPattern(node: object, opts?: object): node is ArrayPattern; -export function isArrowFunctionExpression(node: object, opts?: object): node is ArrowFunctionExpression; -export function isClassBody(node: object, opts?: object): node is ClassBody; -export function isClassDeclaration(node: object, opts?: object): node is ClassDeclaration; -export function isClassExpression(node: object, opts?: object): node is ClassExpression; -export function isExportAllDeclaration(node: object, opts?: object): node is ExportAllDeclaration; -export function isExportDefaultDeclaration(node: object, opts?: object): node is ExportDefaultDeclaration; -export function isExportNamedDeclaration(node: object, opts?: object): node is ExportNamedDeclaration; -export function isExportSpecifier(node: object, opts?: object): node is ExportSpecifier; -export function isForOfStatement(node: object, opts?: object): node is ForOfStatement; -export function isImportDeclaration(node: object, opts?: object): node is ImportDeclaration; -export function isImportDefaultSpecifier(node: object, opts?: object): node is ImportDefaultSpecifier; -export function isImportNamespaceSpecifier(node: object, opts?: object): node is ImportNamespaceSpecifier; -export function isImportSpecifier(node: object, opts?: object): node is ImportSpecifier; -export function isMetaProperty(node: object, opts?: object): node is MetaProperty; -export function isClassMethod(node: object, opts?: object): node is ClassMethod; -export function isObjectPattern(node: object, opts?: object): node is ObjectPattern; -export function isSpreadElement(node: object, opts?: object): node is SpreadElement; -export function isSuper(node: object, opts?: object): node is Super; -export function isTaggedTemplateExpression(node: object, opts?: object): node is TaggedTemplateExpression; -export function isTemplateElement(node: object, opts?: object): node is TemplateElement; -export function isTemplateLiteral(node: object, opts?: object): node is TemplateLiteral; -export function isYieldExpression(node: object, opts?: object): node is YieldExpression; -export function isAnyTypeAnnotation(node: object, opts?: object): node is AnyTypeAnnotation; -export function isArrayTypeAnnotation(node: object, opts?: object): node is ArrayTypeAnnotation; -export function isBooleanTypeAnnotation(node: object, opts?: object): node is BooleanTypeAnnotation; -export function isBooleanLiteralTypeAnnotation(node: object, opts?: object): node is BooleanLiteralTypeAnnotation; -export function isNullLiteralTypeAnnotation(node: object, opts?: object): node is NullLiteralTypeAnnotation; -export function isClassImplements(node: object, opts?: object): node is ClassImplements; -export function isClassProperty(node: object, opts?: object): node is ClassProperty; -export function isDeclareClass(node: object, opts?: object): node is DeclareClass; -export function isDeclareFunction(node: object, opts?: object): node is DeclareFunction; -export function isDeclareInterface(node: object, opts?: object): node is DeclareInterface; -export function isDeclareModule(node: object, opts?: object): node is DeclareModule; -export function isDeclareTypeAlias(node: object, opts?: object): node is DeclareTypeAlias; -export function isDeclareVariable(node: object, opts?: object): node is DeclareVariable; -export function isExistentialTypeParam(node: object, opts?: object): node is ExistentialTypeParam; -export function isFunctionTypeAnnotation(node: object, opts?: object): node is FunctionTypeAnnotation; -export function isFunctionTypeParam(node: object, opts?: object): node is FunctionTypeParam; -export function isGenericTypeAnnotation(node: object, opts?: object): node is GenericTypeAnnotation; -export function isInterfaceExtends(node: object, opts?: object): node is InterfaceExtends; -export function isInterfaceDeclaration(node: object, opts?: object): node is InterfaceDeclaration; -export function isIntersectionTypeAnnotation(node: object, opts?: object): node is IntersectionTypeAnnotation; -export function isMixedTypeAnnotation(node: object, opts?: object): node is MixedTypeAnnotation; -export function isNullableTypeAnnotation(node: object, opts?: object): node is NullableTypeAnnotation; -export function isNumericLiteralTypeAnnotation(node: object, opts?: object): node is NumericLiteralTypeAnnotation; -export function isNumberTypeAnnotation(node: object, opts?: object): node is NumberTypeAnnotation; -export function isStringLiteralTypeAnnotation(node: object, opts?: object): node is StringLiteralTypeAnnotation; -export function isStringTypeAnnotation(node: object, opts?: object): node is StringTypeAnnotation; -export function isThisTypeAnnotation(node: object, opts?: object): node is ThisTypeAnnotation; -export function isTupleTypeAnnotation(node: object, opts?: object): node is TupleTypeAnnotation; -export function isTypeofTypeAnnotation(node: object, opts?: object): node is TypeofTypeAnnotation; -export function isTypeAlias(node: object, opts?: object): node is TypeAlias; -export function isTypeAnnotation(node: object, opts?: object): node is TypeAnnotation; -export function isTypeCastExpression(node: object, opts?: object): node is TypeCastExpression; -export function isTypeParameter(node: object, opts?: object): node is TypeParameter; -export function isTypeParameterDeclaration(node: object, opts?: object): node is TypeParameterDeclaration; -export function isTypeParameterInstantiation(node: object, opts?: object): node is TypeParameterInstantiation; -export function isObjectTypeAnnotation(node: object, opts?: object): node is ObjectTypeAnnotation; -export function isObjectTypeCallProperty(node: object, opts?: object): node is ObjectTypeCallProperty; -export function isObjectTypeIndexer(node: object, opts?: object): node is ObjectTypeIndexer; -export function isObjectTypeProperty(node: object, opts?: object): node is ObjectTypeProperty; -export function isQualifiedTypeIdentifier(node: object, opts?: object): node is QualifiedTypeIdentifier; -export function isUnionTypeAnnotation(node: object, opts?: object): node is UnionTypeAnnotation; -export function isVoidTypeAnnotation(node: object, opts?: object): node is VoidTypeAnnotation; -export function isJSXAttribute(node: object, opts?: object): node is JSXAttribute; -export function isJSXClosingElement(node: object, opts?: object): node is JSXClosingElement; -export function isJSXElement(node: object, opts?: object): node is JSXElement; -export function isJSXEmptyExpression(node: object, opts?: object): node is JSXEmptyExpression; -export function isJSXExpressionContainer(node: object, opts?: object): node is JSXExpressionContainer; -export function isJSXIdentifier(node: object, opts?: object): node is JSXIdentifier; -export function isJSXMemberExpression(node: object, opts?: object): node is JSXMemberExpression; -export function isJSXNamespacedName(node: object, opts?: object): node is JSXNamespacedName; -export function isJSXOpeningElement(node: object, opts?: object): node is JSXOpeningElement; -export function isJSXSpreadAttribute(node: object, opts?: object): node is JSXSpreadAttribute; -export function isJSXText(node: object, opts?: object): node is JSXText; -export function isNoop(node: object, opts?: object): node is Noop; -export function isParenthesizedExpression(node: object, opts?: object): node is ParenthesizedExpression; -export function isAwaitExpression(node: object, opts?: object): node is AwaitExpression; -export function isBindExpression(node: object, opts?: object): node is BindExpression; -export function isDecorator(node: object, opts?: object): node is Decorator; -export function isDoExpression(node: object, opts?: object): node is DoExpression; -export function isExportDefaultSpecifier(node: object, opts?: object): node is ExportDefaultSpecifier; -export function isExportNamespaceSpecifier(node: object, opts?: object): node is ExportNamespaceSpecifier; -export function isRestProperty(node: object, opts?: object): node is RestProperty; -export function isSpreadProperty(node: object, opts?: object): node is SpreadProperty; -export function isExpression(node: object, opts?: object): node is Expression; -export function isBinary(node: object, opts?: object): node is Binary; -export function isScopable(node: object, opts?: object): node is Scopable; -export function isBlockParent(node: object, opts?: object): node is BlockParent; -export function isBlock(node: object, opts?: object): node is Block; -export function isStatement(node: object, opts?: object): node is Statement; -export function isTerminatorless(node: object, opts?: object): node is Terminatorless; -export function isCompletionStatement(node: object, opts?: object): node is CompletionStatement; -export function isConditional(node: object, opts?: object): node is Conditional; -export function isLoop(node: object, opts?: object): node is Loop; -export function isWhile(node: object, opts?: object): node is While; -export function isExpressionWrapper(node: object, opts?: object): node is ExpressionWrapper; -export function isFor(node: object, opts?: object): node is For; -export function isForXStatement(node: object, opts?: object): node is ForXStatement; +export function isArrayExpression(node: object | null | undefined, opts?: object): node is ArrayExpression; +export function isAssignmentExpression(node: object | null | undefined, opts?: object): node is AssignmentExpression; +export function isBinaryExpression(node: object | null | undefined, opts?: object): node is BinaryExpression; +export function isDirective(node: object | null | undefined, opts?: object): node is Directive; +export function isDirectiveLiteral(node: object | null | undefined, opts?: object): node is DirectiveLiteral; +export function isBlockStatement(node: object | null | undefined, opts?: object): node is BlockStatement; +export function isBreakStatement(node: object | null | undefined, opts?: object): node is BreakStatement; +export function isCallExpression(node: object | null | undefined, opts?: object): node is CallExpression; +export function isCatchClause(node: object | null | undefined, opts?: object): node is CatchClause; +export function isConditionalExpression(node: object | null | undefined, opts?: object): node is ConditionalExpression; +export function isContinueStatement(node: object | null | undefined, opts?: object): node is ContinueStatement; +export function isDebuggerStatement(node: object | null | undefined, opts?: object): node is DebuggerStatement; +export function isDoWhileStatement(node: object | null | undefined, opts?: object): node is DoWhileStatement; +export function isEmptyStatement(node: object | null | undefined, opts?: object): node is EmptyStatement; +export function isExpressionStatement(node: object | null | undefined, opts?: object): node is ExpressionStatement; +export function isFile(node: object | null | undefined, opts?: object): node is File; +export function isForInStatement(node: object | null | undefined, opts?: object): node is ForInStatement; +export function isForStatement(node: object | null | undefined, opts?: object): node is ForStatement; +export function isFunctionDeclaration(node: object | null | undefined, opts?: object): node is FunctionDeclaration; +export function isFunctionExpression(node: object | null | undefined, opts?: object): node is FunctionExpression; +export function isIdentifier(node: object | null | undefined, opts?: object): node is Identifier; +export function isIfStatement(node: object | null | undefined, opts?: object): node is IfStatement; +export function isLabeledStatement(node: object | null | undefined, opts?: object): node is LabeledStatement; +export function isStringLiteral(node: object | null | undefined, opts?: object): node is StringLiteral; +export function isNumericLiteral(node: object | null | undefined, opts?: object): node is NumericLiteral; +export function isNullLiteral(node: object | null | undefined, opts?: object): node is NullLiteral; +export function isBooleanLiteral(node: object | null | undefined, opts?: object): node is BooleanLiteral; +export function isRegExpLiteral(node: object | null | undefined, opts?: object): node is RegExpLiteral; +export function isLogicalExpression(node: object | null | undefined, opts?: object): node is LogicalExpression; +export function isMemberExpression(node: object | null | undefined, opts?: object): node is MemberExpression; +export function isNewExpression(node: object | null | undefined, opts?: object): node is NewExpression; +export function isProgram(node: object | null | undefined, opts?: object): node is Program; +export function isObjectExpression(node: object | null | undefined, opts?: object): node is ObjectExpression; +export function isObjectMethod(node: object | null | undefined, opts?: object): node is ObjectMethod; +export function isObjectProperty(node: object | null | undefined, opts?: object): node is ObjectProperty; +export function isRestElement(node: object | null | undefined, opts?: object): node is RestElement; +export function isReturnStatement(node: object | null | undefined, opts?: object): node is ReturnStatement; +export function isSequenceExpression(node: object | null | undefined, opts?: object): node is SequenceExpression; +export function isSwitchCase(node: object | null | undefined, opts?: object): node is SwitchCase; +export function isSwitchStatement(node: object | null | undefined, opts?: object): node is SwitchStatement; +export function isThisExpression(node: object | null | undefined, opts?: object): node is ThisExpression; +export function isThrowStatement(node: object | null | undefined, opts?: object): node is ThrowStatement; +export function isTryStatement(node: object | null | undefined, opts?: object): node is TryStatement; +export function isUnaryExpression(node: object | null | undefined, opts?: object): node is UnaryExpression; +export function isUpdateExpression(node: object | null | undefined, opts?: object): node is UpdateExpression; +export function isVariableDeclaration(node: object | null | undefined, opts?: object): node is VariableDeclaration; +export function isVariableDeclarator(node: object | null | undefined, opts?: object): node is VariableDeclarator; +export function isWhileStatement(node: object | null | undefined, opts?: object): node is WhileStatement; +export function isWithStatement(node: object | null | undefined, opts?: object): node is WithStatement; +export function isAssignmentPattern(node: object | null | undefined, opts?: object): node is AssignmentPattern; +export function isArrayPattern(node: object | null | undefined, opts?: object): node is ArrayPattern; +export function isArrowFunctionExpression(node: object | null | undefined, opts?: object): node is ArrowFunctionExpression; +export function isClassBody(node: object | null | undefined, opts?: object): node is ClassBody; +export function isClassDeclaration(node: object | null | undefined, opts?: object): node is ClassDeclaration; +export function isClassExpression(node: object | null | undefined, opts?: object): node is ClassExpression; +export function isExportAllDeclaration(node: object | null | undefined, opts?: object): node is ExportAllDeclaration; +export function isExportDefaultDeclaration(node: object | null | undefined, opts?: object): node is ExportDefaultDeclaration; +export function isExportNamedDeclaration(node: object | null | undefined, opts?: object): node is ExportNamedDeclaration; +export function isExportSpecifier(node: object | null | undefined, opts?: object): node is ExportSpecifier; +export function isForOfStatement(node: object | null | undefined, opts?: object): node is ForOfStatement; +export function isImportDeclaration(node: object | null | undefined, opts?: object): node is ImportDeclaration; +export function isImportDefaultSpecifier(node: object | null | undefined, opts?: object): node is ImportDefaultSpecifier; +export function isImportNamespaceSpecifier(node: object | null | undefined, opts?: object): node is ImportNamespaceSpecifier; +export function isImportSpecifier(node: object | null | undefined, opts?: object): node is ImportSpecifier; +export function isMetaProperty(node: object | null | undefined, opts?: object): node is MetaProperty; +export function isClassMethod(node: object | null | undefined, opts?: object): node is ClassMethod; +export function isObjectPattern(node: object | null | undefined, opts?: object): node is ObjectPattern; +export function isSpreadElement(node: object | null | undefined, opts?: object): node is SpreadElement; +export function isSuper(node: object | null | undefined, opts?: object): node is Super; +export function isTaggedTemplateExpression(node: object | null | undefined, opts?: object): node is TaggedTemplateExpression; +export function isTemplateElement(node: object | null | undefined, opts?: object): node is TemplateElement; +export function isTemplateLiteral(node: object | null | undefined, opts?: object): node is TemplateLiteral; +export function isYieldExpression(node: object | null | undefined, opts?: object): node is YieldExpression; +export function isAnyTypeAnnotation(node: object | null | undefined, opts?: object): node is AnyTypeAnnotation; +export function isArrayTypeAnnotation(node: object | null | undefined, opts?: object): node is ArrayTypeAnnotation; +export function isBooleanTypeAnnotation(node: object | null | undefined, opts?: object): node is BooleanTypeAnnotation; +export function isBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is BooleanLiteralTypeAnnotation; +export function isNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is NullLiteralTypeAnnotation; +export function isClassImplements(node: object | null | undefined, opts?: object): node is ClassImplements; +export function isClassProperty(node: object | null | undefined, opts?: object): node is ClassProperty; +export function isDeclareClass(node: object | null | undefined, opts?: object): node is DeclareClass; +export function isDeclareFunction(node: object | null | undefined, opts?: object): node is DeclareFunction; +export function isDeclareInterface(node: object | null | undefined, opts?: object): node is DeclareInterface; +export function isDeclareModule(node: object | null | undefined, opts?: object): node is DeclareModule; +export function isDeclareTypeAlias(node: object | null | undefined, opts?: object): node is DeclareTypeAlias; +export function isDeclareVariable(node: object | null | undefined, opts?: object): node is DeclareVariable; +export function isExistentialTypeParam(node: object | null | undefined, opts?: object): node is ExistentialTypeParam; +export function isFunctionTypeAnnotation(node: object | null | undefined, opts?: object): node is FunctionTypeAnnotation; +export function isFunctionTypeParam(node: object | null | undefined, opts?: object): node is FunctionTypeParam; +export function isGenericTypeAnnotation(node: object | null | undefined, opts?: object): node is GenericTypeAnnotation; +export function isInterfaceExtends(node: object | null | undefined, opts?: object): node is InterfaceExtends; +export function isInterfaceDeclaration(node: object | null | undefined, opts?: object): node is InterfaceDeclaration; +export function isIntersectionTypeAnnotation(node: object | null | undefined, opts?: object): node is IntersectionTypeAnnotation; +export function isMixedTypeAnnotation(node: object | null | undefined, opts?: object): node is MixedTypeAnnotation; +export function isNullableTypeAnnotation(node: object | null | undefined, opts?: object): node is NullableTypeAnnotation; +export function isNumericLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is NumericLiteralTypeAnnotation; +export function isNumberTypeAnnotation(node: object | null | undefined, opts?: object): node is NumberTypeAnnotation; +export function isStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is StringLiteralTypeAnnotation; +export function isStringTypeAnnotation(node: object | null | undefined, opts?: object): node is StringTypeAnnotation; +export function isThisTypeAnnotation(node: object | null | undefined, opts?: object): node is ThisTypeAnnotation; +export function isTupleTypeAnnotation(node: object | null | undefined, opts?: object): node is TupleTypeAnnotation; +export function isTypeofTypeAnnotation(node: object | null | undefined, opts?: object): node is TypeofTypeAnnotation; +export function isTypeAlias(node: object | null | undefined, opts?: object): node is TypeAlias; +export function isTypeAnnotation(node: object | null | undefined, opts?: object): node is TypeAnnotation; +export function isTypeCastExpression(node: object | null | undefined, opts?: object): node is TypeCastExpression; +export function isTypeParameter(node: object | null | undefined, opts?: object): node is TypeParameter; +export function isTypeParameterDeclaration(node: object | null | undefined, opts?: object): node is TypeParameterDeclaration; +export function isTypeParameterInstantiation(node: object | null | undefined, opts?: object): node is TypeParameterInstantiation; +export function isObjectTypeAnnotation(node: object | null | undefined, opts?: object): node is ObjectTypeAnnotation; +export function isObjectTypeCallProperty(node: object | null | undefined, opts?: object): node is ObjectTypeCallProperty; +export function isObjectTypeIndexer(node: object | null | undefined, opts?: object): node is ObjectTypeIndexer; +export function isObjectTypeProperty(node: object | null | undefined, opts?: object): node is ObjectTypeProperty; +export function isQualifiedTypeIdentifier(node: object | null | undefined, opts?: object): node is QualifiedTypeIdentifier; +export function isUnionTypeAnnotation(node: object | null | undefined, opts?: object): node is UnionTypeAnnotation; +export function isVoidTypeAnnotation(node: object | null | undefined, opts?: object): node is VoidTypeAnnotation; +export function isJSXAttribute(node: object | null | undefined, opts?: object): node is JSXAttribute; +export function isJSXClosingElement(node: object | null | undefined, opts?: object): node is JSXClosingElement; +export function isJSXElement(node: object | null | undefined, opts?: object): node is JSXElement; +export function isJSXEmptyExpression(node: object | null | undefined, opts?: object): node is JSXEmptyExpression; +export function isJSXExpressionContainer(node: object | null | undefined, opts?: object): node is JSXExpressionContainer; +export function isJSXIdentifier(node: object | null | undefined, opts?: object): node is JSXIdentifier; +export function isJSXMemberExpression(node: object | null | undefined, opts?: object): node is JSXMemberExpression; +export function isJSXNamespacedName(node: object | null | undefined, opts?: object): node is JSXNamespacedName; +export function isJSXOpeningElement(node: object | null | undefined, opts?: object): node is JSXOpeningElement; +export function isJSXSpreadAttribute(node: object | null | undefined, opts?: object): node is JSXSpreadAttribute; +export function isJSXText(node: object | null | undefined, opts?: object): node is JSXText; +export function isNoop(node: object | null | undefined, opts?: object): node is Noop; +export function isParenthesizedExpression(node: object | null | undefined, opts?: object): node is ParenthesizedExpression; +export function isAwaitExpression(node: object | null | undefined, opts?: object): node is AwaitExpression; +export function isBindExpression(node: object | null | undefined, opts?: object): node is BindExpression; +export function isDecorator(node: object | null | undefined, opts?: object): node is Decorator; +export function isDoExpression(node: object | null | undefined, opts?: object): node is DoExpression; +export function isExportDefaultSpecifier(node: object | null | undefined, opts?: object): node is ExportDefaultSpecifier; +export function isExportNamespaceSpecifier(node: object | null | undefined, opts?: object): node is ExportNamespaceSpecifier; +export function isRestProperty(node: object | null | undefined, opts?: object): node is RestProperty; +export function isSpreadProperty(node: object | null | undefined, opts?: object): node is SpreadProperty; +export function isExpression(node: object | null | undefined, opts?: object): node is Expression; +export function isBinary(node: object | null | undefined, opts?: object): node is Binary; +export function isScopable(node: object | null | undefined, opts?: object): node is Scopable; +export function isBlockParent(node: object | null | undefined, opts?: object): node is BlockParent; +export function isBlock(node: object | null | undefined, opts?: object): node is Block; +export function isStatement(node: object | null | undefined, opts?: object): node is Statement; +export function isTerminatorless(node: object | null | undefined, opts?: object): node is Terminatorless; +export function isCompletionStatement(node: object | null | undefined, opts?: object): node is CompletionStatement; +export function isConditional(node: object | null | undefined, opts?: object): node is Conditional; +export function isLoop(node: object | null | undefined, opts?: object): node is Loop; +export function isWhile(node: object | null | undefined, opts?: object): node is While; +export function isExpressionWrapper(node: object | null | undefined, opts?: object): node is ExpressionWrapper; +export function isFor(node: object | null | undefined, opts?: object): node is For; +export function isForXStatement(node: object | null | undefined, opts?: object): node is ForXStatement; // tslint:disable-next-line ban-types -export function isFunction(node: object, opts?: object): node is Function; -export function isFunctionParent(node: object, opts?: object): node is FunctionParent; -export function isPureish(node: object, opts?: object): node is Pureish; -export function isDeclaration(node: object, opts?: object): node is Declaration; -export function isLVal(node: object, opts?: object): node is LVal; -export function isLiteral(node: object, opts?: object): node is Literal; -export function isImmutable(node: object, opts?: object): node is Immutable; -export function isUserWhitespacable(node: object, opts?: object): node is UserWhitespacable; -export function isMethod(node: object, opts?: object): node is Method; -export function isObjectMember(node: object, opts?: object): node is ObjectMember; -export function isProperty(node: object, opts?: object): node is Property; -export function isUnaryLike(node: object, opts?: object): node is UnaryLike; -export function isPattern(node: object, opts?: object): node is Pattern; -export function isClass(node: object, opts?: object): node is Class; -export function isModuleDeclaration(node: object, opts?: object): node is ModuleDeclaration; -export function isExportDeclaration(node: object, opts?: object): node is ExportDeclaration; -export function isModuleSpecifier(node: object, opts?: object): node is ModuleSpecifier; -export function isFlow(node: object, opts?: object): node is Flow; -export function isFlowBaseAnnotation(node: object, opts?: object): node is FlowBaseAnnotation; -export function isFlowDeclaration(node: object, opts?: object): node is FlowDeclaration; -export function isJSX(node: object, opts?: object): node is JSX; -export function isNumberLiteral(node: object, opts?: object): node is NumericLiteral; -export function isRegexLiteral(node: object, opts?: object): node is RegExpLiteral; +export function isFunction(node: object | null | undefined, opts?: object): node is Function; +export function isFunctionParent(node: object | null | undefined, opts?: object): node is FunctionParent; +export function isPureish(node: object | null | undefined, opts?: object): node is Pureish; +export function isDeclaration(node: object | null | undefined, opts?: object): node is Declaration; +export function isLVal(node: object | null | undefined, opts?: object): node is LVal; +export function isLiteral(node: object | null | undefined, opts?: object): node is Literal; +export function isImmutable(node: object | null | undefined, opts?: object): node is Immutable; +export function isUserWhitespacable(node: object | null | undefined, opts?: object): node is UserWhitespacable; +export function isMethod(node: object | null | undefined, opts?: object): node is Method; +export function isObjectMember(node: object | null | undefined, opts?: object): node is ObjectMember; +export function isProperty(node: object | null | undefined, opts?: object): node is Property; +export function isUnaryLike(node: object | null | undefined, opts?: object): node is UnaryLike; +export function isPattern(node: object | null | undefined, opts?: object): node is Pattern; +export function isClass(node: object | null | undefined, opts?: object): node is Class; +export function isModuleDeclaration(node: object | null | undefined, opts?: object): node is ModuleDeclaration; +export function isExportDeclaration(node: object | null | undefined, opts?: object): node is ExportDeclaration; +export function isModuleSpecifier(node: object | null | undefined, opts?: object): node is ModuleSpecifier; +export function isFlow(node: object | null | undefined, opts?: object): node is Flow; +export function isFlowBaseAnnotation(node: object | null | undefined, opts?: object): node is FlowBaseAnnotation; +export function isFlowDeclaration(node: object | null | undefined, opts?: object): node is FlowDeclaration; +export function isJSX(node: object | null | undefined, opts?: object): node is JSX; +export function isNumberLiteral(node: object | null | undefined, opts?: object): node is NumericLiteral; +export function isRegexLiteral(node: object | null | undefined, opts?: object): node is RegExpLiteral; -export function isReferencedIdentifier(node: object, opts?: object): node is Identifier | JSXIdentifier; -export function isReferencedMemberExpression(node: object, opts?: object): node is MemberExpression; -export function isBindingIdentifier(node: object, opts?: object): node is Identifier; -export function isScope(node: object, opts?: object): node is Scopable; -export function isReferenced(node: object, opts?: object): boolean; -export function isBlockScoped(node: object, opts?: object): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration; -export function isVar(node: object, opts?: object): node is VariableDeclaration; -export function isUser(node: object, opts?: object): boolean; -export function isGenerated(node: object, opts?: object): boolean; -export function isPure(node: object, opts?: object): boolean; +export function isReferencedIdentifier(node: object | null | undefined, opts?: object): node is Identifier | JSXIdentifier; +export function isReferencedMemberExpression(node: object | null | undefined, opts?: object): node is MemberExpression; +export function isBindingIdentifier(node: object | null | undefined, opts?: object): node is Identifier; +export function isScope(node: object | null | undefined, opts?: object): node is Scopable; +export function isReferenced(node: object | null | undefined, opts?: object): boolean; +export function isBlockScoped(node: object | null | undefined, opts?: object): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration; +export function isVar(node: object | null | undefined, opts?: object): node is VariableDeclaration; +export function isUser(node: object | null | undefined, opts?: object): boolean; +export function isGenerated(node: object | null | undefined, opts?: object): boolean; +export function isPure(node: object | null | undefined, opts?: object): boolean; -export function isTSAnyKeyword(node: object, opts?: object): node is TSAnyKeyword; -export function isTSArrayType(node: object, opts?: object): node is TSArrayType; -export function isTSAsExpression(node: object, opts?: object): node is TSAsExpression; -export function isTSBooleanKeyword(node: object, opts?: object): node is TSBooleanKeyword; -export function isTSCallSignatureDeclaration(node: object, opts?: object): node is TSCallSignatureDeclaration; -export function isTSConstructSignatureDeclaration(node: object, opts?: object): node is TSTypeElement; -export function isTSConstructorType(node: object, opts?: object): node is TSConstructorType; -export function isTSDeclareFunction(node: object, opts?: object): node is TSDeclareFunction; -export function isTSDeclareMethod(node: object, opts?: object): node is TSDeclareMethod; -export function isTSEnumDeclaration(node: object, opts?: object): node is TSEnumDeclaration; -export function isTSEnumMember(node: object, opts?: object): node is TSEnumMember; -export function isTSExportAssignment(node: object, opts?: object): node is TSExportAssignment; -export function isTSExpressionWithTypeArguments(node: object, opts?: object): node is TSExpressionWithTypeArguments; -export function isTSExternalModuleReference(node: object, opts?: object): node is TSExternalModuleReference; -export function isTSFunctionType(node: object, opts?: object): node is TSFunctionType; -export function isTSImportEqualsDeclaration(node: object, opts?: object): node is TSImportEqualsDeclaration; -export function isTSIndexSignature(node: object, opts?: object): node is TSIndexSignature; -export function isTSIndexedAccessType(node: object, opts?: object): node is TSIndexedAccessType; -export function isTSInterfaceBody(node: object, opts?: object): node is TSInterfaceBody; -export function isTSInterfaceDeclaration(node: object, opts?: object): node is TSInterfaceDeclaration; -export function isTSIntersectionType(node: object, opts?: object): node is TSIntersectionType; -export function isTSLiteralType(node: object, opts?: object): node is TSLiteralType; -export function isTSMappedType(node: object, opts?: object): node is TSMappedType; -export function isTSMethodSignature(node: object, opts?: object): node is TSMethodSignature; -export function isTSModuleBlock(node: object, opts?: object): node is TSModuleBlock; -export function isTSModuleDeclaration(node: object, opts?: object): node is TSModuleDeclaration; -export function isTSNamespaceExportDeclaration(node: object, opts?: object): node is TSNamespaceExportDeclaration; -export function isTSNeverKeyword(node: object, opts?: object): node is TSNeverKeyword; -export function isTSNonNullExpression(node: object, opts?: object): node is TSNonNullExpression; -export function isTSNullKeyword(node: object, opts?: object): node is TSNullKeyword; -export function isTSNumberKeyword(node: object, opts?: object): node is TSNumberKeyword; -export function isTSObjectKeyword(node: object, opts?: object): node is TSObjectKeyword; -export function isTSParameterProperty(node: object, opts?: object): node is TSParameterProperty; -export function isTSParenthesizedType(node: object, opts?: object): node is TSParenthesizedType; -export function isTSPropertySignature(node: object, opts?: object): node is TSPropertySignature; -export function isTSQualifiedName(node: object, opts?: object): node is TSQualifiedName; -export function isTSStringKeyword(node: object, opts?: object): node is TSStringKeyword; -export function isTSSymbolKeyword(node: object, opts?: object): node is TSSymbolKeyword; -export function isTSThisType(node: object, opts?: object): node is TSThisType; -export function isTSTupleType(node: object, opts?: object): node is TSTupleType; -export function isTSTypeAliasDeclaration(node: object, opts?: object): node is TSTypeAliasDeclaration; -export function isTSTypeAnnotation(node: object, opts?: object): node is TSTypeAnnotation; -export function isTSTypeAssertion(node: object, opts?: object): node is TSTypeAssertion; -export function isTSTypeLiteral(node: object, opts?: object): node is TSTypeLiteral; -export function isTSTypeOperator(node: object, opts?: object): node is TSTypeOperator; -export function isTSTypeParameter(node: object, opts?: object): node is TSTypeParameter; -export function isTSTypeParameterDeclaration(node: object, opts?: object): node is TSTypeParameterDeclaration; -export function isTSTypeParameterInstantiation(node: object, opts?: object): node is TSTypeParameterInstantiation; -export function isTSTypePredicate(node: object, opts?: object): node is TSTypePredicate; -export function isTSTypeQuery(node: object, opts?: object): node is TSTypeQuery; -export function isTSTypeReference(node: object, opts?: object): node is TSTypeReference; -export function isTSUndefinedKeyword(node: object, opts?: object): node is TSUndefinedKeyword; -export function isTSUnionType(node: object, opts?: object): node is TSUnionType; -export function isTSVoidKeyword(node: object, opts?: object): node is TSVoidKeyword; +export function isTSAnyKeyword(node: object | null | undefined, opts?: object): node is TSAnyKeyword; +export function isTSArrayType(node: object | null | undefined, opts?: object): node is TSArrayType; +export function isTSAsExpression(node: object | null | undefined, opts?: object): node is TSAsExpression; +export function isTSBooleanKeyword(node: object | null | undefined, opts?: object): node is TSBooleanKeyword; +export function isTSCallSignatureDeclaration(node: object | null | undefined, opts?: object): node is TSCallSignatureDeclaration; +export function isTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object): node is TSTypeElement; +export function isTSConstructorType(node: object | null | undefined, opts?: object): node is TSConstructorType; +export function isTSDeclareFunction(node: object | null | undefined, opts?: object): node is TSDeclareFunction; +export function isTSDeclareMethod(node: object | null | undefined, opts?: object): node is TSDeclareMethod; +export function isTSEnumDeclaration(node: object | null | undefined, opts?: object): node is TSEnumDeclaration; +export function isTSEnumMember(node: object | null | undefined, opts?: object): node is TSEnumMember; +export function isTSExportAssignment(node: object | null | undefined, opts?: object): node is TSExportAssignment; +export function isTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object): node is TSExpressionWithTypeArguments; +export function isTSExternalModuleReference(node: object | null | undefined, opts?: object): node is TSExternalModuleReference; +export function isTSFunctionType(node: object | null | undefined, opts?: object): node is TSFunctionType; +export function isTSImportEqualsDeclaration(node: object | null | undefined, opts?: object): node is TSImportEqualsDeclaration; +export function isTSIndexSignature(node: object | null | undefined, opts?: object): node is TSIndexSignature; +export function isTSIndexedAccessType(node: object | null | undefined, opts?: object): node is TSIndexedAccessType; +export function isTSInterfaceBody(node: object | null | undefined, opts?: object): node is TSInterfaceBody; +export function isTSInterfaceDeclaration(node: object | null | undefined, opts?: object): node is TSInterfaceDeclaration; +export function isTSIntersectionType(node: object | null | undefined, opts?: object): node is TSIntersectionType; +export function isTSLiteralType(node: object | null | undefined, opts?: object): node is TSLiteralType; +export function isTSMappedType(node: object | null | undefined, opts?: object): node is TSMappedType; +export function isTSMethodSignature(node: object | null | undefined, opts?: object): node is TSMethodSignature; +export function isTSModuleBlock(node: object | null | undefined, opts?: object): node is TSModuleBlock; +export function isTSModuleDeclaration(node: object | null | undefined, opts?: object): node is TSModuleDeclaration; +export function isTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object): node is TSNamespaceExportDeclaration; +export function isTSNeverKeyword(node: object | null | undefined, opts?: object): node is TSNeverKeyword; +export function isTSNonNullExpression(node: object | null | undefined, opts?: object): node is TSNonNullExpression; +export function isTSNullKeyword(node: object | null | undefined, opts?: object): node is TSNullKeyword; +export function isTSNumberKeyword(node: object | null | undefined, opts?: object): node is TSNumberKeyword; +export function isTSObjectKeyword(node: object | null | undefined, opts?: object): node is TSObjectKeyword; +export function isTSParameterProperty(node: object | null | undefined, opts?: object): node is TSParameterProperty; +export function isTSParenthesizedType(node: object | null | undefined, opts?: object): node is TSParenthesizedType; +export function isTSPropertySignature(node: object | null | undefined, opts?: object): node is TSPropertySignature; +export function isTSQualifiedName(node: object | null | undefined, opts?: object): node is TSQualifiedName; +export function isTSStringKeyword(node: object | null | undefined, opts?: object): node is TSStringKeyword; +export function isTSSymbolKeyword(node: object | null | undefined, opts?: object): node is TSSymbolKeyword; +export function isTSThisType(node: object | null | undefined, opts?: object): node is TSThisType; +export function isTSTupleType(node: object | null | undefined, opts?: object): node is TSTupleType; +export function isTSTypeAliasDeclaration(node: object | null | undefined, opts?: object): node is TSTypeAliasDeclaration; +export function isTSTypeAnnotation(node: object | null | undefined, opts?: object): node is TSTypeAnnotation; +export function isTSTypeAssertion(node: object | null | undefined, opts?: object): node is TSTypeAssertion; +export function isTSTypeLiteral(node: object | null | undefined, opts?: object): node is TSTypeLiteral; +export function isTSTypeOperator(node: object | null | undefined, opts?: object): node is TSTypeOperator; +export function isTSTypeParameter(node: object | null | undefined, opts?: object): node is TSTypeParameter; +export function isTSTypeParameterDeclaration(node: object | null | undefined, opts?: object): node is TSTypeParameterDeclaration; +export function isTSTypeParameterInstantiation(node: object | null | undefined, opts?: object): node is TSTypeParameterInstantiation; +export function isTSTypePredicate(node: object | null | undefined, opts?: object): node is TSTypePredicate; +export function isTSTypeQuery(node: object | null | undefined, opts?: object): node is TSTypeQuery; +export function isTSTypeReference(node: object | null | undefined, opts?: object): node is TSTypeReference; +export function isTSUndefinedKeyword(node: object | null | undefined, opts?: object): node is TSUndefinedKeyword; +export function isTSUnionType(node: object | null | undefined, opts?: object): node is TSUnionType; +export function isTSVoidKeyword(node: object | null | undefined, opts?: object): node is TSVoidKeyword; // React specific export interface ReactHelpers { @@ -1762,231 +1762,231 @@ export interface ReactHelpers { } export const react: ReactHelpers; -export function assertArrayExpression(node: object, opts?: object): void; -export function assertAssignmentExpression(node: object, opts?: object): void; -export function assertBinaryExpression(node: object, opts?: object): void; -export function assertDirective(node: object, opts?: object): void; -export function assertDirectiveLiteral(node: object, opts?: object): void; -export function assertBlockStatement(node: object, opts?: object): void; -export function assertBreakStatement(node: object, opts?: object): void; -export function assertCallExpression(node: object, opts?: object): void; -export function assertCatchClause(node: object, opts?: object): void; -export function assertConditionalExpression(node: object, opts?: object): void; -export function assertContinueStatement(node: object, opts?: object): void; -export function assertDebuggerStatement(node: object, opts?: object): void; -export function assertDoWhileStatement(node: object, opts?: object): void; -export function assertEmptyStatement(node: object, opts?: object): void; -export function assertExpressionStatement(node: object, opts?: object): void; -export function assertFile(node: object, opts?: object): void; -export function assertForInStatement(node: object, opts?: object): void; -export function assertForStatement(node: object, opts?: object): void; -export function assertFunctionDeclaration(node: object, opts?: object): void; -export function assertFunctionExpression(node: object, opts?: object): void; -export function assertIdentifier(node: object, opts?: object): void; -export function assertIfStatement(node: object, opts?: object): void; -export function assertLabeledStatement(node: object, opts?: object): void; -export function assertStringLiteral(node: object, opts?: object): void; -export function assertNumericLiteral(node: object, opts?: object): void; -export function assertNullLiteral(node: object, opts?: object): void; -export function assertBooleanLiteral(node: object, opts?: object): void; -export function assertRegExpLiteral(node: object, opts?: object): void; -export function assertLogicalExpression(node: object, opts?: object): void; -export function assertMemberExpression(node: object, opts?: object): void; -export function assertNewExpression(node: object, opts?: object): void; -export function assertProgram(node: object, opts?: object): void; -export function assertObjectExpression(node: object, opts?: object): void; -export function assertObjectMethod(node: object, opts?: object): void; -export function assertObjectProperty(node: object, opts?: object): void; -export function assertRestElement(node: object, opts?: object): void; -export function assertReturnStatement(node: object, opts?: object): void; -export function assertSequenceExpression(node: object, opts?: object): void; -export function assertSwitchCase(node: object, opts?: object): void; -export function assertSwitchStatement(node: object, opts?: object): void; -export function assertThisExpression(node: object, opts?: object): void; -export function assertThrowStatement(node: object, opts?: object): void; -export function assertTryStatement(node: object, opts?: object): void; -export function assertUnaryExpression(node: object, opts?: object): void; -export function assertUpdateExpression(node: object, opts?: object): void; -export function assertVariableDeclaration(node: object, opts?: object): void; -export function assertVariableDeclarator(node: object, opts?: object): void; -export function assertWhileStatement(node: object, opts?: object): void; -export function assertWithStatement(node: object, opts?: object): void; -export function assertAssignmentPattern(node: object, opts?: object): void; -export function assertArrayPattern(node: object, opts?: object): void; -export function assertArrowFunctionExpression(node: object, opts?: object): void; -export function assertClassBody(node: object, opts?: object): void; -export function assertClassDeclaration(node: object, opts?: object): void; -export function assertClassExpression(node: object, opts?: object): void; -export function assertExportAllDeclaration(node: object, opts?: object): void; -export function assertExportDefaultDeclaration(node: object, opts?: object): void; -export function assertExportNamedDeclaration(node: object, opts?: object): void; -export function assertExportSpecifier(node: object, opts?: object): void; -export function assertForOfStatement(node: object, opts?: object): void; -export function assertImportDeclaration(node: object, opts?: object): void; -export function assertImportDefaultSpecifier(node: object, opts?: object): void; -export function assertImportNamespaceSpecifier(node: object, opts?: object): void; -export function assertImportSpecifier(node: object, opts?: object): void; -export function assertMetaProperty(node: object, opts?: object): void; -export function assertClassMethod(node: object, opts?: object): void; -export function assertObjectPattern(node: object, opts?: object): void; -export function assertSpreadElement(node: object, opts?: object): void; -export function assertSuper(node: object, opts?: object): void; -export function assertTaggedTemplateExpression(node: object, opts?: object): void; -export function assertTemplateElement(node: object, opts?: object): void; -export function assertTemplateLiteral(node: object, opts?: object): void; -export function assertYieldExpression(node: object, opts?: object): void; -export function assertAnyTypeAnnotation(node: object, opts?: object): void; -export function assertArrayTypeAnnotation(node: object, opts?: object): void; -export function assertBooleanTypeAnnotation(node: object, opts?: object): void; -export function assertBooleanLiteralTypeAnnotation(node: object, opts?: object): void; -export function assertNullLiteralTypeAnnotation(node: object, opts?: object): void; -export function assertClassImplements(node: object, opts?: object): void; -export function assertClassProperty(node: object, opts?: object): void; -export function assertDeclareClass(node: object, opts?: object): void; -export function assertDeclareFunction(node: object, opts?: object): void; -export function assertDeclareInterface(node: object, opts?: object): void; -export function assertDeclareModule(node: object, opts?: object): void; -export function assertDeclareTypeAlias(node: object, opts?: object): void; -export function assertDeclareVariable(node: object, opts?: object): void; -export function assertExistentialTypeParam(node: object, opts?: object): void; -export function assertFunctionTypeAnnotation(node: object, opts?: object): void; -export function assertFunctionTypeParam(node: object, opts?: object): void; -export function assertGenericTypeAnnotation(node: object, opts?: object): void; -export function assertInterfaceExtends(node: object, opts?: object): void; -export function assertInterfaceDeclaration(node: object, opts?: object): void; -export function assertIntersectionTypeAnnotation(node: object, opts?: object): void; -export function assertMixedTypeAnnotation(node: object, opts?: object): void; -export function assertNullableTypeAnnotation(node: object, opts?: object): void; -export function assertNumericLiteralTypeAnnotation(node: object, opts?: object): void; -export function assertNumberTypeAnnotation(node: object, opts?: object): void; -export function assertStringLiteralTypeAnnotation(node: object, opts?: object): void; -export function assertStringTypeAnnotation(node: object, opts?: object): void; -export function assertThisTypeAnnotation(node: object, opts?: object): void; -export function assertTupleTypeAnnotation(node: object, opts?: object): void; -export function assertTypeofTypeAnnotation(node: object, opts?: object): void; -export function assertTypeAlias(node: object, opts?: object): void; -export function assertTypeAnnotation(node: object, opts?: object): void; -export function assertTypeCastExpression(node: object, opts?: object): void; -export function assertTypeParameter(node: object, opts?: object): void; -export function assertTypeParameterDeclaration(node: object, opts?: object): void; -export function assertTypeParameterInstantiation(node: object, opts?: object): void; -export function assertObjectTypeAnnotation(node: object, opts?: object): void; -export function assertObjectTypeCallProperty(node: object, opts?: object): void; -export function assertObjectTypeIndexer(node: object, opts?: object): void; -export function assertObjectTypeProperty(node: object, opts?: object): void; -export function assertQualifiedTypeIdentifier(node: object, opts?: object): void; -export function assertUnionTypeAnnotation(node: object, opts?: object): void; -export function assertVoidTypeAnnotation(node: object, opts?: object): void; -export function assertJSXAttribute(node: object, opts?: object): void; -export function assertJSXClosingElement(node: object, opts?: object): void; -export function assertJSXElement(node: object, opts?: object): void; -export function assertJSXEmptyExpression(node: object, opts?: object): void; -export function assertJSXExpressionContainer(node: object, opts?: object): void; -export function assertJSXIdentifier(node: object, opts?: object): void; -export function assertJSXMemberExpression(node: object, opts?: object): void; -export function assertJSXNamespacedName(node: object, opts?: object): void; -export function assertJSXOpeningElement(node: object, opts?: object): void; -export function assertJSXSpreadAttribute(node: object, opts?: object): void; -export function assertJSXText(node: object, opts?: object): void; -export function assertNoop(node: object, opts?: object): void; -export function assertParenthesizedExpression(node: object, opts?: object): void; -export function assertAwaitExpression(node: object, opts?: object): void; -export function assertBindExpression(node: object, opts?: object): void; -export function assertDecorator(node: object, opts?: object): void; -export function assertDoExpression(node: object, opts?: object): void; -export function assertExportDefaultSpecifier(node: object, opts?: object): void; -export function assertExportNamespaceSpecifier(node: object, opts?: object): void; -export function assertRestProperty(node: object, opts?: object): void; -export function assertSpreadProperty(node: object, opts?: object): void; -export function assertExpression(node: object, opts?: object): void; -export function assertBinary(node: object, opts?: object): void; -export function assertScopable(node: object, opts?: object): void; -export function assertBlockParent(node: object, opts?: object): void; -export function assertBlock(node: object, opts?: object): void; -export function assertStatement(node: object, opts?: object): void; -export function assertTerminatorless(node: object, opts?: object): void; -export function assertCompletionStatement(node: object, opts?: object): void; -export function assertConditional(node: object, opts?: object): void; -export function assertLoop(node: object, opts?: object): void; -export function assertWhile(node: object, opts?: object): void; -export function assertExpressionWrapper(node: object, opts?: object): void; -export function assertFor(node: object, opts?: object): void; -export function assertForXStatement(node: object, opts?: object): void; -export function assertFunction(node: object, opts?: object): void; -export function assertFunctionParent(node: object, opts?: object): void; -export function assertPureish(node: object, opts?: object): void; -export function assertDeclaration(node: object, opts?: object): void; -export function assertLVal(node: object, opts?: object): void; -export function assertLiteral(node: object, opts?: object): void; -export function assertImmutable(node: object, opts?: object): void; -export function assertUserWhitespacable(node: object, opts?: object): void; -export function assertMethod(node: object, opts?: object): void; -export function assertObjectMember(node: object, opts?: object): void; -export function assertProperty(node: object, opts?: object): void; -export function assertUnaryLike(node: object, opts?: object): void; -export function assertPattern(node: object, opts?: object): void; -export function assertClass(node: object, opts?: object): void; -export function assertModuleDeclaration(node: object, opts?: object): void; -export function assertExportDeclaration(node: object, opts?: object): void; -export function assertModuleSpecifier(node: object, opts?: object): void; -export function assertFlow(node: object, opts?: object): void; -export function assertFlowBaseAnnotation(node: object, opts?: object): void; -export function assertFlowDeclaration(node: object, opts?: object): void; -export function assertJSX(node: object, opts?: object): void; -export function assertNumberLiteral(node: object, opts?: object): void; -export function assertRegexLiteral(node: object, opts?: object): void; +export function assertArrayExpression(node: object | null | undefined, opts?: object): void; +export function assertAssignmentExpression(node: object | null | undefined, opts?: object): void; +export function assertBinaryExpression(node: object | null | undefined, opts?: object): void; +export function assertDirective(node: object | null | undefined, opts?: object): void; +export function assertDirectiveLiteral(node: object | null | undefined, opts?: object): void; +export function assertBlockStatement(node: object | null | undefined, opts?: object): void; +export function assertBreakStatement(node: object | null | undefined, opts?: object): void; +export function assertCallExpression(node: object | null | undefined, opts?: object): void; +export function assertCatchClause(node: object | null | undefined, opts?: object): void; +export function assertConditionalExpression(node: object | null | undefined, opts?: object): void; +export function assertContinueStatement(node: object | null | undefined, opts?: object): void; +export function assertDebuggerStatement(node: object | null | undefined, opts?: object): void; +export function assertDoWhileStatement(node: object | null | undefined, opts?: object): void; +export function assertEmptyStatement(node: object | null | undefined, opts?: object): void; +export function assertExpressionStatement(node: object | null | undefined, opts?: object): void; +export function assertFile(node: object | null | undefined, opts?: object): void; +export function assertForInStatement(node: object | null | undefined, opts?: object): void; +export function assertForStatement(node: object | null | undefined, opts?: object): void; +export function assertFunctionDeclaration(node: object | null | undefined, opts?: object): void; +export function assertFunctionExpression(node: object | null | undefined, opts?: object): void; +export function assertIdentifier(node: object | null | undefined, opts?: object): void; +export function assertIfStatement(node: object | null | undefined, opts?: object): void; +export function assertLabeledStatement(node: object | null | undefined, opts?: object): void; +export function assertStringLiteral(node: object | null | undefined, opts?: object): void; +export function assertNumericLiteral(node: object | null | undefined, opts?: object): void; +export function assertNullLiteral(node: object | null | undefined, opts?: object): void; +export function assertBooleanLiteral(node: object | null | undefined, opts?: object): void; +export function assertRegExpLiteral(node: object | null | undefined, opts?: object): void; +export function assertLogicalExpression(node: object | null | undefined, opts?: object): void; +export function assertMemberExpression(node: object | null | undefined, opts?: object): void; +export function assertNewExpression(node: object | null | undefined, opts?: object): void; +export function assertProgram(node: object | null | undefined, opts?: object): void; +export function assertObjectExpression(node: object | null | undefined, opts?: object): void; +export function assertObjectMethod(node: object | null | undefined, opts?: object): void; +export function assertObjectProperty(node: object | null | undefined, opts?: object): void; +export function assertRestElement(node: object | null | undefined, opts?: object): void; +export function assertReturnStatement(node: object | null | undefined, opts?: object): void; +export function assertSequenceExpression(node: object | null | undefined, opts?: object): void; +export function assertSwitchCase(node: object | null | undefined, opts?: object): void; +export function assertSwitchStatement(node: object | null | undefined, opts?: object): void; +export function assertThisExpression(node: object | null | undefined, opts?: object): void; +export function assertThrowStatement(node: object | null | undefined, opts?: object): void; +export function assertTryStatement(node: object | null | undefined, opts?: object): void; +export function assertUnaryExpression(node: object | null | undefined, opts?: object): void; +export function assertUpdateExpression(node: object | null | undefined, opts?: object): void; +export function assertVariableDeclaration(node: object | null | undefined, opts?: object): void; +export function assertVariableDeclarator(node: object | null | undefined, opts?: object): void; +export function assertWhileStatement(node: object | null | undefined, opts?: object): void; +export function assertWithStatement(node: object | null | undefined, opts?: object): void; +export function assertAssignmentPattern(node: object | null | undefined, opts?: object): void; +export function assertArrayPattern(node: object | null | undefined, opts?: object): void; +export function assertArrowFunctionExpression(node: object | null | undefined, opts?: object): void; +export function assertClassBody(node: object | null | undefined, opts?: object): void; +export function assertClassDeclaration(node: object | null | undefined, opts?: object): void; +export function assertClassExpression(node: object | null | undefined, opts?: object): void; +export function assertExportAllDeclaration(node: object | null | undefined, opts?: object): void; +export function assertExportDefaultDeclaration(node: object | null | undefined, opts?: object): void; +export function assertExportNamedDeclaration(node: object | null | undefined, opts?: object): void; +export function assertExportSpecifier(node: object | null | undefined, opts?: object): void; +export function assertForOfStatement(node: object | null | undefined, opts?: object): void; +export function assertImportDeclaration(node: object | null | undefined, opts?: object): void; +export function assertImportDefaultSpecifier(node: object | null | undefined, opts?: object): void; +export function assertImportNamespaceSpecifier(node: object | null | undefined, opts?: object): void; +export function assertImportSpecifier(node: object | null | undefined, opts?: object): void; +export function assertMetaProperty(node: object | null | undefined, opts?: object): void; +export function assertClassMethod(node: object | null | undefined, opts?: object): void; +export function assertObjectPattern(node: object | null | undefined, opts?: object): void; +export function assertSpreadElement(node: object | null | undefined, opts?: object): void; +export function assertSuper(node: object | null | undefined, opts?: object): void; +export function assertTaggedTemplateExpression(node: object | null | undefined, opts?: object): void; +export function assertTemplateElement(node: object | null | undefined, opts?: object): void; +export function assertTemplateLiteral(node: object | null | undefined, opts?: object): void; +export function assertYieldExpression(node: object | null | undefined, opts?: object): void; +export function assertAnyTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertArrayTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertBooleanTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertClassImplements(node: object | null | undefined, opts?: object): void; +export function assertClassProperty(node: object | null | undefined, opts?: object): void; +export function assertDeclareClass(node: object | null | undefined, opts?: object): void; +export function assertDeclareFunction(node: object | null | undefined, opts?: object): void; +export function assertDeclareInterface(node: object | null | undefined, opts?: object): void; +export function assertDeclareModule(node: object | null | undefined, opts?: object): void; +export function assertDeclareTypeAlias(node: object | null | undefined, opts?: object): void; +export function assertDeclareVariable(node: object | null | undefined, opts?: object): void; +export function assertExistentialTypeParam(node: object | null | undefined, opts?: object): void; +export function assertFunctionTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertFunctionTypeParam(node: object | null | undefined, opts?: object): void; +export function assertGenericTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertInterfaceExtends(node: object | null | undefined, opts?: object): void; +export function assertInterfaceDeclaration(node: object | null | undefined, opts?: object): void; +export function assertIntersectionTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertMixedTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertNullableTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertNumericLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertNumberTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertStringTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertThisTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTupleTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTypeofTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTypeAlias(node: object | null | undefined, opts?: object): void; +export function assertTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTypeCastExpression(node: object | null | undefined, opts?: object): void; +export function assertTypeParameter(node: object | null | undefined, opts?: object): void; +export function assertTypeParameterDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTypeParameterInstantiation(node: object | null | undefined, opts?: object): void; +export function assertObjectTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertObjectTypeCallProperty(node: object | null | undefined, opts?: object): void; +export function assertObjectTypeIndexer(node: object | null | undefined, opts?: object): void; +export function assertObjectTypeProperty(node: object | null | undefined, opts?: object): void; +export function assertQualifiedTypeIdentifier(node: object | null | undefined, opts?: object): void; +export function assertUnionTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertVoidTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertJSXAttribute(node: object | null | undefined, opts?: object): void; +export function assertJSXClosingElement(node: object | null | undefined, opts?: object): void; +export function assertJSXElement(node: object | null | undefined, opts?: object): void; +export function assertJSXEmptyExpression(node: object | null | undefined, opts?: object): void; +export function assertJSXExpressionContainer(node: object | null | undefined, opts?: object): void; +export function assertJSXIdentifier(node: object | null | undefined, opts?: object): void; +export function assertJSXMemberExpression(node: object | null | undefined, opts?: object): void; +export function assertJSXNamespacedName(node: object | null | undefined, opts?: object): void; +export function assertJSXOpeningElement(node: object | null | undefined, opts?: object): void; +export function assertJSXSpreadAttribute(node: object | null | undefined, opts?: object): void; +export function assertJSXText(node: object | null | undefined, opts?: object): void; +export function assertNoop(node: object | null | undefined, opts?: object): void; +export function assertParenthesizedExpression(node: object | null | undefined, opts?: object): void; +export function assertAwaitExpression(node: object | null | undefined, opts?: object): void; +export function assertBindExpression(node: object | null | undefined, opts?: object): void; +export function assertDecorator(node: object | null | undefined, opts?: object): void; +export function assertDoExpression(node: object | null | undefined, opts?: object): void; +export function assertExportDefaultSpecifier(node: object | null | undefined, opts?: object): void; +export function assertExportNamespaceSpecifier(node: object | null | undefined, opts?: object): void; +export function assertRestProperty(node: object | null | undefined, opts?: object): void; +export function assertSpreadProperty(node: object | null | undefined, opts?: object): void; +export function assertExpression(node: object | null | undefined, opts?: object): void; +export function assertBinary(node: object | null | undefined, opts?: object): void; +export function assertScopable(node: object | null | undefined, opts?: object): void; +export function assertBlockParent(node: object | null | undefined, opts?: object): void; +export function assertBlock(node: object | null | undefined, opts?: object): void; +export function assertStatement(node: object | null | undefined, opts?: object): void; +export function assertTerminatorless(node: object | null | undefined, opts?: object): void; +export function assertCompletionStatement(node: object | null | undefined, opts?: object): void; +export function assertConditional(node: object | null | undefined, opts?: object): void; +export function assertLoop(node: object | null | undefined, opts?: object): void; +export function assertWhile(node: object | null | undefined, opts?: object): void; +export function assertExpressionWrapper(node: object | null | undefined, opts?: object): void; +export function assertFor(node: object | null | undefined, opts?: object): void; +export function assertForXStatement(node: object | null | undefined, opts?: object): void; +export function assertFunction(node: object | null | undefined, opts?: object): void; +export function assertFunctionParent(node: object | null | undefined, opts?: object): void; +export function assertPureish(node: object | null | undefined, opts?: object): void; +export function assertDeclaration(node: object | null | undefined, opts?: object): void; +export function assertLVal(node: object | null | undefined, opts?: object): void; +export function assertLiteral(node: object | null | undefined, opts?: object): void; +export function assertImmutable(node: object | null | undefined, opts?: object): void; +export function assertUserWhitespacable(node: object | null | undefined, opts?: object): void; +export function assertMethod(node: object | null | undefined, opts?: object): void; +export function assertObjectMember(node: object | null | undefined, opts?: object): void; +export function assertProperty(node: object | null | undefined, opts?: object): void; +export function assertUnaryLike(node: object | null | undefined, opts?: object): void; +export function assertPattern(node: object | null | undefined, opts?: object): void; +export function assertClass(node: object | null | undefined, opts?: object): void; +export function assertModuleDeclaration(node: object | null | undefined, opts?: object): void; +export function assertExportDeclaration(node: object | null | undefined, opts?: object): void; +export function assertModuleSpecifier(node: object | null | undefined, opts?: object): void; +export function assertFlow(node: object | null | undefined, opts?: object): void; +export function assertFlowBaseAnnotation(node: object | null | undefined, opts?: object): void; +export function assertFlowDeclaration(node: object | null | undefined, opts?: object): void; +export function assertJSX(node: object | null | undefined, opts?: object): void; +export function assertNumberLiteral(node: object | null | undefined, opts?: object): void; +export function assertRegexLiteral(node: object | null | undefined, opts?: object): void; -export function assertTSAnyKeyword(node: object, opts?: object): void; -export function assertTSArrayType(node: object, opts?: object): void; -export function assertTSAsExpression(node: object, opts?: object): void; -export function assertTSBooleanKeyword(node: object, opts?: object): void; -export function assertTSCallSignatureDeclaration(node: object, opts?: object): void; -export function assertTSConstructSignatureDeclaration(node: object, opts?: object): void; -export function assertTSConstructorType(node: object, opts?: object): void; -export function assertTSDeclareFunction(node: object, opts?: object): void; -export function assertTSDeclareMethod(node: object, opts?: object): void; -export function assertTSEnumDeclaration(node: object, opts?: object): void; -export function assertTSEnumMember(node: object, opts?: object): void; -export function assertTSExportAssignment(node: object, opts?: object): void; -export function assertTSExpressionWithTypeArguments(node: object, opts?: object): void; -export function assertTSExternalModuleReference(node: object, opts?: object): void; -export function assertTSFunctionType(node: object, opts?: object): void; -export function assertTSImportEqualsDeclaration(node: object, opts?: object): void; -export function assertTSIndexSignature(node: object, opts?: object): void; -export function assertTSIndexedAccessType(node: object, opts?: object): void; -export function assertTSInterfaceBody(node: object, opts?: object): void; -export function assertTSInterfaceDeclaration(node: object, opts?: object): void; -export function assertTSIntersectionType(node: object, opts?: object): void; -export function assertTSLiteralType(node: object, opts?: object): void; -export function assertTSMappedType(node: object, opts?: object): void; -export function assertTSMethodSignature(node: object, opts?: object): void; -export function assertTSModuleBlock(node: object, opts?: object): void; -export function assertTSModuleDeclaration(node: object, opts?: object): void; -export function assertTSNamespaceExportDeclaration(node: object, opts?: object): void; -export function assertTSNeverKeyword(node: object, opts?: object): void; -export function assertTSNonNullExpression(node: object, opts?: object): void; -export function assertTSNullKeyword(node: object, opts?: object): void; -export function assertTSNumberKeyword(node: object, opts?: object): void; -export function assertTSObjectKeyword(node: object, opts?: object): void; -export function assertTSParameterProperty(node: object, opts?: object): void; -export function assertTSParenthesizedType(node: object, opts?: object): void; -export function assertTSPropertySignature(node: object, opts?: object): void; -export function assertTSQualifiedName(node: object, opts?: object): void; -export function assertTSStringKeyword(node: object, opts?: object): void; -export function assertTSSymbolKeyword(node: object, opts?: object): void; -export function assertTSThisType(node: object, opts?: object): void; -export function assertTSTupleType(node: object, opts?: object): void; -export function assertTSTypeAliasDeclaration(node: object, opts?: object): void; -export function assertTSTypeAnnotation(node: object, opts?: object): void; -export function assertTSTypeAssertion(node: object, opts?: object): void; -export function assertTSTypeLiteral(node: object, opts?: object): void; -export function assertTSTypeOperator(node: object, opts?: object): void; -export function assertTSTypeParameter(node: object, opts?: object): void; -export function assertTSTypeParameterDeclaration(node: object, opts?: object): void; -export function assertTSTypeParameterInstantiation(node: object, opts?: object): void; -export function assertTSTypePredicate(node: object, opts?: object): void; -export function assertTSTypeQuery(node: object, opts?: object): void; -export function assertTSTypeReference(node: object, opts?: object): void; -export function assertTSUndefinedKeyword(node: object, opts?: object): void; -export function assertTSUnionType(node: object, opts?: object): void; -export function assertTSVoidKeyword(node: object, opts?: object): void; +export function assertTSAnyKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSArrayType(node: object | null | undefined, opts?: object): void; +export function assertTSAsExpression(node: object | null | undefined, opts?: object): void; +export function assertTSBooleanKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSCallSignatureDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSConstructorType(node: object | null | undefined, opts?: object): void; +export function assertTSDeclareFunction(node: object | null | undefined, opts?: object): void; +export function assertTSDeclareMethod(node: object | null | undefined, opts?: object): void; +export function assertTSEnumDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSEnumMember(node: object | null | undefined, opts?: object): void; +export function assertTSExportAssignment(node: object | null | undefined, opts?: object): void; +export function assertTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object): void; +export function assertTSExternalModuleReference(node: object | null | undefined, opts?: object): void; +export function assertTSFunctionType(node: object | null | undefined, opts?: object): void; +export function assertTSImportEqualsDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSIndexSignature(node: object | null | undefined, opts?: object): void; +export function assertTSIndexedAccessType(node: object | null | undefined, opts?: object): void; +export function assertTSInterfaceBody(node: object | null | undefined, opts?: object): void; +export function assertTSInterfaceDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSIntersectionType(node: object | null | undefined, opts?: object): void; +export function assertTSLiteralType(node: object | null | undefined, opts?: object): void; +export function assertTSMappedType(node: object | null | undefined, opts?: object): void; +export function assertTSMethodSignature(node: object | null | undefined, opts?: object): void; +export function assertTSModuleBlock(node: object | null | undefined, opts?: object): void; +export function assertTSModuleDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSNeverKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSNonNullExpression(node: object | null | undefined, opts?: object): void; +export function assertTSNullKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSNumberKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSObjectKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSParameterProperty(node: object | null | undefined, opts?: object): void; +export function assertTSParenthesizedType(node: object | null | undefined, opts?: object): void; +export function assertTSPropertySignature(node: object | null | undefined, opts?: object): void; +export function assertTSQualifiedName(node: object | null | undefined, opts?: object): void; +export function assertTSStringKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSSymbolKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSThisType(node: object | null | undefined, opts?: object): void; +export function assertTSTupleType(node: object | null | undefined, opts?: object): void; +export function assertTSTypeAliasDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSTypeAnnotation(node: object | null | undefined, opts?: object): void; +export function assertTSTypeAssertion(node: object | null | undefined, opts?: object): void; +export function assertTSTypeLiteral(node: object | null | undefined, opts?: object): void; +export function assertTSTypeOperator(node: object | null | undefined, opts?: object): void; +export function assertTSTypeParameter(node: object | null | undefined, opts?: object): void; +export function assertTSTypeParameterDeclaration(node: object | null | undefined, opts?: object): void; +export function assertTSTypeParameterInstantiation(node: object | null | undefined, opts?: object): void; +export function assertTSTypePredicate(node: object | null | undefined, opts?: object): void; +export function assertTSTypeQuery(node: object | null | undefined, opts?: object): void; +export function assertTSTypeReference(node: object | null | undefined, opts?: object): void; +export function assertTSUndefinedKeyword(node: object | null | undefined, opts?: object): void; +export function assertTSUnionType(node: object | null | undefined, opts?: object): void; +export function assertTSVoidKeyword(node: object | null | undefined, opts?: object): void; diff --git a/types/babel-types/tsconfig.json b/types/babel-types/tsconfig.json index 92d7d6442e..f4a6179f99 100644 --- a/types/babel-types/tsconfig.json +++ b/types/babel-types/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/babel__traverse/babel__traverse-tests.ts b/types/babel__traverse/babel__traverse-tests.ts index 98a0338021..2bc5a404d6 100644 --- a/types/babel__traverse/babel__traverse-tests.ts +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -1,17 +1,15 @@ -import traverse, { Visitor } from "@babel/traverse"; +import traverse, { Visitor, NodePath } 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(path) { - // $ExpectType NodePath - path; + const x: NodePath = path; console.log("Entered!"); }, exit(path) { - // $ExpectType NodePath - path; + const x: NodePath = path; console.log("Exited!"); } } diff --git a/types/babelify/tslint.json b/types/babelify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/babelify/tslint.json +++ b/types/babelify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/babyparse/tslint.json b/types/babyparse/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/babyparse/tslint.json +++ b/types/babyparse/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-associations/tslint.json b/types/backbone-associations/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone-associations/tslint.json +++ b/types/backbone-associations/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-fetch-cache/tslint.json b/types/backbone-fetch-cache/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone-fetch-cache/tslint.json +++ b/types/backbone-fetch-cache/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone-relational/tslint.json b/types/backbone-relational/tslint.json index 65e27fce52..fd5f6a3567 100644 --- a/types/backbone-relational/tslint.json +++ b/types/backbone-relational/tslint.json @@ -4,6 +4,7 @@ "array-type": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "jsdoc-format": false, "max-line-length": false, diff --git a/types/backbone.layoutmanager/tslint.json b/types/backbone.layoutmanager/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/backbone.layoutmanager/tslint.json +++ b/types/backbone.layoutmanager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.localstorage/tslint.json b/types/backbone.localstorage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.localstorage/tslint.json +++ b/types/backbone.localstorage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.paginator/tslint.json b/types/backbone.paginator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.paginator/tslint.json +++ b/types/backbone.paginator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone.radio/tslint.json b/types/backbone.radio/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backbone.radio/tslint.json +++ b/types/backbone.radio/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backbone/tslint.json b/types/backbone/tslint.json index f5ae3a6788..ab605d9227 100644 --- a/types/backbone/tslint.json +++ b/types/backbone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "export-just-namespace": false, "interface-name": false, "jsdoc-format": false, diff --git a/types/backgrid/tslint.json b/types/backgrid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backgrid/tslint.json +++ b/types/backgrid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/backlog-js/tslint.json b/types/backlog-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/backlog-js/tslint.json +++ b/types/backlog-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/baconjs/tslint.json b/types/baconjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/baconjs/tslint.json +++ b/types/baconjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/baidumap-web-sdk/tslint.json b/types/baidumap-web-sdk/tslint.json index eccb336643..43797d8dd7 100644 --- a/types/baidumap-web-sdk/tslint.json +++ b/types/baidumap-web-sdk/tslint.json @@ -7,6 +7,7 @@ "ban-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "max-line-length": false, "member-access": false, diff --git a/types/barcode/tslint.json b/types/barcode/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/barcode/tslint.json +++ b/types/barcode/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bardjs/tslint.json b/types/bardjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bardjs/tslint.json +++ b/types/bardjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/base16/tslint.json b/types/base16/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/base16/tslint.json +++ b/types/base16/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bases/tslint.json b/types/bases/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bases/tslint.json +++ b/types/bases/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/basicauth-middleware/index.d.ts b/types/basicauth-middleware/index.d.ts index 21e3a27ad8..38aedd850b 100644 --- a/types/basicauth-middleware/index.d.ts +++ b/types/basicauth-middleware/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for basicauth-middleware 3.1 // Project: https://github.com/nchaulet/basicauth-middleware -// Definitions by: My Self +// Definitions by: Nicolas Chaulet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 diff --git a/types/batch-stream/tslint.json b/types/batch-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/batch-stream/tslint.json +++ b/types/batch-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bazinga-translator/tslint.json b/types/bazinga-translator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bazinga-translator/tslint.json +++ b/types/bazinga-translator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcrypt-nodejs/tslint.json b/types/bcrypt-nodejs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcrypt-nodejs/tslint.json +++ b/types/bcrypt-nodejs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcrypt/tslint.json b/types/bcrypt/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcrypt/tslint.json +++ b/types/bcrypt/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bcryptjs/tslint.json b/types/bcryptjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bcryptjs/tslint.json +++ b/types/bcryptjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/benchmark/tslint.json b/types/benchmark/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/benchmark/tslint.json +++ b/types/benchmark/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/better-curry/tslint.json b/types/better-curry/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/better-curry/tslint.json +++ b/types/better-curry/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/better-sqlite3/better-sqlite3-tests.ts b/types/better-sqlite3/better-sqlite3-tests.ts index f5a6c0e070..ac72affc05 100644 --- a/types/better-sqlite3/better-sqlite3-tests.ts +++ b/types/better-sqlite3/better-sqlite3-tests.ts @@ -11,7 +11,7 @@ const registrationOptions: Sqlite.RegistrationOptions = { }; let db: Sqlite.Database = Sqlite('.'); -db = new Sqlite('.', { memory: true }); +db = new Sqlite('.', { memory: true, verbose: () => {} }); db.exec('CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL);'); db.exec('INSERT INTO test(name) VALUES("name");'); db.pragma('data_version', { simple: true }); diff --git a/types/better-sqlite3/index.d.ts b/types/better-sqlite3/index.d.ts index 32a71d96af..57a17e897f 100644 --- a/types/better-sqlite3/index.d.ts +++ b/types/better-sqlite3/index.d.ts @@ -5,6 +5,7 @@ // Santiago Aguilar // Alessandro Vergani // Andrew Kaiser +// Mark Stewart // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 @@ -97,6 +98,7 @@ declare namespace Database { readonly?: boolean; fileMustExist?: boolean; timeout?: number; + verbose?: (message?: any, ...additionalArgs: any[]) => void; } interface PragmaOptions { diff --git a/types/bezier-js/tslint.json b/types/bezier-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bezier-js/tslint.json +++ b/types/bezier-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bgiframe/tslint.json b/types/bgiframe/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bgiframe/tslint.json +++ b/types/bgiframe/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bigint/tslint.json b/types/bigint/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bigint/tslint.json +++ b/types/bigint/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bignum/tslint.json b/types/bignum/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bignum/tslint.json +++ b/types/bignum/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bigscreen/tslint.json b/types/bigscreen/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bigscreen/tslint.json +++ b/types/bigscreen/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bind-ponyfill/tslint.json b/types/bind-ponyfill/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bind-ponyfill/tslint.json +++ b/types/bind-ponyfill/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bintrees/tslint.json b/types/bintrees/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bintrees/tslint.json +++ b/types/bintrees/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bip21/tslint.json b/types/bip21/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bip21/tslint.json +++ b/types/bip21/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bip32/index.d.ts b/types/bip32/index.d.ts index c536f741af..e76deef810 100644 --- a/types/bip32/index.d.ts +++ b/types/bip32/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for bip32 1.0 // Project: https://github.com/bitcoinjs/bip32#readme -// Definitions by: My Self +// Definitions by: eduhenke // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/bit-array/tslint.json b/types/bit-array/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bit-array/tslint.json +++ b/types/bit-array/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index cc24c6573b..a2db324e39 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -20,6 +20,10 @@ keyPair3.toWIF(); bitcoin.payments.p2pkh({ pubkey: keyPair3.publicKey }); const network = keyPair3.network; +const keyPair4 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.regtest, rng}); +keyPair4.toWIF(); +bitcoin.payments.p2pkh({ pubkey: keyPair4.publicKey }); + // Test TransactionBuilder and Transaction const txb = new bitcoin.TransactionBuilder(); txb.addInput('aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31', 0); diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 4fb1bb16a7..7cedbc822a 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -191,6 +191,7 @@ export class TransactionBuilder { export const networks: { bitcoin: Network; testnet: Network; + regtest: Network; }; export const opcodes: { diff --git a/types/bl/tslint.json b/types/bl/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bl/tslint.json +++ b/types/bl/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blazy/tslint.json b/types/blazy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blazy/tslint.json +++ b/types/blazy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bleno/tslint.json b/types/bleno/tslint.json index 0f5eeaf557..d895c355d8 100644 --- a/types/bleno/tslint.json +++ b/types/bleno/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { "dt-header": false, + "npm-naming": false, "unified-signatures": false } } diff --git a/types/blessed/blessed-tests.ts b/types/blessed/blessed-tests.ts index aa38af8985..00df6dbc7a 100644 --- a/types/blessed/blessed-tests.ts +++ b/types/blessed/blessed-tests.ts @@ -6,6 +6,24 @@ let screen: blessed.Widgets.Screen = null; // https://github.com/chjj/blessed/blob/master/test/widget-autopad.js +screen = blessed.screen({ + log: __dirname + "/logs/just-logs.log" +}); + +screen = blessed.screen({ + log: __dirname + "/logs/just-logs.log", + dump: false +}); + +screen = blessed.screen({ + dump: __dirname + "/logs/logs-and-all-in-and-output.log" +}); + +screen = blessed.screen({ + log: __dirname + "/logs/logs-and-all-in-and-output.log", + dump: true +}); + screen = blessed.screen({ dump: __dirname + "/logs/autopad.log", smartCSR: true, diff --git a/types/blessed/index.d.ts b/types/blessed/index.d.ts index 7dae1709d2..53dbf48706 100644 --- a/types/blessed/index.d.ts +++ b/types/blessed/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for blessed 0.1 // Project: https://github.com/chjj/blessed -// Definitions by: Bryn Austin Bellomy , Steve Kellock +// Definitions by: Bryn Austin Bellomy +// Steve Kellock +// Max Brauer // Definitions: https://github.com/borisyankov/DefinitelyTyped // TypeScript Version: 2.1 @@ -925,12 +927,12 @@ export namespace Widgets { /** * Create a log file. See log method. */ - log?(...msg: any[]): void; + log?: string; /** * Dump all output and input to desired file. Can be used together with log option if set as a boolean. */ - dump?: string; + dump?: string | boolean; /** * Debug mode. Enables usage of the debug method. Also creates a debug console which will display when diff --git a/types/blessed/tslint.json b/types/blessed/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blessed/tslint.json +++ b/types/blessed/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blissfuljs/tslint.json b/types/blissfuljs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blissfuljs/tslint.json +++ b/types/blissfuljs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blob-stream/tslint.json b/types/blob-stream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blob-stream/tslint.json +++ b/types/blob-stream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blocks/tslint.json b/types/blocks/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blocks/tslint.json +++ b/types/blocks/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blue-tape/tslint.json b/types/blue-tape/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blue-tape/tslint.json +++ b/types/blue-tape/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/blueimp-md5/tslint.json b/types/blueimp-md5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/blueimp-md5/tslint.json +++ b/types/blueimp-md5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bn.js/bn.js-tests.ts b/types/bn.js/bn.js-tests.ts index 738d5220d4..68d3754aab 100644 --- a/types/bn.js/bn.js-tests.ts +++ b/types/bn.js/bn.js-tests.ts @@ -16,3 +16,8 @@ const red = bn.toRed(ctx); const newRed = red.redAdd(new BN(1)); newRed.cmp(bn); newRed.fromRed(); + +const expected = new BN(0x4020); +const actualArray = new BN([0x40, 0x20]); +const actualUint8Array = new BN(new Uint8Array([0x40, 0x20])); +const actualString = new BN('0x4020'); diff --git a/types/bn.js/index.d.ts b/types/bn.js/index.d.ts index be04dbcc5f..4126f6f017 100644 --- a/types/bn.js/index.d.ts +++ b/types/bn.js/index.d.ts @@ -25,12 +25,12 @@ interface ReductionContext { declare class BN { constructor( - number: number | string | number[] | Buffer | BN, + number: number | string | number[] | Uint8Array | Buffer | BN, base?: number | 'hex', endian?: Endianness ); constructor( - number: number | string | number[] | Buffer | BN, + number: number | string | number[] | Uint8Array | Buffer | BN, endian?: Endianness ) diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index 7467b3178f..2edb269875 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bookshelfjs v0.9.4 +// Type definitions for bookshelfjs v0.13.0 // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -317,6 +317,7 @@ declare namespace Bookshelf { interface SyncOptions { transacting?: Knex.Transaction; debug?: boolean; + withSchema?: string; } interface CollectionOptions { diff --git a/types/globby/package.json b/types/bookshelf/package.json similarity index 63% rename from types/globby/package.json rename to types/bookshelf/package.json index 136d4694e9..7bd76f13f8 100644 --- a/types/globby/package.json +++ b/types/bookshelf/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "fast-glob": "^2.0.2" + "knex": "^0.16.1" } } diff --git a/types/bookshelf/tslint.json b/types/bookshelf/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/bookshelf/tslint.json +++ b/types/bookshelf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/boolify-string/tslint.json b/types/boolify-string/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/boolify-string/tslint.json +++ b/types/boolify-string/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootbox/tslint.json b/types/bootbox/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootbox/tslint.json +++ b/types/bootbox/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootpag/tslint.json b/types/bootpag/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootpag/tslint.json +++ b/types/bootpag/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-datepicker/tslint.json b/types/bootstrap-datepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-datepicker/tslint.json +++ b/types/bootstrap-datepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-fileinput/tslint.json b/types/bootstrap-fileinput/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-fileinput/tslint.json +++ b/types/bootstrap-fileinput/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts index 78f92fcf71..a6b023d121 100644 --- a/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts +++ b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts @@ -14,7 +14,6 @@ let options: BootstrapGrowlIfightcrime.Options = { type: 'info', offset: offsetOptions, align: 'right', - width: 250, delay: 4000, allow_dismiss: true, stackup_spacing: 10 @@ -22,4 +21,16 @@ let options: BootstrapGrowlIfightcrime.Options = { $(document).ready(() => { $.bootstrapGrowl('Alert with options', options); + + const optionsWidthAuto: BootstrapGrowlIfightcrime.Options = { + ...options, + width: 'auto' + }; + $.bootstrapGrowl('Alert with options, width=auto', optionsWidthAuto); + + const optionsWidthAsNumber = { + ...options, + width: 120 + }; + $.bootstrapGrowl('Alert with options, width=120', optionsWidthAsNumber); }); diff --git a/types/bootstrap-growl-ifightcrime/index.d.ts b/types/bootstrap-growl-ifightcrime/index.d.ts index 45755682ea..2d37135be3 100644 --- a/types/bootstrap-growl-ifightcrime/index.d.ts +++ b/types/bootstrap-growl-ifightcrime/index.d.ts @@ -47,9 +47,9 @@ declare namespace BootstrapGrowlIfightcrime { align?: AlignType; /** - * Integer + * Integer or 'auto' */ - width?: number; + width?: number | 'auto'; /** * Time while the message will be displayed. It's not equivalent to the *demo* timeOut! diff --git a/types/bootstrap-maxlength/tslint.json b/types/bootstrap-maxlength/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-maxlength/tslint.json +++ b/types/bootstrap-maxlength/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-notify/bootstrap-notify-tests.ts b/types/bootstrap-notify/bootstrap-notify-tests.ts index 2977d39abf..4b288b2ca0 100644 --- a/types/bootstrap-notify/bootstrap-notify-tests.ts +++ b/types/bootstrap-notify/bootstrap-notify-tests.ts @@ -46,4 +46,21 @@ $.notify({ '' + '' + '' -}); \ No newline at end of file +}); + +const notifyResult = $.notify({ + message: 'Callbacks have the popup element as an argument', +},{ + onShow: function($ele) { + notifyResult.$ele === $ele; + }, + onShown: function($ele) { + notifyResult.$ele === $ele; + }, + onClose: function($ele) { + notifyResult.$ele === $ele; + }, + onClosed: function($ele) { + notifyResult.$ele === $ele; + }, +}); diff --git a/types/bootstrap-notify/index.d.ts b/types/bootstrap-notify/index.d.ts index 540f200d9c..75994ad365 100644 --- a/types/bootstrap-notify/index.d.ts +++ b/types/bootstrap-notify/index.d.ts @@ -48,16 +48,16 @@ interface NotifySettings { enter?: string; exit?: string; }; - onShow?: () => void; - onShown?: () => void; - onClose?: () => void; - onClosed?: () => void; + onShow?: ($ele: JQuery) => void; + onShown?: ($ele: JQuery) => void; + onClose?: ($ele: JQuery) => void; + onClosed?: ($ele: JQuery) => void; icon_type?: string; template?: string; } interface NotifyReturn { - $ele: JQueryStatic; + $ele: JQuery; close: () => void; update: (command: string, update: any) => void; } diff --git a/types/bootstrap-notify/tslint.json b/types/bootstrap-notify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-notify/tslint.json +++ b/types/bootstrap-notify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-select/tslint.json b/types/bootstrap-select/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-select/tslint.json +++ b/types/bootstrap-select/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-switch/tslint.json b/types/bootstrap-switch/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-switch/tslint.json +++ b/types/bootstrap-switch/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-table/tslint.json b/types/bootstrap-table/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-table/tslint.json +++ b/types/bootstrap-table/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap-touchspin/tslint.json b/types/bootstrap-touchspin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap-touchspin/tslint.json +++ b/types/bootstrap-touchspin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap.paginator/tslint.json b/types/bootstrap.paginator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap.paginator/tslint.json +++ b/types/bootstrap.paginator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap.timepicker/tslint.json b/types/bootstrap.timepicker/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bootstrap.timepicker/tslint.json +++ b/types/bootstrap.timepicker/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index 9344423cfb..01e5d5352f 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -196,6 +196,12 @@ $("#popover").popover({ offset: 10, fallbackPlacement: ["flip", "clockwise"], boundary: "scrollParent", + sanitize: false, + whiteList: { + h1: [], + img: ['src', 'alt', 'title', 'width', 'height'], + }, + sanitizeFn: (x: string) => x.replace("<", ""), }); $("#popover").popover({ @@ -207,6 +213,10 @@ $("#popover").popover({ }, }); +$("#popover").popover({ + sanitizeFn: null, +}); + // -------------------------------------------------------------------------------------- // Scrollspy // -------------------------------------------------------------------------------------- @@ -280,10 +290,23 @@ $("#tooltip").on("hide.bs.tooltip", () => {}); $("#tooltip").tooltip({ animation: false, -}); - -$("#tooltip").tooltip({ container: "#container", + delay: {show: 500, hide: 100}, + html: true, + placement: "auto", + selector: "[rel=\"tooltip\"]", + template: '', + title: "Hello world", + trigger: "hover focus", + offset: 10, + fallbackPlacement: ["flip", "clockwise"], + boundary: "scrollParent", + sanitize: false, + whiteList: { + h1: [], + img: ['src', 'alt', 'title', 'width', 'height'], + }, + sanitizeFn: (x: string) => x.replace("<", ""), }); $("#tooltip").tooltip({ @@ -298,18 +321,6 @@ $("#tooltip").tooltip({ delay: 250, }); -$("#tooltip").tooltip({ - delay: {show: 500, hide: 100}, -}); - -$("#tooltip").tooltip({ - html: true, -}); - -$("#tooltip").tooltip({ - placement: "auto", -}); - $("#tooltip").tooltip({ placement(this, tooltip, trigger) { console.log(this.tip === tooltip); @@ -327,22 +338,10 @@ $("#tooltip").tooltip({ }, }); -$("#tooltip").tooltip({ - selector: "[rel=\"tooltip\"]", -}); - $("#tooltip").tooltip({ selector: false, }); -$("#tooltip").tooltip({ - template: '', -}); - -$("#tooltip").tooltip({ - title: "Hello world", -}); - $("#tooltip").tooltip({ title: document.getElementById("title-element") as HTMLElement, }); @@ -353,14 +352,6 @@ $("#tooltip").tooltip({ }, }); -$("#tooltip").tooltip({ - trigger: "hover focus", -}); - -$("#tooltip").tooltip({ - offset: 10, -}); - $("#tooltip").tooltip({ offset: "10px", }); @@ -369,14 +360,10 @@ $("#tooltip").tooltip({ fallbackPlacement: "clockwise", }); -$("#tooltip").tooltip({ - fallbackPlacement: ["flip", "clockwise"], -}); - -$("#tooltip").tooltip({ - boundary: "scrollParent", -}); - $("#tooltip").tooltip({ boundary: aHtmlElement, }); + +$("#popover").popover({ + sanitizeFn: null, +}); diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 2fb473fc29..6dc5f21a28 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap 4.2 +// Type definitions for Bootstrap 4.3 // Project: https://github.com/twbs/bootstrap/, https://getbootstrap.com // Definitions by: denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -352,6 +352,25 @@ export interface TooltipOption { * @default "scrollParent" */ boundary?: Popper.Boundary | HTMLElement; + + /** + * Enable or disable the sanitization. If activated 'template', 'content' and 'title' options will be sanitized. + * + * @default true + */ + sanitize?: boolean; + + /** + * Object which contains allowed attributes and tags. + */ + whiteList?: {[key: string]: string[]}; + + /** + * Here you can supply your own sanitize function. This can be useful if you prefer to use a dedicated library to perform sanitization. + * + * @default null + */ + sanitizeFn?: null | ((input: string) => string); } // -------------------------------------------------------------------------------------- diff --git a/types/bounce.js/tslint.json b/types/bounce.js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bounce.js/tslint.json +++ b/types/bounce.js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/box2d/tslint.json b/types/box2d/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/box2d/tslint.json +++ b/types/box2d/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/boxen/boxen-tests.ts b/types/boxen/boxen-tests.ts deleted file mode 100644 index 303e5dd7fa..0000000000 --- a/types/boxen/boxen-tests.ts +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100644 index 94b68bb5c7..0000000000 --- a/types/boxen/index.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -// 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/bpmn-moddle/index.d.ts b/types/bpmn-moddle/index.d.ts index f4411e05fa..43a6431308 100644 --- a/types/bpmn-moddle/index.d.ts +++ b/types/bpmn-moddle/index.d.ts @@ -25,6 +25,7 @@ declare namespace BPMNModdle { interface TypeDerived { $type: ElementType; + $parent: TypeDerived; } interface BaseElement extends TypeDerived { /** diff --git a/types/braft-editor/index.d.ts b/types/braft-editor/index.d.ts index 62f339a41b..0edeb34b2c 100644 --- a/types/braft-editor/index.d.ts +++ b/types/braft-editor/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for braft-editor 1.9 // Project: https://github.com/margox/braft#readme -// Definitions by: My Self +// Definitions by: Jonny Yao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 diff --git a/types/braintree-web/tslint.json b/types/braintree-web/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/braintree-web/tslint.json +++ b/types/braintree-web/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/breeze/tslint.json b/types/breeze/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/breeze/tslint.json +++ b/types/breeze/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bro-fs/index.d.ts b/types/bro-fs/index.d.ts index e0d11cddbe..e2d53cb8a1 100644 --- a/types/bro-fs/index.d.ts +++ b/types/bro-fs/index.d.ts @@ -44,6 +44,8 @@ export function isSupported(): boolean; export function mkdir(path: string): Promise; export function readdir(path: string | DirectoryEntry, options?: {deep?: boolean}): Promise; export function readFile(path: string | FileEntry, options: {type: 'ArrayBuffer'}): Promise; +export function readFile(path: string | FileEntry, options: {type: 'Blob'}): Promise; +export function readFile(path: string | FileEntry, options: {type: 'File'}): Promise; export function readFile(path: string | FileEntry, options?: {type?: TextType}): Promise; export function rename(oldPath: string | FileEntry, newPath: string, options?: {create?: boolean}): Promise; export function rmdir(path: string | DirectoryEntry): Promise; diff --git a/types/brorand/tslint.json b/types/brorand/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/brorand/tslint.json +++ b/types/brorand/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-harness/tslint.json b/types/browser-harness/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-harness/tslint.json +++ b/types/browser-harness/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-pack/tslint.json b/types/browser-pack/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-pack/tslint.json +++ b/types/browser-pack/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-report/tslint.json b/types/browser-report/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-report/tslint.json +++ b/types/browser-report/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-resolve/tslint.json b/types/browser-resolve/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-resolve/tslint.json +++ b/types/browser-resolve/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index 72399f1618..58b85e09f3 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -7,7 +7,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -/// /// /// diff --git a/types/browser-sync/package.json b/types/browser-sync/package.json new file mode 100644 index 0000000000..a0e2ec3c5c --- /dev/null +++ b/types/browser-sync/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "chokidar": "^2.1.2" + } +} diff --git a/types/browser-sync/tslint.json b/types/browser-sync/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browser-sync/tslint.json +++ b/types/browser-sync/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browserify/tslint.json b/types/browserify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/browserify/tslint.json +++ b/types/browserify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/browserslist/browserslist-tests.ts b/types/browserslist/browserslist-tests.ts index d5e88e5b5d..4617fc2490 100644 --- a/types/browserslist/browserslist-tests.ts +++ b/types/browserslist/browserslist-tests.ts @@ -1,4 +1,5 @@ import browserslist from "browserslist"; +import BrowserslistError from "browserslist/error"; browserslist(); // $ExpectType string[] browserslist(""); // $ExpectType string[] @@ -20,3 +21,5 @@ for (const opt of opts) { browserslist.coverage([""]); // $ExpectType number browserslist.coverage([""], { "": { "": 0 } }); // $ExpectType number + +new BrowserslistError('error'); // $ExpectType BrowserslistError diff --git a/types/browserslist/error.d.ts b/types/browserslist/error.d.ts new file mode 100644 index 0000000000..1c3e584471 --- /dev/null +++ b/types/browserslist/error.d.ts @@ -0,0 +1,6 @@ +declare class BrowserslistError extends Error { + constructor(message: any); + browserslist: true; +} + +export = BrowserslistError; diff --git a/types/browserslist/index.d.ts b/types/browserslist/index.d.ts index 7c4a0add0c..8850a45129 100644 --- a/types/browserslist/index.d.ts +++ b/types/browserslist/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for browserslist 4.3 +// Type definitions for browserslist 4.4 // Project: https://github.com/browserslist/browserslist#readme // Definitions by: Dave Cardwell +// Andrew Leedham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 diff --git a/types/browserslist/tsconfig.json b/types/browserslist/tsconfig.json index cf68d8bf64..4dbd0e9b45 100644 --- a/types/browserslist/tsconfig.json +++ b/types/browserslist/tsconfig.json @@ -13,5 +13,5 @@ "forceConsistentCasingInFileNames": true, "esModuleInterop": true }, - "files": ["index.d.ts", "browserslist-tests.ts"] + "files": ["index.d.ts", "browserslist-tests.ts", "error.d.ts"] } diff --git a/types/bser/index.d.ts b/types/bser/index.d.ts new file mode 100644 index 0000000000..75695d85b1 --- /dev/null +++ b/types/bser/index.d.ts @@ -0,0 +1,100 @@ +// Type definitions for bser 2.0 +// Project: https://facebook.github.io/watchman/docs/bser.html +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +/// + +import { EventEmitter } from "events"; +import Int64 = require("node-int64"); + +export type InputWrapper = + | Buffer + | string + | NodeJS.TypedArray + | DataView + | ArrayBuffer + | SharedArrayBuffer; +export type IntWrapper = number | Int64; +export type AnyWrapper = boolean | IntWrapper | null | string | object; + +export class Accumulator { + buf: Buffer; + readOffset: number; + writeOffset: number; + + constructor(initsize?: number); + + append(buf: InputWrapper): void; + + assertReadableSize(size: number): void; + + peekDouble(): number; + + peekInt(size: number): IntWrapper; + + peekString(size: number): string; + + readAdvance(size: number): void; + + readAvail(): number; + + readDouble(): number; + + // replace "IntWrapper" with "number"? + readInt(bytes: number): IntWrapper; + + readString(size: number): string; + + reserve(size: number): void; + + writeAvail(): number; + + writeByte(value: number): void; + + writeDouble(value: number): void; + + writeInt(value: number, size: number): void; +} + +export class BunserBuf extends EventEmitter { + buf: Accumulator; + state: 0 | 1; + // replace "IntWrapper" with "number"? + pduLen?: false | IntWrapper; + + constructor(); + + append( + buf: InputWrapper, + synchronous?: false + ): AnyWrapper | AnyWrapper[] | undefined; + append(buf: InputWrapper, synchronous: true): void; + + decodeAny(): AnyWrapper | AnyWrapper[]; + + decodeArray(): AnyWrapper[]; + + // replace "IntWrapper" with "number"? + decodeInt(relaxSizeAsserts?: boolean): false | IntWrapper; + + decodeObject(): object; + + decodeString(): string; + + decodeTemplate(): AnyWrapper[]; + + expectCode(expected: number): void; + + process(synchronous?: false): AnyWrapper | AnyWrapper[] | undefined; + process(synchronous: true): void; + + processLater(): void; + + raise(reason: string): void; +} + +export function dumpToBuffer(val: any): Buffer; + +export function loadFromBuffer(input: InputWrapper): AnyWrapper | AnyWrapper[]; diff --git a/types/bser/test/sample1.ts b/types/bser/test/sample1.ts new file mode 100644 index 0000000000..3958260c42 --- /dev/null +++ b/types/bser/test/sample1.ts @@ -0,0 +1,4 @@ +import * as bser from "bser"; + +const encoded = bser.dumpToBuffer(["hello"]); +console.log(bser.loadFromBuffer(encoded)); // ['hello'] diff --git a/types/bser/test/sample2.ts b/types/bser/test/sample2.ts new file mode 100644 index 0000000000..2ab145626a --- /dev/null +++ b/types/bser/test/sample2.ts @@ -0,0 +1,7 @@ +import * as bser from "bser"; + +const bunser = new bser.BunserBuf(); + +bunser.on("value", obj => { + console.log(obj); +}); diff --git a/types/bser/test/sample3.ts b/types/bser/test/sample3.ts new file mode 100644 index 0000000000..41831c4447 --- /dev/null +++ b/types/bser/test/sample3.ts @@ -0,0 +1,16 @@ +import * as bser from "bser"; +import net from "net"; + +const obj = "sample data"; +const bunser = new bser.BunserBuf(); + +bunser.on("value", obj => { + console.log("data from socket", obj); +}); + +const socket = net.connect("/socket"); + +socket.on("data", buf => { + bunser.append(buf); +}); +socket.write(bser.dumpToBuffer(obj)); diff --git a/types/bser/test/tests.ts b/types/bser/test/tests.ts new file mode 100644 index 0000000000..2037e0517b --- /dev/null +++ b/types/bser/test/tests.ts @@ -0,0 +1,86 @@ +import * as bser from "bser"; +import Int64 from "node-int64"; +import * as assert from "assert"; + +// This is a hard-coded template representation from the C test suite +const template = + "\x00\x01\x03\x28" + + "\x0b\x00\x03\x02\x02\x03\x04\x6e\x61\x6d\x65\x02" + + "\x03\x03\x61\x67\x65\x03\x03\x02\x03\x04\x66\x72" + + "\x65\x64\x03\x14\x02\x03\x04\x70\x65\x74\x65\x03" + + "\x1e\x0c\x03\x19"; + +const val = bser.loadFromBuffer(template); +assert.deepStrictEqual(val, [ + { name: "fred", age: 20 }, + { name: "pete", age: 30 }, + { age: 25 } +]); + +function roundtrip(val: any) { + const encoded = bser.dumpToBuffer(val); + const decoded = bser.loadFromBuffer(encoded); + assert.deepStrictEqual(decoded, val); +} + +const values_to_test = [ + 1, + "hello", + 1.5, + false, + true, + new Int64("0x0123456789abcdef"), + 127, + 128, + 129, + 32767, + 32768, + 32769, + 65534, + 65536, + 65537, + 2147483647, + 2147483648, + 2147483649, + null, + [1, 2, 3], + { foo: "bar" }, + { nested: { struct: "hello", list: [true, false, 1, "string"] } } +]; + +for (const value of values_to_test) { + roundtrip(value); +} +roundtrip(values_to_test); + +// Verify Accumulator edge cases +const acc = new bser.Accumulator(8); +acc.append("hello"); +assert.equal(acc.readAvail(), 5); +assert.equal(acc.readOffset, 0); +assert.equal(acc.readString(3), "hel"); +assert.equal(acc.readOffset, 3); +assert.equal(acc.readAvail(), 2); +assert.equal(acc.writeAvail(), 3); + +// This should trigger a shunt and not make the buffer bigger +acc.reserve(5); +assert.equal(acc.readOffset, 0, "shunted"); +assert.equal(acc.readAvail(), 2, "still have 2 available to read"); +assert.equal(acc.writeAvail(), 6, "2 left to read out of 8 total space"); +assert.equal(acc.peekString(2), "lo", "have the correct remainder"); + +// Don't include keys that have undefined values +const res = bser.dumpToBuffer({ expression: undefined }); +assert.deepStrictEqual(bser.loadFromBuffer(res), {}); + +// Dump numbers without fraction to integers +let buffer; +buffer = bser.dumpToBuffer(1); +assert.equal(buffer.toString("hex"), "000105020000000301"); +buffer = bser.dumpToBuffer(1.0); +assert.equal(buffer.toString("hex"), "000105020000000301"); + +// Dump numbers with fraction to double +buffer = bser.dumpToBuffer(1.1); +assert.equal(buffer.toString("hex"), "00010509000000079a9999999999f13f"); diff --git a/types/ora/v1/tsconfig.json b/types/bser/tsconfig.json similarity index 60% rename from types/ora/v1/tsconfig.json rename to types/bser/tsconfig.json index ad30053dff..4fb45a708a 100644 --- a/types/ora/v1/tsconfig.json +++ b/types/bser/tsconfig.json @@ -1,22 +1,13 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "ora": [ - "ora/v1" - ] - }, + "baseUrl": "../", + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, @@ -24,6 +15,9 @@ }, "files": [ "index.d.ts", - "ora-tests.ts" + "test/tests.ts", + "test/sample1.ts", + "test/sample2.ts", + "test/sample3.ts" ] } diff --git a/types/camelcase/tslint.json b/types/bser/tslint.json similarity index 100% rename from types/camelcase/tslint.json rename to types/bser/tslint.json diff --git a/types/bson/tslint.json b/types/bson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bson/tslint.json +++ b/types/bson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/btoa/btoa-tests.ts b/types/btoa/btoa-tests.ts index 7ce230fcf7..d159bd5b7e 100644 --- a/types/btoa/btoa-tests.ts +++ b/types/btoa/btoa-tests.ts @@ -1,3 +1,5 @@ import btoa = require('btoa'); btoa('foo'); + +btoa(Buffer.from('foo')); diff --git a/types/btoa/index.d.ts b/types/btoa/index.d.ts index 4f16b77328..b4c06cf328 100644 --- a/types/btoa/index.d.ts +++ b/types/btoa/index.d.ts @@ -5,6 +5,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -declare function btoa(str: string): string; +/// + +declare function btoa(str: string | Buffer): string; export = btoa; diff --git a/types/buble/index.d.ts b/types/buble/index.d.ts index db3cb0a7b7..5ac6a96ac6 100644 --- a/types/buble/index.d.ts +++ b/types/buble/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for buble 0.19 -// Project: https://github.com/Rich-Harris/buble#README +// Project: https://github.com/bublejs/buble // Definitions by: Hugo Alliaume // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 diff --git a/types/bucks/tslint.json b/types/bucks/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bucks/tslint.json +++ b/types/bucks/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffer-compare/tslint.json b/types/buffer-compare/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffer-compare/tslint.json +++ b/types/buffer-compare/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffer-equal/tslint.json b/types/buffer-equal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffer-equal/tslint.json +++ b/types/buffer-equal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/buffers/tslint.json b/types/buffers/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/buffers/tslint.json +++ b/types/buffers/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index 13ae21f5a4..64f4eef698 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -70,6 +70,19 @@ videoQueue.add({video: 'http://example.com/video1.mov'}); audioQueue.add({audio: 'http://example.com/audio1.mp3'}); imageQueue.add({image: 'http://example.com/image1.tiff'}); +////////////////////////////////////////////////////////////////////////////////// +// +// Test Redis Cluster connexion +// +////////////////////////////////////////////////////////////////////////////////// + +const clusterQueue = new Queue('queue on redis cluster', { + prefix: 'cluster-test', + createClient: (clusterUri: Redis.ClusterNode) => { + return new Redis.Cluster([{port: 6379, host: '127.0.0.1'}]); + } +}); + ////////////////////////////////////////////////////////////////////////////////// // // Re-using Redis Connections diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index cd2d1a9047..648e2ba360 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -13,6 +13,7 @@ // Dan Manastireanu // Kjell-Morten Bratsberg Thorsen // Christian D. +// Silas Rech // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -25,10 +26,12 @@ import { EventEmitter } from "events"; * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. */ declare const Bull: { - (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - (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, opts?: Bull.QueueOptions): Bull.Queue; // tslint:disable-line unified-signatures + /* tslint:disable:no-unnecessary-generics unified-signatures */ + (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; + new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + new (queueName: string, url: string, opts?: Bull.QueueOptions): Bull.Queue; + /* tslint:enable:no-unnecessary-generics unified-signatures */ }; declare namespace Bull { @@ -49,9 +52,9 @@ declare namespace Bull { /** * When specified, the `Queue` will use this function to create new `ioredis` client connections. - * This is useful if you want to re-use connections. + * This is useful if you want to re-use connections or connect to a Redis cluster. */ - createClient?(type: 'client' | 'subscriber' | 'bclient', redisOpts?: Redis.RedisOptions): Redis.Redis; + createClient?(type: 'client' | 'subscriber' | 'bclient', redisOpts?: Redis.RedisOptions): Redis.Redis | Redis.Cluster; /** * Prefix to use for all redis keys @@ -114,6 +117,9 @@ declare namespace Bull { type JobId = number | string; + type ProcessCallbackFunction = (job: Job, done: DoneCallback) => void; + type ProcessPromiseFunction = (job: Job) => Promise; + interface Job { id: JobId; @@ -397,6 +403,8 @@ declare namespace Bull { */ isReady(): Promise; + /* tslint:disable:unified-signatures */ + /** * Defines a processing function for the jobs placed into a given Queue. * @@ -414,7 +422,9 @@ declare namespace Bull { * 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, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(callback: ProcessCallbackFunction): void; + process(callback: ProcessPromiseFunction): void; + process(callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -435,7 +445,9 @@ declare namespace Bull { * * @param concurrency Bull will then call your handler in parallel respecting this maximum value. */ - process(concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(concurrency: number, callback: ProcessCallbackFunction): void; + process(concurrency: number, callback: ProcessPromiseFunction): void; + process(concurrency: number, callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -456,8 +468,9 @@ declare namespace Bull { * * @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) | ((job: Job) => Promise) | string): void; + process(name: string, callback: ProcessCallbackFunction): void; + process(name: string, callback: ProcessPromiseFunction): void; + process(name: string, callback: string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -479,7 +492,11 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches * @param concurrency Bull will then call your handler in parallel respecting this maximum value. */ - process(name: string, concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | ((job: Job) => Promise) | string): void; + process(name: string, concurrency: number, callback: ProcessCallbackFunction): void; + process(name: string, concurrency: number, callback: ProcessPromiseFunction): void; + process(name: string, concurrency: number, callback: string): void; + + /* tslint:enable:unified-signatures */ /** * Creates a new job and adds it to the queue. @@ -598,7 +615,7 @@ declare namespace Bull { * Returns a promise that will return an array of job instances of the given types. * Optional parameters for range and ordering are provided. */ - getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise; + getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise>>; /** * Returns a promise that resolves with the job counts for the given queue. diff --git a/types/bunyan-config/tslint.json b/types/bunyan-config/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-config/tslint.json +++ b/types/bunyan-config/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bunyan-logentries/tslint.json b/types/bunyan-logentries/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-logentries/tslint.json +++ b/types/bunyan-logentries/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bunyan-prettystream/tslint.json b/types/bunyan-prettystream/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bunyan-prettystream/tslint.json +++ b/types/bunyan-prettystream/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bunyan-seq/index.d.ts b/types/bunyan-seq/index.d.ts index 6d2a29fb1c..c70b7bdacb 100644 --- a/types/bunyan-seq/index.d.ts +++ b/types/bunyan-seq/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bunyan-blackhole 0.2 +// Type definitions for bunyan-seq 0.2 // Project: https://github.com/datalust/bunyan-seq, https://github.com/continuousit/bunyan-seq // Definitions by: Ray Booysen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index f6f0b287aa..1e5c64d625 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -259,7 +259,7 @@ declare namespace Logger { limit?: number; } - class RingBuffer extends EventEmitter implements NodeJS.WritableStream { + class RingBuffer extends EventEmitter { constructor(options: RingBufferOptions); writable: boolean; @@ -277,7 +277,7 @@ declare namespace Logger { period?: string; } - class RotatingFileStream extends EventEmitter implements NodeJS.WritableStream { + class RotatingFileStream extends EventEmitter { constructor(options: RotatingFileStreamOptions); writable: boolean; diff --git a/types/burns/burns-tests.ts b/types/burns/burns-tests.ts new file mode 100644 index 0000000000..e1fd41ad09 --- /dev/null +++ b/types/burns/burns-tests.ts @@ -0,0 +1,29 @@ +import burns from 'burns'; + +interface OrderData { + userName: string; + orderId: string; +} + +function handleEverything() { + console.log('Do absolutely nothing! 😄'); +} + +function sendEmail(message: string) { + console.log(message); +} + +function sendOrderShippedEmail(data: OrderData) { + sendEmail(`Hi ${data.userName}, Your order ${data.orderId} has been shipped`); +} + +burns.configure({ + defaultHandler: handleEverything +}); +burns.registerEvents({ + newPurchase: sendOrderShippedEmail +}); +burns.dispatch('newPurchase', { + userName: 'Johnny', + orderId: 'rand' +}); diff --git a/types/burns/index.d.ts b/types/burns/index.d.ts new file mode 100644 index 0000000000..d4633624be --- /dev/null +++ b/types/burns/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for burns 2.0 +// Project: https://github.com/shalvah/burns#readme +// Definitions by: Timothy Onyiuke +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +declare const _Burns: Burns; + +export interface Config { + defaultHandler?: any; + broadcaster?: any; + pusher?: any; +} + +declare class Burns { + configure(config?: Config): this; + + registerEvents(newEvents: Record): this; + + dispatch(eventName: string, eventData?: Record, exclude?: { exclude?: any }): this; +} + +export default _Burns; diff --git a/types/dom-loaded/tsconfig.json b/types/burns/tsconfig.json similarity index 94% rename from types/dom-loaded/tsconfig.json rename to types/burns/tsconfig.json index 7d17914d86..703007ff15 100644 --- a/types/dom-loaded/tsconfig.json +++ b/types/burns/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "dom-loaded-tests.ts" + "burns-tests.ts" ] } diff --git a/types/chai-http/tslint.json b/types/burns/tslint.json similarity index 100% rename from types/chai-http/tslint.json rename to types/burns/tslint.json diff --git a/types/busboy/tslint.json b/types/busboy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/busboy/tslint.json +++ b/types/busboy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/business-rules-engine/tslint.json b/types/business-rules-engine/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/business-rules-engine/tslint.json +++ b/types/business-rules-engine/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bwip-js/tslint.json b/types/bwip-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bwip-js/tslint.json +++ b/types/bwip-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/byline/tslint.json b/types/byline/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/byline/tslint.json +++ b/types/byline/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/bytebuffer/tslint.json b/types/bytebuffer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/bytebuffer/tslint.json +++ b/types/bytebuffer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/c3/tsconfig.json b/types/c3/tsconfig.json index aa923e91c0..60849b491f 100644 --- a/types/c3/tsconfig.json +++ b/types/c3/tsconfig.json @@ -11,7 +11,8 @@ "types": [], "paths": { "d3-scale": ["d3-scale/v1"], - "d3": ["d3/v4"] + "d3": ["d3/v4"], + "d3-array": ["d3-array/v1"] }, "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/cache-manager/cache-manager-tests.ts b/types/cache-manager/cache-manager-tests.ts index 30a8472a8b..d8ab154aa1 100644 --- a/types/cache-manager/cache-manager-tests.ts +++ b/types/cache-manager/cache-manager-tests.ts @@ -1,6 +1,6 @@ import * as cacheManager from 'cache-manager' -const memoryCache = cacheManager.caching({ store: 'memory', max: 100, ttl: 10/*seconds*/ }); +const memoryCache: cacheManager.Cache = cacheManager.caching({ store: 'memory', max: 100, ttl: 10/*seconds*/ }); const ttl = 5; memoryCache.set('foo', 'bar', { ttl: ttl }, (err) => { diff --git a/types/cache-manager/index.d.ts b/types/cache-manager/index.d.ts index fcd4458767..5898b0fa24 100644 --- a/types/cache-manager/index.d.ts +++ b/types/cache-manager/index.d.ts @@ -3,17 +3,17 @@ // Definitions by: Simon Gausmann // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface CachingConfig { +export interface CachingConfig { ttl: number; } -interface StoreConfig extends CachingConfig { +export interface StoreConfig extends CachingConfig { store: string; max?: number; isCacheableValue?: (value: any) => boolean; } -interface Cache { +export interface Cache { set(key: string, value: T, options: CachingConfig, callback?: (error: any) => void): void; set(key: string, value: T, ttl: number, callback?: (error: any) => void): void; set(key: string, value: T, options: CachingConfig): Promise; @@ -31,12 +31,5 @@ interface Cache { del(key: string): Promise; } - - -declare namespace cacheManager { - function caching(IConfig: StoreConfig): Cache; - function multiCaching(Caches: Cache[]): Cache; -} - -export = cacheManager; - +export function caching(IConfig: StoreConfig): Cache; +export function multiCaching(Caches: Cache[]): Cache; diff --git a/types/cache-manager/tslint.json b/types/cache-manager/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cache-manager/tslint.json +++ b/types/cache-manager/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cacheable-request/cacheable-request-tests.ts b/types/cacheable-request/cacheable-request-tests.ts index 95458c14b7..f6964c8ec8 100644 --- a/types/cacheable-request/cacheable-request-tests.ts +++ b/types/cacheable-request/cacheable-request-tests.ts @@ -1,7 +1,6 @@ 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); @@ -14,7 +13,6 @@ 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 diff --git a/types/cacheable-request/index.d.ts b/types/cacheable-request/index.d.ts index 98d858d3f6..16e778274a 100644 --- a/types/cacheable-request/index.d.ts +++ b/types/cacheable-request/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for cacheable-request 6.0 // Project: https://github.com/lukechilds/cacheable-request#readme // Definitions by: BendingBender +// Paul Melnikow // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -20,7 +21,7 @@ declare const CacheableRequest: CacheableRequest; type RequestFn = typeof request; interface CacheableRequest { - new (requestFn: RequestFn, storageAdapter?: string | Store): ( + new (requestFn: RequestFn, storageAdapter?: string | CacheableRequest.StorageAdapter): ( opts: string | URL | (RequestOptions & CacheSemanticsOptions), cb?: (response: ServerResponse | ResponseLike) => void ) => CacheableRequest.Emitter; @@ -30,6 +31,8 @@ interface CacheableRequest { } declare namespace CacheableRequest { + type StorageAdapter = Store; + interface Options { /** * If the cache should be used. Setting this to `false` will completely bypass the cache for the current request. diff --git a/types/cal-heatmap/tslint.json b/types/cal-heatmap/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cal-heatmap/tslint.json +++ b/types/cal-heatmap/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/callsite/tslint.json b/types/callsite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/callsite/tslint.json +++ b/types/callsite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/calq/tslint.json b/types/calq/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/calq/tslint.json +++ b/types/calq/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/camelcase-keys/index.d.ts b/types/camelcase-keys/index.d.ts index f6be6b7f03..e29a576e6b 100644 --- a/types/camelcase-keys/index.d.ts +++ b/types/camelcase-keys/index.d.ts @@ -1,7 +1,15 @@ -// Type definitions for camelcase-keys 4.0 +// Type definitions for camelcase-keys 4.1 // Project: https://github.com/sindresorhus/camelcase-keys#readme // Definitions by: Mohamed Hegazy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 export = camelcaseKeys; declare function camelcaseKeys(input: any, options?: { exclude?: string[] | RegExp[], deep?: boolean }): any; + +declare namespace camelcaseKeys { + interface Options { + deep?: boolean; + exclude?: Array; + } +} diff --git a/types/camelcase/camelcase-tests.ts b/types/camelcase/camelcase-tests.ts deleted file mode 100644 index 871ec5c3b2..0000000000 --- a/types/camelcase/camelcase-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -import camelCase = require('camelcase'); - -camelCase('foo-bar'); -camelCase('foo_bar'); -camelCase('Foo-Bar'); -camelCase('--foo.bar'); -camelCase('__foo__bar__'); -camelCase('foo bar'); -camelCase('foo', 'bar'); -camelCase('__foo__', '--bar'); diff --git a/types/camelcase/index.d.ts b/types/camelcase/index.d.ts deleted file mode 100644 index 83abf5a8a5..0000000000 --- a/types/camelcase/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for camelcase 4.1 -// Project: https://github.com/sindresorhus/camelcase -// Definitions by: Sam Verschueren -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = camelcase; - -declare function camelcase(...args: string[]): string; -declare namespace camelcase {} diff --git a/types/camljs/tslint.json b/types/camljs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/camljs/tslint.json +++ b/types/camljs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/camo/tslint.json b/types/camo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/camo/tslint.json +++ b/types/camo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cannon/tslint.json b/types/cannon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cannon/tslint.json +++ b/types/cannon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/canvas-confetti/canvas-confetti-tests.ts b/types/canvas-confetti/canvas-confetti-tests.ts index d29e57fbdb..2415b91b85 100644 --- a/types/canvas-confetti/canvas-confetti-tests.ts +++ b/types/canvas-confetti/canvas-confetti-tests.ts @@ -43,3 +43,12 @@ confetti({ y: 0.6 } }); + +const canvas = document.createElement('canvas'); +const myConfetti = confetti.create(canvas); + +myConfetti(); + +myConfetti({ + particleCount: 150 +}); diff --git a/types/canvas-confetti/index.d.ts b/types/canvas-confetti/index.d.ts index 3dddc6d750..f9dd65ea12 100644 --- a/types/canvas-confetti/index.d.ts +++ b/types/canvas-confetti/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for canvas-confetti 0.0 +// Type definitions for canvas-confetti 0.1 // Project: https://github.com/catdad/canvas-confetti#readme // Definitions by: Martin Tracey // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -81,6 +81,14 @@ declare namespace confetti { */ y?: number; } + interface GlobalOptions { + resize: boolean; + } + + function create( + canvas: HTMLCanvasElement, + options?: GlobalOptions + ): (options?: Options) => Promise | null; } export = confetti; diff --git a/types/canvas-confetti/tsconfig.json b/types/canvas-confetti/tsconfig.json index 33c159b3e3..e83fb2ef8b 100644 --- a/types/canvas-confetti/tsconfig.json +++ b/types/canvas-confetti/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/canvas-gauges/tslint.json b/types/canvas-gauges/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/canvas-gauges/tslint.json +++ b/types/canvas-gauges/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/carlo/carlo-tests.ts b/types/carlo/carlo-tests.ts new file mode 100644 index 0000000000..d01636d969 --- /dev/null +++ b/types/carlo/carlo-tests.ts @@ -0,0 +1,32 @@ +import carlo = require('carlo'); + +async function main() { + const app = await carlo.launch({ + title: 'Test' + }); + + app.browserForTest(); + + const window = await app.createWindow({}); + window.setBounds({ + top: 10, + width: 30 + }); +} + +(async () => { + // Launch the browser. + const app = await carlo.launch(); + + // Terminate Node.js process on app window closing. + app.on('exit', () => process.exit()); + + // Tell carlo where your web files are located. + app.serveFolder(__dirname); + + // Expose 'env' function in the web environment. + await app.exposeFunction('env', _ => process.env); + + // Navigate to the main page of your app. + await app.load('example.html'); +})(); diff --git a/types/carlo/index.d.ts b/types/carlo/index.d.ts new file mode 100644 index 0000000000..7e7aea0fc3 --- /dev/null +++ b/types/carlo/index.d.ts @@ -0,0 +1,400 @@ +// Type definitions for carlo 0.9 +// Project: https://github.com/GoogleChromeLabs/carlo#readme +// Definitions by: Adam Dierkens +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import { Serializable, Browser, Page } from "puppeteer-core"; + +export type Channel = string; + +/** + * Evaluates a function in the context of the page + * @param pageFunction Function to be evaluated in the page context. + * @param args Arguments to pass to pageFunction. + * + * If the function passed to the Window.evaluate returns a Promise, + * then Window.evaluate would wait for the promise to resolve and return its value. + * + * If the function passed to the Window.evaluate returns a non-Serializable value, + * then Window.evaluate resolves to undefined. + */ +export type EvaluateFunction = (pageFunction: ((...args: any[]) => any) | string, ...args: Serializable[]) => Promise; + +export interface WindowOptions { + /** + * App window width in pixels. + */ + width?: number; + + /** + * App window height in pixels. + */ + height?: number; + + /** + * App window top offset in pixels. + */ + top?: number; + + /** + * App window left offset in pixels. + */ + left?: number; + + /** + * Background color using hex notation, defaults to '#ffffff'. + */ + bgcolor?: string; +} + +/** + * Set of configurable options to set on the app. + */ +export interface LaunchOptions extends WindowOptions { + /** + * Browser to be used, defaults to ['stable'] + */ + channel?: Channel[]; + + /** + * Application icon to be used in the system dock. + * Either buffer containing PNG or a path to the PNG file on the file system. + * This feature is only available in Chrome M72+. + * One can use 'canary' channel to see it in action before M72 hits stable. + */ + icon?: Buffer | string; + + /** + * Optional parameters to share between Carlo instances. + */ + paramsForReuse?: any; + + /** + * Application title + */ + title?: string; + + /** + * Path to a User Data Directory. This folder is created upon the first app launch and contains user settings and Web storage data. Defaults to '.profile'. + */ + userDataDir?: string; + + /** + * Path to a Chromium or Chrome executable to run instead of the automatically located Chrome. + * If executablePath is a relative path, then it is resolved relative to current working directory. + * Carlo is only guaranteed to work with the latest Chrome stable version. + */ + executablePath?: string; + + /** + * Additional arguments to pass to the browser instance. + */ + args?: string[]; +} + +export type AppEvent = 'exit' | 'window'; +export type WindowEvent = 'close'; + +export interface Bounds { + /** + * Top offset in pixels. + */ + top: number; + + /** + * Left offset in pixels. + */ + left: number; + + /** + * Width in pixels. + */ + width: number; + + /** + * Height in pixels. + */ + height: number; +} + +export interface Window { + /** + * 'close' - Emitted when the window closes. + * @param name 'close' + */ + on(name: AppEvent, callback: (...args: any[]) => void): void; + + /** + * Returns window bounds + */ + bounds(): Promise; + + /** + * Brings this window to front. + */ + bringToFront(): Promise; + + /** + * Closes this window. + */ + close(): Promise; + + evaluate: EvaluateFunction; + + /** + * @param name Name of the function on the window object. + * @param carloFunction Callback function which will be called in Carlo's context. + */ + exposeFunction(name: string, carloFunction: (...args: any[]) => any): Promise; + + /** + * Turns the window into the full screen mode. Behavior is platform specific. + */ + fullscreen(): Promise; + + /** + * Navigates the corresponding web page to the given uri, + * makes given params available in web page via carlo.loadParams() + * Resolves upon DOMContentLoaded event in the web page. + * @param uri Path to the resource relative to the folder passed into serveFolder() + * @param params Optional parameters to pass to the web application. + */ + load(uri: string, params?: any): Promise; + + /** + * Maximizes the window. Behavior is platform-specific. + */ + maximize(): Promise; + + /** + * Minimizes the window. Behavior is platform-specific. + */ + minimize(): Promise; + + /** + * Returns Puppeteer page object for testing. + */ + pageForTest(): Page; + + /** + * Returns the options.paramsForReuse value passed into the carlo.launch. + */ + paramsForReuse(): any; + + /** + * Same as App.serveFolder(folder[, prefix]), but only applies to current window. + * @param folder Folder with web content to make available to Chrome. + * @param prefix Prefix of the URL path to serve from the given folder. + */ + serveFolder(folder: string, prefix?: string): void; + + /** + * Same as App.serveHandler(handler), but only applies to the current window requests. + * Only single window-level handler can be installed in window. + * @param handle Network handler callback accepting the HttpRequest parameter. + */ + serveHandler(handle: (request: HttpRequest) => void): void; + + /** + * Same as App.serveOrigin(base[, prefix]), but only applies to current window. + * @param base Base to serve web content from. + * @param prefix Prefix of the URL path to serve from the given folder. + */ + serveOrigin(base: string, prefix?: string): Promise; + + /** + * Sets window bounds. Parameters top, left, width and height are all optional. + * Dimension or the offset is only applied when specified. + * @param bounds Window bounds + */ + setBounds(bounds: { + /** + * Top offset in pixels. + */ + top?: number; + + /** + * Left offset in pixels. + */ + left?: number; + + /** + * Width in pixels. + */ + width?: number; + + /** + * Height in pixels. + */ + height?: number; + }): Promise; +} + +export interface HttpRequest { + /** + * Aborts request. + * If request is a navigation request, navigation is aborted as well. + */ + abort(): Promise; + + /** + * Proceeds with the default behavior for this request. + * Either serves it from the filesystem or defers to the browser. + */ + continue(): Promise; + + /** + * Marks the request as failed. + * If request is a navigation request, navigation is still committed, but to a location that fails to be fetched. + */ + fail(): Promise; + + /** + * Fulfills the network request with the given data. 'Content-Length' header is generated in case it is not listed in the headers. + */ + fulfill(options: { + /** + * HTTP status code (200, 304, etc), defaults to 200. + */ + status: number; + + /** + * HTTP response headers. + */ + headers: object; + + /** + * Response body. + */ + body: Buffer; + }): Promise; + + /** + * Network request headers + */ + headers(): object; + + /** + * HTTP method of this network request (GET, POST, etc.) + */ + method(): string; + + /** + * Network request URL + */ + url(): string; +} + +export interface App { + /** + * 'exit' - Emitted when the last window closes. + * 'window' - Emitted when the new window opens. + * @param name 'exit' or 'window' + * @param callback + */ + on(name: AppEvent, callback: (...args: any[]) => void): void; + + /** + * Puppeteer browser object for testing. + */ + browserForTest(): Browser; + + createWindow(options?: WindowOptions): Promise; + + evaluate: EvaluateFunction; + + /** + * Closes the browser window + */ + exit(): Promise; + + /** + * The method adds a function called name on the pages' window object. + * When called, the function executes carloFunction in Node.js and returns a Promise which resolves to the return value of carloFunction. + * @param name + * @param carloFunction + */ + exposeFunction(name: string, carloFunction: (...args: any[]) => any): Promise; + + /** + * Shortcut to the main window's Window.load + * @param uri + * @param params + */ + load(uri: string, ...params: any[]): Promise; + + /** + * Running app guarantees to have main window. + * If current main window closes, a next open window becomes the main one. + */ + mainWindow(): Window; + + /** + * Makes the content of the given folder available to the Chrome web app + * @param folder Folder with web content to make available to Chrome + * @param prefix Prefix of the URL path to serve from the given folder + */ + serveFolder(folder: string, prefix?: string): void; + + /** + * Handler function is called with every network request in this app. + * It can abort, continue or fulfill each request. + * Only single app-wide handler can be registered. + * @param handler Network handler callback accepting the HttpRequest parameter. + */ + serveHandler(handler: (request: HttpRequest) => void): void; + + /** + * Fetches Carlo content from the specified origin instead of reading it from the file system, eg http://localhost:8080. + * This mode can be used for the fast development mode available in web frameworks. + * @param base Base to serve web content from. + * @param prefix Prefix of the URL path to serve from the given folder. + */ + serveOrigin(base: string, prefix?: string): void; + + /** + * Specifies image to be used as an app icon in the system dock. + * This feature is only available in Chrome M72+. One can use 'canary' channel to see it in action before M72 hits stable. + * @param image Either buffer containing PNG or a path to the PNG file on the file system. + */ + setIcon(image: Buffer | string): void; + + /** + * Returns all currently opened windows. + * Running app guarantees to have at least one open window. + */ + windows(): Window[]; +} + +/** + * Launches the browser + * @param options Set of configurable options to set on the app. + */ +export function launch(options?: LaunchOptions): Promise; + +/** + * Enters headless test mode. + */ +export function enterTestMode(): void; + +/** + * Returns additional information about the file, otherwise not available to the web. + * Available in Chrome M73+ + * + * @param file File to get additional information for + */ +export function fileInfo(file: any): Promise<{ + /** + * absolute path to the given file + */ + path: string; +}>; + +/** + * This method is available in the Web world and returns parameters passed into the window.load(). + * This is how Carlo passes initial set of handles to Node objects into the web world. + */ +export function loadParams(): Promise>; diff --git a/types/carlo/tsconfig.json b/types/carlo/tsconfig.json new file mode 100644 index 0000000000..6bb4f11fe4 --- /dev/null +++ b/types/carlo/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "target": "es2017", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "carlo-tests.ts" + ] +} \ No newline at end of file diff --git a/types/chokidar/tslint.json b/types/carlo/tslint.json similarity index 100% rename from types/chokidar/tslint.json rename to types/carlo/tslint.json diff --git a/types/caseless/caseless-tests.ts b/types/caseless/caseless-tests.ts index 57eaae605e..39f6277350 100644 --- a/types/caseless/caseless-tests.ts +++ b/types/caseless/caseless-tests.ts @@ -1,9 +1,9 @@ -import caseless, { Caseless, httpify, Httpified } from "caseless"; +import caseless = require("caseless"); -new Caseless(); // $ExpectError +new caseless.Caseless(); // $ExpectError // tslint:disable-next-line: prefer-const -let c1: Caseless; +let c1: caseless.Caseless; caseless(); // $ExpectType Caseless caseless({}); // $ExpectType Caseless @@ -30,16 +30,16 @@ c2.swap(10); // $ExpectError c2.del('foo'); // $ExpectType boolean -httpify(null, {}); // $ExpectError -httpify(1, {}); // $ExpectError -httpify("2", {}); // $ExpectError -httpify({}, null); // $ExpectError -httpify({}, 1); // $ExpectError -httpify({}, "2"); // $ExpectError +caseless.httpify(null, {}); // $ExpectError +caseless.httpify(1, {}); // $ExpectError +caseless.httpify("2", {}); // $ExpectError +caseless.httpify({}, null); // $ExpectError +caseless.httpify({}, 1); // $ExpectError +caseless.httpify({}, "2"); // $ExpectError -httpify({}, {}); // $ExpectType Caseless +caseless.httpify({}, {}); // $ExpectType Caseless -const request: Httpified = {}; // $ExpectError +const request: caseless.Httpified = {}; // $ExpectError request.setHeader({}); // $ExpectType void request.setHeader('foo', 'bar'); // $ExpectType string | false diff --git a/types/caseless/index.d.ts b/types/caseless/index.d.ts index 9b19f8a150..3955664993 100644 --- a/types/caseless/index.d.ts +++ b/types/caseless/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mikeal/caseless // Definitions by: downace // Matt R. Wilson +// Emily Klassen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -9,26 +10,28 @@ type KeyType = string; type ValueType = any; type RawDict = object; -export interface Caseless { - set(name: KeyType, value: ValueType, clobber?: boolean): KeyType | false; - set(dict: RawDict): void; - has(name: KeyType): KeyType | false; - get(name: KeyType): ValueType | undefined; - swap(name: KeyType): void; - del(name: KeyType): boolean; +declare function caseless(dict?: RawDict): caseless.Caseless; + +declare namespace caseless { + function httpify(resp: object, headers: RawDict): Caseless; + + interface Caseless { + set(name: KeyType, value: ValueType, clobber?: boolean): KeyType | false; + set(dict: RawDict): void; + has(name: KeyType): KeyType | false; + get(name: KeyType): ValueType | undefined; + swap(name: KeyType): void; + del(name: KeyType): boolean; + } + + interface Httpified { + headers: RawDict; + setHeader(name: KeyType, value: ValueType, clobber?: boolean): KeyType | false; + setHeader(dict: RawDict): void; + hasHeader(name: KeyType): KeyType | false; + getHeader(name: KeyType): ValueType | undefined; + removeHeader(name: KeyType): boolean; + } } -export interface Httpified { - headers: RawDict; - setHeader(name: KeyType, value: ValueType, clobber?: boolean): KeyType | false; - setHeader(dict: RawDict): void; - hasHeader(name: KeyType): KeyType | false; - getHeader(name: KeyType): ValueType | undefined; - removeHeader(name: KeyType): boolean; -} - -export function httpify(resp: object, headers: RawDict): Caseless; - -declare function caseless(dict?: RawDict): Caseless; - -export default caseless; +export = caseless; diff --git a/types/cash/tslint.json b/types/cash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cash/tslint.json +++ b/types/cash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cassanknex/cassanknex-tests.ts b/types/cassanknex/cassanknex-tests.ts new file mode 100644 index 0000000000..b874d2a784 --- /dev/null +++ b/types/cassanknex/cassanknex-tests.ts @@ -0,0 +1,74 @@ +import cassanknex = require('cassanknex'); + +const knex = cassanknex({ + connection: { + contactPoints: ['127.0.0.1'] + } +}); + +knex.on('ready', (err) => { +}); + +interface BirdRow { + type: string; + canFly: boolean; +} + +const qb = knex("animals") + .insert({ + type: 'Stork', + canFly: true + }) + .into('birds'); + +qb.exec((err, res) => { +}); + +qb.eachRow((n, row) => { +}, (err) => { +}); + +interface FooRow { + id: string; + foo: string; + bar: number; + baz: string[]; +} + +const query2 = knex("keyspace") + .select("id", "foo", "bar", "baz") + .ttl('foo') + .where("id", "=", "1") + .orWhere("id", "in", ["2", "3"]) + .orWhere("baz", "=", ["bar"]) + .andWhere("foo", "IN", ["baz", "bar"]) + .limit(10) + .from("table"); + +query2.stream({ + readable() { + const row = this.read(); + }, + end() {}, + error() {} +}); + +const values = { + id: "foo", + bar: 13, + baz: ["foo", "bar"] +}; + +const query3 = knex("cassanKnexy") + .insert(values) + .usingTimestamp(250000) + .usingTTL(50000) + .into("columnFamily"); + +const [cql, params] = [query3.cql(), query3.bindings()]; + +const query4 = knex("cassanKnexy") + .update("columnFamily") + .add("bar", { foo: "baz" }) // "bar" is a map + .remove("foo", ["bar"]) // "foo" is a set + .where("id", "=", 1); diff --git a/types/cassanknex/index.d.ts b/types/cassanknex/index.d.ts new file mode 100644 index 0000000000..fd7f9c53f4 --- /dev/null +++ b/types/cassanknex/index.d.ts @@ -0,0 +1,204 @@ +// Type definitions for cassanknex 1.19 +// Project: https://github.com/azuqua/cassanknex +// Definitions by: Daniel Chao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import { EventEmitter } from "events"; +import { Client, ClientOptions, types, ResultCallback } from "cassandra-driver"; +import * as Long from "long"; +import { Readable } from "stream"; + +declare function CassanKnex(options?: CassanKnex.DriverOptions): CassanKnex.CassanKnex; + +export = CassanKnex; + +declare namespace CassanKnex { + interface DriverOptions { + debug?: boolean; + connection?: Client | ClientOptions; + } + + /** + * Will return the `never` type if `T[K]` is not a member of `Type`, for all `T[K]`. + */ + type TypeMatchedValue = T[K] extends Type ? This : never; + + interface MappedDict { + [key: string]: B; + } + + type InRestriction = 'in' | 'IN'; + + type ComparisonRestriction = '=' | '<' | '>' | '<=' | '>='; + + type SelectAsClause = { + [P in keyof T]: string; + }; + + interface CassanKnex extends EventEmitter { + (keyspace?: string): QueryBuilderRoot; + } + + interface StreamParams { + readable: (this: Readable) => any; + end: (this: Readable) => any; + error: (err: Error) => any; + } + + interface QueryBuilderRoot { + insert (values: Partial | T): InsertQueryBuilder; + select (...columns: Array): SelectQueryBuilder; + select (values: SelectAsClause): SelectQueryBuilder; + update (table: string): UpdateQueryBuilder; + delete (): DeleteQueryBuilder; + alterColumnFamily (columnFamily: string): AlterColumnFamilyQueryBuilder; + createColumnFamily (columnFamily: string): CreateColumnFamilyQueryBuilder; + createColumnFamilyIfNotExists (columnFamily: string): CreateColumnFamilyQueryBuilder; + createIndex (columnFamily: string, indexName: string, column: keyof T): QueryBuilder; + createIndexCustom (columnFamily: string, indexName: string, column: keyof T): QueryBuilder & CreateableIndexBuilder; + createType (typeName: string): CreateTypeQueryBuilder; + createTypeIfNotExists (typeName: string): CreateTypeQueryBuilder; + dropColumnFamily(columnFamily: string): QueryBuilder; + dropColumnFamilyIfExists(columnFamily: string): QueryBuilder; + dropType(): QueryBuilder; + dropTypeIfExists(): QueryBuilder; + truncate(columnFamily: string): QueryBuilder; + alterKeyspace(keyspace: string): KeyspaceQueryBuilder; + createKeyspace(keyspace: string): KeyspaceQueryBuilder; + createKeyspaceIfNotExists(keyspace: string): KeyspaceQueryBuilder; + dropKeyspace(): QueryBuilder; + dropKeyspaceIfExists(): QueryBuilder; + } + + interface QueryBuilder { + cql(): string; + bindings(): any[]; + exec(cb: ResultCallback): undefined; + eachRow(onEachRow: (n: number, row: types.Row) => any, onError: (err: Error) => any): undefined; + stream(params: StreamParams): undefined; + } + + interface FieldValueQueryBuilder { + decimal (columnName: K): TypeMatchedValue; + boolean (columnName: K): TypeMatchedValue; + blob (columnName: K): TypeMatchedValue; + timestamp (columnName: K): TypeMatchedValue; + date (columnName: K): TypeMatchedValue; + inet (columnName: K): TypeMatchedValue; + bigint (columnName: K): TypeMatchedValue; + counter (columnName: K): TypeMatchedValue; + double (columnName: K): TypeMatchedValue; + int (columnName: K): TypeMatchedValue; + float (columnName: K): TypeMatchedValue; + map (columnName: K, a: A, b: B): TypeMatchedValue, this>; + ascii (columnName: K): TypeMatchedValue; + text (columnName: K): TypeMatchedValue; + timeuuid (columnName: K): TypeMatchedValue; + uuid (columnName: K): TypeMatchedValue; + varchar (columnName: K): TypeMatchedValue; + list (columnName: K, typeName: string): TypeMatchedValue; + primary(primaryKey: string): this; + set (columnName: K, a: A): TypeMatchedValue, this>; + } + + interface CreateableColumnFamilyBuilder { + withCaching(): this; + withCompression(): this; + withCompaction(): this; + withClusteringOrderBy (value: K, direction: 'desc' | 'asc'): this; + } + + interface CreateableIndexBuilder { + withOptions(opts: MappedDict): this; + } + + interface KeyspaceableQueryBuilder { + withNetworkTopologyStrategy(strategy: MappedDict): this; + withSimpleStrategy(replicas: number): this; + withDurableWrites(durableWrites: boolean): this; + } + + interface InsertableQueryBuilder { + into(table: string): this; + ifNotExists(): this; + } + + interface TtlableQueryBuilder { + usingTimestamp(timestamp: number): this; + usingTTL(ttl: number): this; + } + + interface WhereableQueryBuilder { + where (lhs: K, comparison: InRestriction, rhs: Array): this; + where (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + orWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + orWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + andWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + andWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + tokenWhere (lhs: K, comparison: InRestriction, rhs: Array): this; + tokenWhere (lhs: K, comparison: ComparisonRestriction, rhs: T[K]): this; + ttl (columnName: K): this; + } + + interface IfableQueryBuilder { + if (lhs: K, comparison: ComparisonRestriction, rhs: T[K] | null): this; + } + + interface LimitableQueryBuilder { + limit(limit: number): this; + limitPerPartition(limit: number): this; + } + + interface FromableQueryBuilder { + from(table: string): this; + } + + interface UpdateableQueryBuilder { + set (key: K, value: T[K]): this; + set(object: Partial): this; + add (key: K, value: { [str: string]: T[K] }): TypeMatchedValue, this>; + add (key: K, value: Array): TypeMatchedValue, this>; + add(object: Partial): this; + remove (key: K, value: Array): this; + remove(object: Partial): this; + increment(column: keyof T, amount: number): this; + increment(object: Partial): this; + decrement(column: keyof T, amount: number): this; + decrement(object: Partial): this; + } + + interface AlterableQueryBuilder { + drop (...columns: K[]): this; + rename (column: K, newColumn: K): this; + alter (column: K, newType: string): this; + } + + type InsertQueryBuilder = QueryBuilder + & InsertableQueryBuilder + & TtlableQueryBuilder; + type SelectQueryBuilder = QueryBuilder + & WhereableQueryBuilder + & LimitableQueryBuilder + & FromableQueryBuilder; + type UpdateQueryBuilder = QueryBuilder + & WhereableQueryBuilder + & UpdateableQueryBuilder + & IfableQueryBuilder + & TtlableQueryBuilder; + type DeleteQueryBuilder = QueryBuilder + & WhereableQueryBuilder + & FromableQueryBuilder; + type CreateColumnFamilyQueryBuilder = QueryBuilder + & FieldValueQueryBuilder + & CreateableColumnFamilyBuilder; + type KeyspaceQueryBuilder = QueryBuilder + & KeyspaceableQueryBuilder; + type CreateTypeQueryBuilder = QueryBuilder + & FieldValueQueryBuilder; + type AlterColumnFamilyQueryBuilder = QueryBuilder + & AlterableQueryBuilder + & FieldValueQueryBuilder; +} diff --git a/types/cassanknex/tsconfig.json b/types/cassanknex/tsconfig.json new file mode 100644 index 0000000000..d77cbaca70 --- /dev/null +++ b/types/cassanknex/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", + "cassanknex-tests.ts" + ] +} \ No newline at end of file diff --git a/types/cassanknex/tslint.json b/types/cassanknex/tslint.json new file mode 100644 index 0000000000..4074d3cece --- /dev/null +++ b/types/cassanknex/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-unnecessary-generics": false, + "strict-export-declare-modifiers": false + } +} \ No newline at end of file diff --git a/types/cavy/cavy-tests.tsx b/types/cavy/cavy-tests.tsx new file mode 100644 index 0000000000..e33d0366a7 --- /dev/null +++ b/types/cavy/cavy-tests.tsx @@ -0,0 +1,40 @@ +import * as React from 'react'; +import { TextInput, View, Text } from 'react-native'; + +import { hook, TestScope, WithTestHook, Tester } from 'cavy'; + +type Props = WithTestHook<{ + foo: string; +}>; + +class SampleComponent extends React.Component { + render() { + return ( + + {this.props.foo} + + + ); + } +} + +const HookedSampleComponent = hook(SampleComponent); // $ExpectType ComponentClass<{ foo: string; }, any> + +function sampleSpec(spec: TestScope) { + spec.describe('it has a name and callback', () => { + spec.it('it has a name and callback', async () => { + spec.component.reRender(); // $ExpectType void + spec.component.clearAsync(); // $ExpectType Promise + spec.findComponent('View.Sample'); // $ExpectType Promise> + spec.press('View.Sample'); // $ExpectType Promise + spec.fillIn('Input.Sample', "hello world"); // $ExpectType Promise + spec.pause(1000); // $ExpectType Promise + spec.exists('View.Sample'); // $ExpectType Promise + spec.notExists('View.MissingSample'); // $ExpectType Promise + }); + }); +} + + + +; diff --git a/types/cavy/index.d.ts b/types/cavy/index.d.ts new file mode 100644 index 0000000000..5e74edfe48 --- /dev/null +++ b/types/cavy/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for cavy 0.6 +// Project: https://github.com/pixielabs/cavy +// Definitions by: Tyler Hoffman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +import * as React from 'react'; + +export {}; + +type RefCallback = (element: React.ReactNode | null) => void; + +export type TestHookGenerator = (label: string, callback?: RefCallback) => RefCallback; + +export type WithTestHook = T & { generateTestHook: TestHookGenerator }; + +export function hook(component: React.ComponentClass>): React.ComponentClass; + +export interface TesterProps { + specs: Array<(spec: TestScope) => void>; + waitTime: number; + sendReport?: boolean; +} + +export class Tester extends React.Component { + reRender(): void; + clearAsync(): Promise; +} + +export class TestScope { + component: Tester; + findComponent(identifier: string): Promise; + describe(label: string, fn: () => void): void; + it(label: string, fn: () => void): void; + press(identifier: string): Promise; + fillIn(identifier: string, str: string): Promise; + pause(time: number): Promise; + exists(identifier: string): Promise; + notExists(identifier: string): Promise; +} diff --git a/types/clean-webpack-plugin/tsconfig.json b/types/cavy/tsconfig.json similarity index 90% rename from types/clean-webpack-plugin/tsconfig.json rename to types/cavy/tsconfig.json index 8d0f70d644..4b78de6410 100644 --- a/types/clean-webpack-plugin/tsconfig.json +++ b/types/cavy/tsconfig.json @@ -13,11 +13,12 @@ "../" ], "types": [], + "jsx": "react", "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "clean-webpack-plugin-tests.ts" + "cavy-tests.tsx" ] } \ No newline at end of file diff --git a/types/clean-webpack-plugin/tslint.json b/types/cavy/tslint.json similarity index 100% rename from types/clean-webpack-plugin/tslint.json rename to types/cavy/tslint.json diff --git a/types/cbor/tslint.json b/types/cbor/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cbor/tslint.json +++ b/types/cbor/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/center-align/center-align-tests.ts b/types/center-align/center-align-tests.ts new file mode 100644 index 0000000000..c54c36ea44 --- /dev/null +++ b/types/center-align/center-align-tests.ts @@ -0,0 +1,17 @@ +import center from "center-align"; + +// multi-line sample +center([ + "Lorem ipsum dolor sit amet,", + "consectetur adipiscing", + "elit, sed do eiusmod tempor incididunt", + "ut labore et dolore", + "magna aliqua. Ut enim ad minim", + "veniam, quis" +]); + +// single-line samples +center("foo"); // => 'foo' (does nothing) +center("foo", 12); // => ' foo ' +center("foo", 10); // => ' foo ' +center("foo", 8); // => ' foo ' diff --git a/types/center-align/index.d.ts b/types/center-align/index.d.ts new file mode 100644 index 0000000000..47ff64b101 --- /dev/null +++ b/types/center-align/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for center-align 1.0 +// Project: https://github.com/jonschlinkert/center-align +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +declare function center_align(val: string, width?: number): string; +declare function center_align(val: string[], width?: number): string[]; + +export = center_align; diff --git a/types/center-align/tsconfig.json b/types/center-align/tsconfig.json new file mode 100644 index 0000000000..538e2aa296 --- /dev/null +++ b/types/center-align/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", "center-align-tests.ts"] +} diff --git a/types/conf/tslint.json b/types/center-align/tslint.json similarity index 100% rename from types/conf/tslint.json rename to types/center-align/tslint.json diff --git a/types/centra/centra-tests.ts b/types/centra/centra-tests.ts new file mode 100644 index 0000000000..908d94b41b --- /dev/null +++ b/types/centra/centra-tests.ts @@ -0,0 +1,52 @@ +import centra = require('centra'); +import { URL } from 'url'; + +function typeTests() { + // Test chaining + centra('http://google.com') + .query('param', 'value') + .path('mail') + .body({ a: 1, b: 2 }) + .header({ a: 'b' }) + .header('a', 'b') + .timeout(123) + .stream() + .compress() + .option('host', '123') + .option('port', 123) + .send().then(resp => { + resp.json().then((s: string) => s); + resp.text().then((s: string) => s); + resp.statusCode; + resp.coreRes; + resp.headers['asdf']; + resp.body.buffer.byteLength; + }); + + centra(new URL('google.com')) + .query('page', '2'); +} + +async function functionalTests() { + await centra('http://example.com').send().then(async r => { + if (r.statusCode !== 200) { + throw new Error('Bad status code'); + } + r.text().then(t => t); + }); + + await centra(new URL('https://jsonplaceholder.typicode.com/todos')) + .query('userId', 1) + .timeout(1000) + .compress() + .send() + .then(r => { + r.json().then((todos: any[]) => { + if (!todos.every(t => t.userId === 1)) { + throw new Error('Query params did not work'); + } + }); + }); +} + +functionalTests(); diff --git a/types/centra/index.d.ts b/types/centra/index.d.ts new file mode 100644 index 0000000000..ae08d8ac2b --- /dev/null +++ b/types/centra/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for centra 2.2 +// Project: https://github.com/ethanent/centra +// Definitions by: Tony Wooster +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { RequestOptions, IncomingMessage } from 'http'; +import { URL } from 'url'; + +interface CentraFactory { + (url: URL | string, method?: string): Centra.Request; +} + +declare const Centra: CentraFactory; + +declare namespace Centra { + interface Response { + coreRes: IncomingMessage; + headers: IncomingMessage['headers']; + statusCode: IncomingMessage['statusCode']; + body: Buffer; + + json(): Promise; + text(): Promise; + } + + interface Request { + url: URL; + method: string; + data: string | Buffer | null; + sendDataAs: 'form' | 'json' | 'buffer' | null; + reqHeaders: { [k: string]: string }; + streamEnabled: boolean; + compressionEnabled: boolean; + timeoutTime: number | null; + coreOptions: RequestOptions; + + query(key: string, value: any): this; + query(params: { [k: string]: any }): this; + path(relativePath: string): this; + body(data: any, sendAs?: 'json' | 'buffer' | 'form'): this; + header(key: string, value: string): this; + header(headers: { [k: string]: string }): this; + timeout(timeMs: number): this; + option(key: T, value: RequestOptions[T]): this; + stream(): this; + compress(): this; + send(): Promise; + } +} + +export = Centra; diff --git a/types/p-pipe/tsconfig.json b/types/centra/tsconfig.json similarity index 94% rename from types/p-pipe/tsconfig.json rename to types/centra/tsconfig.json index 46cabfcfeb..6d690a3120 100644 --- a/types/p-pipe/tsconfig.json +++ b/types/centra/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "p-pipe-tests.ts" + "centra-tests.ts" ] } diff --git a/types/conf/v0/tslint.json b/types/centra/tslint.json similarity index 100% rename from types/conf/v0/tslint.json rename to types/centra/tslint.json diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 398d05ad33..34f9fd148d 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for cesium 1.47 +// Type definitions for cesium 1.54 // Project: http://cesiumjs.org // Definitions by: Aigars Zeiza // Harry Nicholls // Jared Szechy // Radek Goláň jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.0 // tslint:disable-next-line:export-just-namespace export = Cesium; @@ -312,7 +312,7 @@ declare namespace Cesium { clockRange: ClockRange; canAnimate: boolean; shouldAnimate: boolean; - onTick: Event; + onTick: Event<[Clock]>; constructor(options: { startTime?: JulianDate; stopTime?: JulianDate; @@ -704,11 +704,11 @@ declare namespace Cesium { constructor(options?: { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid }); } - class Event { + class Event { numberOfListeners: number; - addEventListener(listener: () => void, scope?: any): Event.RemoveCallback; - removeEventListener(listener: () => void, scope?: any): boolean; - raiseEvent(...args: any[]): void; + addEventListener(listener: (...args: T) => void, scope?: any): Event.RemoveCallback; + removeEventListener(listener: (...args: T) => void, scope?: any): boolean; + raiseEvent(...args: T): void; } namespace Event { @@ -1393,7 +1393,7 @@ declare namespace Cesium { class ScreenSpaceEventHandler { constructor(element?: HTMLCanvasElement); - setInputAction(action: () => void, type: number, modifier?: number): void; + setInputAction(action: (click: { position: Cartesian2 }) => void, type: number, modifier?: number): void; getInputAction(type: number, modifier?: number): () => void; removeInputAction(type: number, modifier?: number): void; isDestroyed(): boolean; @@ -1512,7 +1512,7 @@ declare namespace Cesium { retry: boolean; error: Error; constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error); - static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, + static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event<[TileProviderError]>, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError; static handleSuccess(previousError: TileProviderError): void; @@ -1562,7 +1562,7 @@ declare namespace Cesium { } class TimeIntervalCollection { - readonly changedEvent: Event; + readonly changedEvent: Event<[TimeIntervalCollection]>; readonly start: JulianDate; readonly isStartIncluded: boolean; readonly stop: JulianDate; @@ -3134,6 +3134,15 @@ declare namespace Cesium { static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange; } + // tslint:disable-next-line:no-unnecessary-class + class Cesium3DTileset { + constructor(Cesium3DTilesetItem: { + url: string; + maximumScreenSpaceError: number; + maximumNumberOfLoadedTiles: number; + }) + } + class ImageryLayer { alpha: number; brightness: number; @@ -4379,8 +4388,8 @@ declare namespace Cesium { allowDataSourcesToSuspendAnimation: boolean; trackedEntity: Entity; selectedEntity: Entity; - readonly trackedEntityChanged: Event; - readonly selectedEntityChanged: Event; + readonly trackedEntityChanged: Event<[Entity?]>; + readonly selectedEntityChanged: Event<[Entity?]>; readonly shadowMap: ShadowMap; readonly vrButton: VRButton; shadows: boolean; diff --git a/types/chai-as-promised/tslint.json b/types/chai-as-promised/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-as-promised/tslint.json +++ b/types/chai-as-promised/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-datetime/tslint.json b/types/chai-datetime/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-datetime/tslint.json +++ b/types/chai-datetime/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-dom/tslint.json b/types/chai-dom/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-dom/tslint.json +++ b/types/chai-dom/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-enzyme/tslint.json b/types/chai-enzyme/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-enzyme/tslint.json +++ b/types/chai-enzyme/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-fuzzy/tslint.json b/types/chai-fuzzy/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-fuzzy/tslint.json +++ b/types/chai-fuzzy/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-http/chai-http-tests.ts b/types/chai-http/chai-http-tests.ts deleted file mode 100644 index 37a4df794e..0000000000 --- a/types/chai-http/chai-http-tests.ts +++ /dev/null @@ -1,141 +0,0 @@ -import fs = require('fs'); -import http = require('http'); -import chai = require('chai'); -import ChaiHttp = require('chai-http'); -import when = require('when'); - -chai.use(ChaiHttp); - -// ReSharper disable WrongExpressionStatement - -// Add promise support if this does not exist natively. -if (!global.Promise) { - chai.request.addPromises(when.promise); -} - -declare const app: http.Server; - -chai.request(app).get('/'); -chai.request('http://localhost:8080').get('/'); - -chai.request(app) - .put('/user/me') - .set('X-API-Key', 'foobar') - .send({ password: '123', confirmPassword: '123' }); - -chai.request(app) - .post('/user/me') - .field('_method', 'put') - .field('password', '123') - .field('confirmPassword', '123'); - -chai.request(app) - .post('/user/avatar') - .attach('imageField', fs.readFileSync('avatar.png'), 'avatar.png'); - -chai.request(app) - .get('/protected') - .auth('user', 'pass'); - -// HTTPS request, from: https://github.com/visionmedia/superagent/commit/6158efbf42cb93d77c1a70887284be783dd7dabe -const ca = fs.readFileSync('ca.cert.pem'); -const key = fs.readFileSync('key.pem'); -const cert = fs.readFileSync('cert.pem'); -const callback = (err: any, res: ChaiHttp.Response) => {}; - -chai.request(app) - .post('/secure') - .ca(ca) - .key(key) - .cert(cert) - .end(callback); - -const pfx = fs.readFileSync('cert.pfx'); -chai.request(app) - .post('/secure') - .pfx(pfx) - .end(callback); - -chai.request(app) - .get('/search') - .query({ name: 'foo', limit: 10 }); - -chai.request(app) - .get('/download') - .buffer() - .parse((res, cb) => { - let data = ''; - res.setEncoding('binary'); - res.on('data', (chunk: any) => { data += chunk; }); - res.on('end', () => { cb(undefined, new Buffer(data, 'binary')); }); - }); - -chai.request(app) - .put('/user/me') - .send({ passsword: '123', confirmPassword: '123' }) - .end((err: any, res: ChaiHttp.Response) => { - chai.expect(err).to.be.null; - chai.expect(res).to.have.status(200); - }); - -chai.request(app) - .put('/user/me') - .send({ passsword: '123', confirmPassword: '123' }) - .then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200)) - .catch((err: any) => { throw err; }); - -chai.request(app) - .keepOpen() - .close((err: any) => { throw err; }); - -const agent = chai.request.agent(app); - -agent - .post('/session') - .send({ username: 'me', password: '123' }) - .then((res: ChaiHttp.Response) => { - chai.expect(res).to.have.cookie('sessionid'); - // The `agent` now has the sessionid cookie saved, and will send it - // back to the server in the next request: - return agent.get('/user/me') - .then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200)); - }); - -agent.close((err: any) => { throw err; }); - -function test1() { - const req = chai.request(app).get('/'); - req.then((res: ChaiHttp.Response) => { - chai.expect(res).to.have.status(200); - chai.expect(res).to.have.header('content-type', 'text/plain'); - chai.expect(res).to.have.header('content-type', /^text/); - chai.expect(res).to.have.headers; - chai.expect('127.0.0.1').to.be.an.ip; - chai.expect(res).to.be.json; - chai.expect(res).to.be.html; - chai.expect(res).to.be.text; - chai.expect(res).to.redirect; - chai.expect(res).to.redirectTo('http://example.com'); - chai.expect(res).to.have.param('orderby'); - chai.expect(res).to.have.param('orderby', 'date'); - chai.expect(res).to.not.have.param('limit'); - chai.expect(req).to.have.cookie('session_id'); - chai.expect(req).to.have.cookie('session_id', '1234'); - chai.expect(req).to.not.have.cookie('PHPSESSID'); - chai.expect(res).to.have.cookie('session_id'); - chai.expect(res).to.have.cookie('session_id', '1234'); - chai.expect(res).to.not.have.cookie('PHPSESSID'); - chai.expect(res.body).to.have.property('version', '4.0.0'); - chai.expect(res.text).to.equal(''); - }, (err: any) => { - throw err; - }); -} - -when(chai.request(app).get('/')).done(() => console.log('success'), () => console.log('failure')); - -Promise.resolve(1) - .then(val => chai.request(app).get(`/user/${val}`)) - .then(res => { - chai.expect(res).to.have.status(200); - }); diff --git a/types/chai-http/index.d.ts b/types/chai-http/index.d.ts deleted file mode 100644 index de3caa13e7..0000000000 --- a/types/chai-http/index.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -// Type definitions for chai-http 3.0 -// Project: https://github.com/chaijs/chai-http -// Definitions by: Wim Looman -// Liam Jones -// Federico Caselli -// Bas Luksenburg -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// -/// - -import * as request from 'superagent'; - -declare global { - namespace Chai { - interface ChaiStatic { - request: ChaiHttpRequest; - } - - interface ChaiHttpRequest { - (server: any): ChaiHttp.Agent; - agent(server: any): ChaiHttp.Agent; - addPromises(promiseConstructor: any): void; - } - - interface Assertion { - status(code: number): Assertion; - header(key: string, value?: string | RegExp): Assertion; - headers: Assertion; - json: Assertion; - text: Assertion; - html: Assertion; - redirect: Assertion; - redirectTo(location: string): Assertion; - param(key: string, value?: string): Assertion; - cookie(key: string, value?: string): Assertion; - } - - interface TypeComparison { - ip: Assertion; - } - } - - namespace ChaiHttp { - interface Promise { - then(onFulfilled: (value: T) => U, onRejected?: (reason: any) => U): Promise; - } - - interface Response { - body: any; - type: string; - status: number; - text: string; - setEncoding(encoding: string): void; - on(event: string, fn: (...args: any[]) => void): void; - } - - interface Agent { - get(url: string, callback?: (err: any, res: Response) => void): request.Request; - post(url: string, callback?: (err: any, res: Response) => void): request.Request; - put(url: string, callback?: (err: any, res: Response) => void): request.Request; - head(url: string, callback?: (err: any, res: Response) => void): request.Request; - del(url: string, callback?: (err: any, res: Response) => void): request.Request; - options(url: string, callback?: (err: any, res: Response) => void): request.Request; - patch(url: string, callback?: (err: any, res: Response) => void): request.Request; - keepOpen(): Agent; - close(callback?: (err: any) => void): Agent; - } - - interface TypeComparison { - ip: any; - } - } -} - -declare function chaiHttp(chai: any, utils: any): void; -export = chaiHttp; diff --git a/types/chai-jquery/tslint.json b/types/chai-jquery/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-jquery/tslint.json +++ b/types/chai-jquery/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-moment/chai-moment-tests.ts b/types/chai-moment/chai-moment-tests.ts new file mode 100644 index 0000000000..6354c4796b --- /dev/null +++ b/types/chai-moment/chai-moment-tests.ts @@ -0,0 +1,14 @@ +import { assert, expect, use } from 'chai'; +import chaiMoment = require('chai-moment'); + +use(chaiMoment); + +// bdd style +expect('2019-03-14').to.be.afterMoment('2019-03-12', 'day'); +expect('2019-03-14').to.be.beforeMoment('2019-03-16'); +expect('2019-03-14').to.be.sameMoment('2019-03-14', 'day'); + +// tdd style +assert.afterMoment('2019-03-14', '2019-03-12'); +assert.beforeMoment('2019-03-14', '2019-03-18', 'day'); +assert.sameMoment('2019-03-14', '2019-03-14', 'day'); diff --git a/types/chai-moment/index.d.ts b/types/chai-moment/index.d.ts new file mode 100644 index 0000000000..0b19b7573f --- /dev/null +++ b/types/chai-moment/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for chai-moment 0.1 +// Project: https://github.com/picardy/chai-moment +// Definitions by: Chris Godsey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare global { + namespace Chai { + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + afterMoment(expected: string, granularity?: string): void; + beforeMoment(expected: string, granularity?: string): void; + sameMoment(expected: string, granularity?: string): void; + } + + interface Assert { + afterMoment(val: any, exp: any, granularity?: any, msg?: any): void; + beforeMoment(val: any, exp: any, granularity?: any, msg?: any): void; + sameMoment(val: any, exp: any, granularity?: any, msg?: any): void; + } + } +} + +declare function chaiMoment(chai: any, utils: any): void; +export = chaiMoment; diff --git a/types/chai-moment/tsconfig.json b/types/chai-moment/tsconfig.json new file mode 100644 index 0000000000..571fe4f114 --- /dev/null +++ b/types/chai-moment/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-moment-tests.ts" + ] +} diff --git a/types/chai-moment/tslint.json b/types/chai-moment/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/chai-moment/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/chai-spies/tslint.json b/types/chai-spies/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-spies/tslint.json +++ b/types/chai-spies/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-string/tslint.json b/types/chai-string/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-string/tslint.json +++ b/types/chai-string/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chai-things/tslint.json b/types/chai-things/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chai-things/tslint.json +++ b/types/chai-things/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chance/tslint.json b/types/chance/tslint.json index 2ef6444ebb..a2a331133e 100644 --- a/types/chance/tslint.json +++ b/types/chance/tslint.json @@ -3,6 +3,7 @@ "rules": { "adjacent-overload-signatures": false, "dt-header": false, + "npm-naming": false, "no-declare-current-package": false, "no-single-declare-module": false, "no-unnecessary-generics": false, diff --git a/types/change-emitter/tslint.json b/types/change-emitter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/change-emitter/tslint.json +++ b/types/change-emitter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/changelog-parser/changelog-parser-tests.ts b/types/changelog-parser/changelog-parser-tests.ts new file mode 100644 index 0000000000..69a5ffdab3 --- /dev/null +++ b/types/changelog-parser/changelog-parser-tests.ts @@ -0,0 +1,24 @@ +import parseChangelog = require('changelog-parser'); + +const options = { + filePath: 'path/to/CHANGELOG.md', + removeMarkdown: false +}; + +const fn = (obj: object): void => {}; + +parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (error, result) => { + if (error) { + throw error; + } + + fn(result); +}); + +parseChangelog(options, (error, result) => {}); + +parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (error) => {}); + +parseChangelog(options).then((result) => {}); + +parseChangelog('path/to/CHANGELOG.md').then((result) => {}); diff --git a/types/changelog-parser/index.d.ts b/types/changelog-parser/index.d.ts new file mode 100644 index 0000000000..a1799454c8 --- /dev/null +++ b/types/changelog-parser/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for changelog-parser 2.7 +// Project: https://github.com/hypermodules/changelog-parser +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +interface Options { + /** + * Path to changelog file. + */ + filePath: string; + /** + * Removes the markdown markup from the changelog entries by default. + * You can change its value to false to keep the markdown. + */ + removeMarkdown: boolean; +} + +/** + * Change log parser for node. + */ +declare function parseChangelog(options: Partial|string, + callback?: (error: string|null, result: object) => void): Promise; + +export = parseChangelog; diff --git a/types/camelcase/tsconfig.json b/types/changelog-parser/tsconfig.json similarity index 92% rename from types/camelcase/tsconfig.json rename to types/changelog-parser/tsconfig.json index bcc1b505e1..e40482d8e4 100644 --- a/types/camelcase/tsconfig.json +++ b/types/changelog-parser/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "camelcase-tests.ts" + "changelog-parser-tests.ts" ] } \ No newline at end of file diff --git a/types/conf/v1/tslint.json b/types/changelog-parser/tslint.json similarity index 100% rename from types/conf/v1/tslint.json rename to types/changelog-parser/tslint.json diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index e35c556b56..879ef9bb3f 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -115,7 +115,9 @@ const scaleOptions: Chart.RadialLinearScale = { lineArc: false, display: false, scaleLabel: { - display: false + display: false, + lineHeight: 1, + padding: 0, }, }; const radarChartOptions: Chart.RadialChartOptions = { diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 7745713c84..111c8da57f 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for Chart.js 2.7 -// Project: https://github.com/nnnick/Chart.js, http://www.chartjs.org +// Project: https://github.com/nnnick/Chart.js, https://www.chartjs.org // Definitions by: Alberto Nuti // Fabien Lavocat // KentarouTakeda @@ -33,7 +33,7 @@ declare class Chart { clear: () => {}; toBase64Image: () => string; generateLegend: () => {}; - getElementAtEvent: (e: any) => {}; + getElementAtEvent: (e: any) => [{}]; getElementsAtEvent: (e: any) => Array<{}>; getDatasetAtEvent: (e: any) => Array<{}>; getDatasetMeta: (index: number) => Meta; @@ -60,62 +60,8 @@ declare class Chart { static Tooltip: Chart.ChartTooltipsStaticConfiguration; } declare class PluginServiceStatic { - register(plugin: PluginServiceGlobalRegistration & PluginServiceRegistrationOptions): void; - unregister(plugin: PluginServiceGlobalRegistration & PluginServiceRegistrationOptions): void; -} - -interface PluginServiceGlobalRegistration { - id?: string; -} - -interface PluginServiceRegistrationOptions { - beforeInit?(chartInstance: Chart, options?: any): void; - afterInit?(chartInstance: Chart, options?: any): void; - - beforeUpdate?(chartInstance: Chart, options?: any): void; - afterUpdate?(chartInstance: Chart, options?: any): void; - - beforeLayout?(chartInstance: Chart, options?: any): void; - afterLayout?(chartInstance: Chart, options?: any): void; - - beforeDatasetsUpdate?(chartInstance: Chart, options?: any): void; - afterDatasetsUpdate?(chartInstance: Chart, options?: any): void; - - beforeDatasetUpdate?(chartInstance: Chart, options?: any): void; - afterDatasetUpdate?(chartInstance: Chart, options?: any): void; - - // This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw - // to do something on each animation frame - beforeRender?(chartInstance: Chart, options?: any): void; - afterRender?(chartInstance: Chart, options?: any): void; - - // Easing is for animation - beforeDraw?(chartInstance: Chart, easing: string, options?: any): void; - afterDraw?(chartInstance: Chart, easing: string, options?: any): void; - - // Before the datasets are drawn but after scales are drawn - beforeDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; - afterDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; - - beforeDatasetDraw?(chartInstance: Chart, easing: string, options?: any): void; - afterDatasetDraw?(chartInstance: Chart, easing: string, options?: any): void; - - // Called before drawing the `tooltip`. If any plugin returns `false`, - // the tooltip drawing is cancelled until another `render` is triggered. - beforeTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; - // Called after drawing the `tooltip`. Note that this hook will not, - // be called if the tooltip drawing has been previously cancelled. - afterTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; - - // Called when an event occurs on the chart - beforeEvent?(chartInstance: Chart, event: Event, options?: any): void; - afterEvent?(chartInstance: Chart, event: Event, options?: any): void; - - resize?(chartInstance: Chart, newChartSize: Chart.ChartSize, options?: any): void; - destroy?(chartInstance: Chart): void; - - /** @deprecated since version 2.5.0. Use `afterLayout` instead. */ - afterScaleUpdate?(chartInstance: Chart, options?: any): void; + register(plugin: Chart.PluginServiceGlobalRegistration & Chart.PluginServiceRegistrationOptions): void; + unregister(plugin: Chart.PluginServiceGlobalRegistration & Chart.PluginServiceRegistrationOptions): void; } interface Meta { @@ -357,7 +303,7 @@ declare namespace Chart { cornerRadius?: number; multiKeyBackground?: string; callbacks?: ChartTooltipCallback; - filter?(item: ChartTooltipItem): boolean; + filter?(item: ChartTooltipItem, data: ChartData): boolean; itemSort?(itemA: ChartTooltipItem, itemB: ChartTooltipItem): number; position?: string; caretPadding?: number; @@ -480,10 +426,12 @@ declare namespace Chart { interface ScaleTitleOptions { display?: boolean; labelString?: string; + lineHeight?: number | string; fontColor?: ChartColor; fontFamily?: string; fontSize?: number; fontStyle?: string; + padding?: ChartLayoutPaddingObject | number; } interface TickOptions extends NestedTickOptions { @@ -566,7 +514,7 @@ declare namespace Chart { hoverBorderWidth?: number | number[]; label?: string; lineTension?: number; - steppedLine?: 'before' | 'after' | boolean; + steppedLine?: 'before' | 'after' | 'middle' | boolean; pointBorderColor?: ChartColor | ChartColor[]; pointBackgroundColor?: ChartColor | ChartColor[]; pointBorderWidth?: number | number[]; @@ -683,6 +631,60 @@ declare namespace Chart { x: number; y: number; } + + interface PluginServiceGlobalRegistration { + id?: string; + } + + interface PluginServiceRegistrationOptions { + beforeInit?(chartInstance: Chart, options?: any): void; + afterInit?(chartInstance: Chart, options?: any): void; + + beforeUpdate?(chartInstance: Chart, options?: any): void; + afterUpdate?(chartInstance: Chart, options?: any): void; + + beforeLayout?(chartInstance: Chart, options?: any): void; + afterLayout?(chartInstance: Chart, options?: any): void; + + beforeDatasetsUpdate?(chartInstance: Chart, options?: any): void; + afterDatasetsUpdate?(chartInstance: Chart, options?: any): void; + + beforeDatasetUpdate?(chartInstance: Chart, options?: any): void; + afterDatasetUpdate?(chartInstance: Chart, options?: any): void; + + // This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw + // to do something on each animation frame + beforeRender?(chartInstance: Chart, options?: any): void; + afterRender?(chartInstance: Chart, options?: any): void; + + // Easing is for animation + beforeDraw?(chartInstance: Chart, easing: string, options?: any): void; + afterDraw?(chartInstance: Chart, easing: string, options?: any): void; + + // Before the datasets are drawn but after scales are drawn + beforeDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; + afterDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; + + beforeDatasetDraw?(chartInstance: Chart, easing: string, options?: any): void; + afterDatasetDraw?(chartInstance: Chart, easing: string, options?: any): void; + + // Called before drawing the `tooltip`. If any plugin returns `false`, + // the tooltip drawing is cancelled until another `render` is triggered. + beforeTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; + // Called after drawing the `tooltip`. Note that this hook will not, + // be called if the tooltip drawing has been previously cancelled. + afterTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; + + // Called when an event occurs on the chart + beforeEvent?(chartInstance: Chart, event: Event, options?: any): void; + afterEvent?(chartInstance: Chart, event: Event, options?: any): void; + + resize?(chartInstance: Chart, newChartSize: ChartSize, options?: any): void; + destroy?(chartInstance: Chart): void; + + /** @deprecated since version 2.5.0. Use `afterLayout` instead. */ + afterScaleUpdate?(chartInstance: Chart, options?: any): void; + } } export = Chart; diff --git a/types/chartist/tslint.json b/types/chartist/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chartist/tslint.json +++ b/types/chartist/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/checksum/tslint.json b/types/checksum/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/checksum/tslint.json +++ b/types/checksum/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts index 719c0c70da..89ffb9e28f 100644 --- a/types/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -24,6 +24,8 @@ if ($fromElement("ul > li").length !== 3) { throw new Error("Expecting 3 elements when passing `CheerioElement` to `load()`"); } +$ = cheerio.load(Buffer.from(html)); + $ = cheerio.load(html, { normalizeWhitespace: true, xmlMode: true diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index 6c893021a3..f25c978ed0 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -1,8 +1,10 @@ // 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 , AzSiAz +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao , Chennakrishna , AzSiAz , Ryo Ota // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + interface Cheerio { // Document References // Cheerio https://github.com/cheeriojs/cheerio @@ -266,7 +268,7 @@ interface CheerioElement { } interface CheerioAPI extends CheerioSelector, CheerioStatic { - load(html: string, options?: CheerioOptionsInterface): CheerioStatic; + load(html: string | Buffer, options?: CheerioOptionsInterface): CheerioStatic; load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic; } diff --git a/types/cheerio/tslint.json b/types/cheerio/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cheerio/tslint.json +++ b/types/cheerio/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/child-process-promise/child-process-promise-tests.ts b/types/child-process-promise/child-process-promise-tests.ts new file mode 100644 index 0000000000..365e7e8f60 --- /dev/null +++ b/types/child-process-promise/child-process-promise-tests.ts @@ -0,0 +1,15 @@ +import * as cpp from "child-process-promise"; + +import { + ChildProcess +} from 'child_process'; + +const a = cpp.exec("echo \"Hello world!\""); +a.childProcess; // $ExpectType ChildProcess + +(async () => { + const at = await a; + at.childProcess; // $ExpectType ChildProcess + at.stdout; // $ExpectType string + at.stderr; // $ExpectType string +})(); diff --git a/types/child-process-promise/index.d.ts b/types/child-process-promise/index.d.ts new file mode 100644 index 0000000000..344657f4f1 --- /dev/null +++ b/types/child-process-promise/index.d.ts @@ -0,0 +1,104 @@ +// Type definitions for child-process-promise 2.2 +// Project: https://github.com/patrick-steele-idem/child-process-promise +// Definitions by: Luis Paulo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +import { + ChildProcess, + ExecFileOptionsWithBufferEncoding, ExecFileOptionsWithOtherEncoding, + ExecFileOptionsWithStringEncoding, + ExecOptions, + ForkOptions, + SpawnOptions +} from 'child_process'; + +/** + * Simple wrapper around the child_process module that makes use of promises + */ + +export interface PromiseResult { + childProcess: ChildProcess; + stdout: Enc; + stderr: Enc; +} + +export interface SpawnPromiseResult extends PromiseResult { + code: number; +} + +export interface ChildProcessPromise extends Promise { + childProcess: ChildProcess; +} + +export interface Options { + /** + * Pass an additional capture option to buffer the result of stdout and/or stderr + * Default: [] + */ + capture?: []|['stdout'|'stderr']|['stdout', 'stderr']|['stderr', 'stdout']; + /** + * Array of the numbers that should be interpreted as successful execution codes + * Default: [0] + */ + successfulExitCodes?: number[]; +} + +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options: Readonly +): ChildProcessPromise>; +export function exec( + command: Readonly, + options?: Readonly +): ChildProcessPromise>; + +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args: ReadonlyArray | null, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args: ReadonlyArray | null, + options: Readonly +): ChildProcessPromise>; +export function execFile( + file: Readonly, + args?: ReadonlyArray | null, + options?: Readonly +): ChildProcessPromise>; + +export function spawn( + command: Readonly, + args?: ReadonlyArray | null, + options?: Readonly +): ChildProcessPromise; + +export function fork( + modulePath: string, + args?: ReadonlyArray, + options?: Readonly +): ChildProcessPromise; diff --git a/types/child-process-promise/tsconfig.json b/types/child-process-promise/tsconfig.json new file mode 100644 index 0000000000..b0f60c39eb --- /dev/null +++ b/types/child-process-promise/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", + "child-process-promise-tests.ts" + ] +} diff --git a/types/cp-file/tslint.json b/types/child-process-promise/tslint.json similarity index 100% rename from types/cp-file/tslint.json rename to types/child-process-promise/tslint.json diff --git a/types/chocolatechipjs/chocolatechipjs-tests.ts b/types/chocolatechipjs/chocolatechipjs-tests.ts index a723d1b8f9..93cd698da7 100644 --- a/types/chocolatechipjs/chocolatechipjs-tests.ts +++ b/types/chocolatechipjs/chocolatechipjs-tests.ts @@ -213,7 +213,7 @@ $('ul').undelegate('click', 'li', () => { $('li').on('click', () => { $.noop; }); -$('ul').on('click', 'li', () => { +$('ul').on('click', 'li', function() { console.log($(this).text()); }); $('li').off('click'); diff --git a/types/chocolatechipjs/tslint.json b/types/chocolatechipjs/tslint.json index 9969e961d1..c5bc46f555 100644 --- a/types/chocolatechipjs/tslint.json +++ b/types/chocolatechipjs/tslint.json @@ -5,6 +5,7 @@ "adjacent-overload-signatures": false, "ban-types": false, "dt-header": false, + "npm-naming": false, "no-any-union": false, "unified-signatures": false, "no-unnecessary-generics": false, diff --git a/types/chokidar/chokidar-tests.ts b/types/chokidar/chokidar-tests.ts deleted file mode 100644 index 13e5fe6a90..0000000000 --- a/types/chokidar/chokidar-tests.ts +++ /dev/null @@ -1,57 +0,0 @@ -import * as fs from 'fs'; -import chokidar = require('chokidar'); - -const watcher = chokidar.watch('file, dir, or glob', { - ignored: /[\/\\]\./, persistent: true -}); - -const log = console.log.bind(console); - -watcher - .on('add', (path: string) => { - log('File', path, 'has been added'); - }) - .on('addDir', (path: string) => { - log('Directory', path, 'has been added'); - }) - .on('change', (path: string) => { - log('File', path, 'has been changed'); - }) - .on('unlink', (path: string) => { - log('File', path, 'has been removed'); - }) - .on('unlinkDir', (path: string) => { - log('Directory', path, 'has been removed'); - }) - .on('error', (error: any) => { - log('Error happened', error); - }) - .on('ready', () => { - log('Initial scan complete. Ready for changes.'); - }) - .on('raw', (event: string, path: string, details: any) => { - log('Raw event info:', event, path, details); - }); - -// 'add', 'addDir' and 'change' events also receive stat() results as second -// argument when available: http://nodejs.org/api/fs.html#fs_class_fs_stats -watcher.on('change', (path: string, stats: fs.Stats) => { - if (stats) { - console.log('File', path, 'changed size to', stats.size); - } -}); - -// Watch new files. -watcher.add('new-file'); -watcher.add(['new-file-2', 'new-file-3', '**/other-file*']); - -// Un-watch some files. -watcher.unwatch('new-file*'); - -// Only needed if watching is `persistent: true`. -watcher.close(); - -// One-liner -chokidar.watch('.', { ignored: /[\/\\]\./ }).on('all', (event: string, path: string) => { - console.log(event, path); -}); diff --git a/types/chokidar/index.d.ts b/types/chokidar/index.d.ts deleted file mode 100644 index 6acc9af265..0000000000 --- a/types/chokidar/index.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -// Type definitions for chokidar 1.7 -// Project: https://github.com/paulmillr/chokidar -// Definitions by: Stefan Steinhart -// Felix Becker -// Zach Cardoza -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -import * as fs from 'fs'; -import { EventEmitter } from 'events'; - -/** - * The object's keys are all the directories (using absolute paths unless the `cwd` option was - * used), and the values are arrays of the names of the items contained in each directory. - */ -export interface WatchedPaths { - [directory: string]: string[]; -} - -export class FSWatcher extends EventEmitter implements fs.FSWatcher { - /** - * Constructs a new FSWatcher instance with optional WatchOptions parameter. - */ - constructor(options?: WatchOptions); - - /** - * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one - * string. - */ - add(paths: string | string[]): void; - - /** - * Stop watching files, directories, or glob patterns. Takes an array of strings or just one - * string. - */ - unwatch(paths: string | string[]): void; - - /** - * Returns an object representing all the paths on the file system being watched by this - * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless - * the `cwd` option was used), and the values are arrays of the names of the items contained in - * each directory. - */ - getWatched(): WatchedPaths; - - /** - * Removes all listeners from watched files. - */ - close(): void; -} - -export interface WatchOptions { - /** - * Indicates whether the process should continue to run as long as files are being watched. If - * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`, - * even if the process continues to run. - */ - persistent?: boolean; - - /** - * ([anymatch](https://github.com/es128/anymatch)-compatible definition) Defines files/paths to - * be ignored. The whole relative or absolute path is tested, not just filename. If a function - * with two arguments is provided, it gets called twice per path - once with a single argument - * (the path), second time with two arguments (the path and the - * [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path). - */ - ignored?: any; - - /** - * If set to `false` then `add`/`addDir` events are also emitted for matching paths while - * instantiating the watching as chokidar discovers these file paths (before the `ready` event). - */ - ignoreInitial?: boolean; - - /** - * When `false`, only the symlinks themselves will be watched for changes instead of following - * the link references and bubbling events through the link's path. - */ - followSymlinks?: boolean; - - /** - * The base directory from which watch `paths` are to be derived. Paths emitted with events will - * be relative to this. - */ - cwd?: string; - - /** - * If set to true then the strings passed to .watch() and .add() are treated as literal path - * names, even if they look like globs. Default: false. - */ - disableGlobbing?: boolean; - - /** - * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU - * utilization, consider setting this to `false`. It is typically necessary to **set this to - * `true` to successfully watch files over a network**, and it may be necessary to successfully - * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides - * the `useFsEvents` default. - */ - usePolling?: boolean; - - /** - * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly - * and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on - * OS X, `usePolling: true` becomes the default. - */ - useFsEvents?: boolean; - - /** - * If relying upon the [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object that - * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is - * provided even in cases where it wasn't already available from the underlying watch events. - */ - alwaysStat?: boolean; - - /** - * If set, limits how many levels of subdirectories will be traversed. - */ - depth?: number; - - /** - * Interval of file system polling. - */ - interval?: number; - - /** - * Interval of file system polling for binary files. ([see list of binary extensions](https://gi - * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json)) - */ - binaryInterval?: number; - - /** - * Indicates whether to watch files that don't have read permissions if possible. If watching - * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed - * silently. - */ - ignorePermissionErrors?: boolean; - - /** - * `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts - * that occur when using editors that use "atomic writes" instead of writing directly to the - * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change` - * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you, - * you can override it by setting `atomic` to a custom value, in milliseconds. - */ - atomic?: boolean | number; - - /** - * can be set to an object in order to adjust timing params: - */ - awaitWriteFinish?: AwaitWriteFinishOptions | boolean; -} - -export interface AwaitWriteFinishOptions { - /** - * Amount of time in milliseconds for a file size to remain constant before emitting its event. - */ - stabilityThreshold?: number; - - /** - * File size polling interval. - */ - pollInterval?: number; -} - -/** - * produces an instance of `FSWatcher`. - */ -export function watch(paths: string | string[], options?: WatchOptions): FSWatcher; diff --git a/types/chrome-apps/tslint.json b/types/chrome-apps/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chrome-apps/tslint.json +++ b/types/chrome-apps/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chrome/tslint.json b/types/chrome/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/chrome/tslint.json +++ b/types/chrome/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/chui/tslint.json b/types/chui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/chui/tslint.json +++ b/types/chui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cipher-base/cipher-base-tests.ts b/types/cipher-base/cipher-base-tests.ts new file mode 100644 index 0000000000..b81238ee98 --- /dev/null +++ b/types/cipher-base/cipher-base-tests.ts @@ -0,0 +1,17 @@ +import CipherBase = require("cipher-base"); + +const buf = new Buffer(1); + +class CipherTest extends CipherBase { + constructor() { + super(); + } + + final() { + return buf; + } + + update(testBuffer: Buffer) { + return testBuffer; + } +} diff --git a/types/cipher-base/index.d.ts b/types/cipher-base/index.d.ts new file mode 100644 index 0000000000..f43ca2cdb9 --- /dev/null +++ b/types/cipher-base/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for cipher-base 1.0 +// Project: https://github.com/crypto-browserify/cipher-base +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare abstract class CipherBase { + constructor(hashMode?: string); + abstract final(): Buffer; + abstract update(value: Buffer, inputEnc?: string, outputEnc?: string): Buffer; +} + +export = CipherBase; diff --git a/types/cipher-base/tsconfig.json b/types/cipher-base/tsconfig.json new file mode 100644 index 0000000000..217193ea64 --- /dev/null +++ b/types/cipher-base/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cipher-base-tests.ts" + ] +} diff --git a/types/cipher-base/tslint.json b/types/cipher-base/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/cipher-base/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/circular-dependency-plugin/circular-dependency-plugin-tests.ts b/types/circular-dependency-plugin/circular-dependency-plugin-tests.ts new file mode 100644 index 0000000000..8c627651e7 --- /dev/null +++ b/types/circular-dependency-plugin/circular-dependency-plugin-tests.ts @@ -0,0 +1,29 @@ +import * as CircularDependencyPlugin from 'circular-dependency-plugin'; +import * as webpack from 'webpack'; + +new CircularDependencyPlugin(); +new CircularDependencyPlugin({}); + +const MAX_CYCLES = 5; +let numCyclesDetected = 0; + +new CircularDependencyPlugin({ + allowAsyncCycles: false, + cwd: process.cwd(), + exclude: /a\.js|node_modules/, + failOnError: true, + onDetected({ module: webpackModuleRecord, paths, compilation }) { + numCyclesDetected++; + compilation.warnings.push(new Error(paths.join(' -> '))); + }, + onStart({ compilation }) { + numCyclesDetected = 0; + }, + onEnd({ compilation }) { + if (numCyclesDetected > MAX_CYCLES) { + compilation.errors.push(new Error('Too many cycles')); + } + }, +}); + +webpack({ plugins: [new CircularDependencyPlugin()] }); diff --git a/types/circular-dependency-plugin/index.d.ts b/types/circular-dependency-plugin/index.d.ts new file mode 100644 index 0000000000..89c14b0ec0 --- /dev/null +++ b/types/circular-dependency-plugin/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for circular-dependency-plugin 5.0 +// Project: https://github.com/aackerman/circular-dependency-plugin +// Definitions by: Olegs Jeremejevs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin, Module, compilation } from 'webpack'; + +export = CircularDependencyPlugin; + +declare class CircularDependencyPlugin extends Plugin { + constructor(options?: CircularDependencyPlugin.Options); + // Not exposing `isCyclic` because it isn't meant to be public, I believe +} + +declare namespace CircularDependencyPlugin { + interface Options { + allowAsyncCycles?: boolean; + cwd?: string; + exclude?: RegExp; + failOnError?: boolean; + onDetected?: (x: { + module: Module; + paths: string[]; + compilation: compilation.Compilation; + }) => void; + onEnd?: (x: { compilation: compilation.Compilation }) => void; + onStart?: (x: { compilation: compilation.Compilation }) => void; + } +} diff --git a/types/circular-dependency-plugin/tsconfig.json b/types/circular-dependency-plugin/tsconfig.json new file mode 100644 index 0000000000..476eb673dd --- /dev/null +++ b/types/circular-dependency-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", + "circular-dependency-plugin-tests.ts" + ] +} diff --git a/types/cpy/tslint.json b/types/circular-dependency-plugin/tslint.json similarity index 100% rename from types/cpy/tslint.json rename to types/circular-dependency-plugin/tslint.json diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index 1321d5b83d..13f6268d9d 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -620,6 +620,7 @@ function test_filter() { allowed = filter.allow('rule', 'name', false); var apply: boolean = filter.applyTo(CKEDITOR.htmlParser.fragment.fromHtml('string'), true, false, 1); + apply = filter.applyTo(new CKEDITOR.htmlParser.element('name', null)); apply = filter.applyTo(new CKEDITOR.htmlParser.element('name', null), true, false, 1); var checked: boolean = filter.check(style); diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index 3d35877b9d..bf2d51b3db 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -1436,7 +1436,7 @@ declare namespace CKEDITOR { addFeature(feature: feature): boolean; addTransformations(transformations: Array>): void; allow(newRules: filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; - applyTo(fragment: htmlParser.fragment | htmlParser.element, toHrml: boolean, transformOnly: boolean, enterMode: number): boolean; + applyTo(fragment: htmlParser.fragment | htmlParser.element, toHtml?: boolean, transformOnly?: boolean, enterMode?: number): boolean; check(test: filter.contentRule, applyTransformations?: boolean, strictCheck?: boolean): boolean; checkFeature(feature: feature): boolean; clone(): filter; diff --git a/types/ckeditor__ckeditor5-core/index.d.ts b/types/ckeditor__ckeditor5-core/index.d.ts index e3de076471..bc07e94fd3 100644 --- a/types/ckeditor__ckeditor5-core/index.d.ts +++ b/types/ckeditor__ckeditor5-core/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for @ckeditor/ckeditor5-core 11.0 -// Project: https://github.com/ckeditor/ckeditor5-core, https://ckeditor.com +// Project: https://github.com/ckeditor/ckeditor5-core, https://ckeditor.com/ckeditor-5 // Definitions by: denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/ckeditor__ckeditor5-engine/index.d.ts b/types/ckeditor__ckeditor5-engine/index.d.ts index 4d3e3f4a97..227862c0e3 100644 --- a/types/ckeditor__ckeditor5-engine/index.d.ts +++ b/types/ckeditor__ckeditor5-engine/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for @ckeditor/ckeditor5-engine 11.0 -// Project: https://github.com/ckeditor/ckeditor5-engine, https://ckeditor.com +// Project: https://github.com/ckeditor/ckeditor5-engine, https://ckeditor.com/ckeditor-5 // Definitions by: denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/ckeditor__ckeditor5-utils/index.d.ts b/types/ckeditor__ckeditor5-utils/index.d.ts index 3d943969de..fa270c8ba5 100644 --- a/types/ckeditor__ckeditor5-utils/index.d.ts +++ b/types/ckeditor__ckeditor5-utils/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for @ckeditor/ckeditor5-utils 10.2 -// Project: https://github.com/ckeditor/ckeditor5-utils, https://ckeditor.com +// Project: https://github.com/ckeditor/ckeditor5-utils, https://ckeditor.com/ckeditor-5 // Definitions by: denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/clamp-js-main/clamp-js-main-tests.ts b/types/clamp-js-main/clamp-js-main-tests.ts index f903b82a06..c85eaed664 100644 --- a/types/clamp-js-main/clamp-js-main-tests.ts +++ b/types/clamp-js-main/clamp-js-main-tests.ts @@ -1,4 +1,5 @@ -import clamp, { ClampOptions, ClampResponse } from 'clamp-js-main'; +import clamp = require('clamp-js-main'); +import { ClampOptions, ClampResponse } from 'clamp-js-main'; const element: HTMLElement = document.createElement('div'); element.style.setProperty('width', '5px'); diff --git a/types/clamp-js-main/index.d.ts b/types/clamp-js-main/index.d.ts index 75286172cb..80cf322896 100644 --- a/types/clamp-js-main/index.d.ts +++ b/types/clamp-js-main/index.d.ts @@ -3,18 +3,21 @@ // Definitions by: Sinziana Nicolae // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export interface ClampOptions { - clamp?: number|string; - useNativeClamp?: boolean; - splitOnChars?: string[]; - animate?: boolean; - truncationChar?: string; - truncationHTML?: string | null; +declare namespace clamp { + interface ClampOptions { + clamp?: number|string; + useNativeClamp?: boolean; + splitOnChars?: string[]; + animate?: boolean; + truncationChar?: string; + truncationHTML?: string | null; + } + + interface ClampResponse { + original: string; + clamped: string; + } } -export interface ClampResponse { - original: string; - clamped: string; -} - -export default function clamp(element: HTMLElement, options?: ClampOptions): ClampResponse; +export = clamp; +declare function clamp(element: HTMLElement, options?: clamp.ClampOptions): clamp.ClampResponse; diff --git a/types/classnames/tslint.json b/types/classnames/tslint.json index 946c3b6691..0831709701 100644 --- a/types/classnames/tslint.json +++ b/types/classnames/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // TODO - "dt-header": false + "npm-naming": false, + "dt-header": false } } diff --git a/types/cldrjs/tslint.json b/types/cldrjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cldrjs/tslint.json +++ b/types/cldrjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts b/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts deleted file mode 100644 index 6d60f36d51..0000000000 --- a/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts +++ /dev/null @@ -1,17 +0,0 @@ -import CleanWebpackPlugin = require('clean-webpack-plugin'); - -const paths = [ - 'path', - 'glob/**/*.js', -]; - -new CleanWebpackPlugin(paths); -new CleanWebpackPlugin(paths, 'root-directory'); -new CleanWebpackPlugin(paths, {}); -new CleanWebpackPlugin(paths, { - root: 'root-directory', - verbose: true, - dry: true, - watch: true, - exclude: ['a, b'], -}); diff --git a/types/clean-webpack-plugin/index.d.ts b/types/clean-webpack-plugin/index.d.ts deleted file mode 100644 index 7c23e51df5..0000000000 --- a/types/clean-webpack-plugin/index.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Type definitions for clean-webpack-plugin 0.1 -// Project: https://github.com/johnagan/clean-webpack-plugin -// Definitions by: Jed Fox -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import { Plugin } from 'webpack'; - -export = CleanWebpackPlugin; - -declare class CleanWebpackPlugin extends Plugin { - /** - * @param paths A glob or array of globs to delete - */ - constructor(paths: string | ReadonlyArray, options?: string | CleanWebpackPlugin.Options); -} - -declare namespace CleanWebpackPlugin { - interface Options { - /** - * Absolute path to your webpack root folder (paths appended to this) - * Default: root of your package - */ - root?: string; - /** - * Write logs to the console. - */ - verbose?: boolean; - /** - * Set to `true` to emulate deletion without actually removing any files. - */ - dry?: boolean; - /** - * If true, remove files on recompile. - */ - watch?: boolean; - /** - * Instead of removing whole path recursively, - * remove all path's content with exclusion of provided immediate children. - * Good for not removing shared files from build directories. - */ - exclude?: ReadonlyArray; - /** - * Allow the plugin to clean folders outside of the webpack root - */ - allowExternal?: boolean; - } -} diff --git a/types/cli-color/tslint.json b/types/cli-color/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cli-color/tslint.json +++ b/types/cli-color/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cli-progress/index.d.ts b/types/cli-progress/index.d.ts index 3ac9dfe8a3..4c2c516d37 100644 --- a/types/cli-progress/index.d.ts +++ b/types/cli-progress/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for cli-progress 1.8 // Project: https://github.com/AndiDittrich/Node.CLI-Progress -// Definitions by: My Self +// Definitions by: Mohamed Hegazy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 diff --git a/types/cli/tslint.json b/types/cli/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cli/tslint.json +++ b/types/cli/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cliff/tslint.json b/types/cliff/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cliff/tslint.json +++ b/types/cliff/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clipboard-js/tslint.json b/types/clipboard-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/clipboard-js/tslint.json +++ b/types/clipboard-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/clone-deep/clone-deep-tests.ts b/types/clone-deep/clone-deep-tests.ts new file mode 100644 index 0000000000..6911c13de4 --- /dev/null +++ b/types/clone-deep/clone-deep-tests.ts @@ -0,0 +1,16 @@ +import cloneDeep = require('clone-deep'); + +cloneDeep(Object.create(null)); // $ExpectType object +cloneDeep({}); // $ExpectType object +cloneDeep({}); // $ExpectType {} +cloneDeep(new Array()); // $ExpectType any[] +cloneDeep([]); // $ExpectType any[] +cloneDeep(42); // $ExpectType number +cloneDeep('clone'); // $ExpectType string +cloneDeep({}, true); // $ExpectType object +cloneDeep({}, true); // $ExpectType {} +cloneDeep(42, true); // $ExpectType number +cloneDeep({}, _ => ({})); // $ExpectType object +cloneDeep({}, _ => ({})); // $ExpectType {} +cloneDeep({}, _ => 42); // $ExpectError +cloneDeep(42, _ => ({})); // $ExpectError diff --git a/types/clone-deep/index.d.ts b/types/clone-deep/index.d.ts new file mode 100644 index 0000000000..7918daaa40 --- /dev/null +++ b/types/clone-deep/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for clone-deep 4.0 +// Project: https://github.com/jonschlinkert/clone-deep +// Definitions by: Tanfonto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +declare function cloneDeep( + val: T, + instanceClone?: true | ((val: T) => T) +): T; + +export = cloneDeep; diff --git a/types/env-paths/tsconfig.json b/types/clone-deep/tsconfig.json similarity index 77% rename from types/env-paths/tsconfig.json rename to types/clone-deep/tsconfig.json index 62dcbca022..cb1cebdf1f 100644 --- a/types/env-paths/tsconfig.json +++ b/types/clone-deep/tsconfig.json @@ -4,7 +4,7 @@ "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": ["../"], @@ -12,8 +12,5 @@ "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "env-paths-tests.ts" - ] + "files": ["index.d.ts", "clone-deep-tests.ts"] } diff --git a/types/decamelize/tslint.json b/types/clone-deep/tslint.json similarity index 100% rename from types/decamelize/tslint.json rename to types/clone-deep/tslint.json diff --git a/types/clone/tslint.json b/types/clone/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/clone/tslint.json +++ b/types/clone/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/closure-compiler/tslint.json b/types/closure-compiler/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/closure-compiler/tslint.json +++ b/types/closure-compiler/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cloud-env/tslint.json b/types/cloud-env/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cloud-env/tslint.json +++ b/types/cloud-env/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cls-hooked/cls-hooked-tests.ts b/types/cls-hooked/cls-hooked-tests.ts index affaa6c54a..60931e1253 100644 --- a/types/cls-hooked/cls-hooked-tests.ts +++ b/types/cls-hooked/cls-hooked-tests.ts @@ -21,3 +21,24 @@ bindLater((x: number) => { const session2 = cls.getNamespace('my session'); session2.get('user'); + +const appNamespace = cls.createNamespace('applicationNameSpace'); +const context = appNamespace.createContext(); + +function bindWithMiddleware(middlewareFn: () => void) { + return session.bind(middlewareFn, context); +} + +bindWithMiddleware(() => { + // Some middleware that doing something in the application +}); + +// In some place in the application, we want to set a value to a given key to be used elsewhere +appNamespace.enter(context); +appNamespace.set('requestId', 'someId'); +appNamespace.exit(context); + +// Retrieve that value set before without losing the context when chaining several middleware +appNamespace.enter(context); +appNamespace.get('requestId'); +appNamespace.exit(context); diff --git a/types/cls-hooked/index.d.ts b/types/cls-hooked/index.d.ts index 57e6b79c60..4fa385c52f 100644 --- a/types/cls-hooked/index.d.ts +++ b/types/cls-hooked/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cls-hooked 4.2 +// Type definitions for cls-hooked 4.3 // Project: https://github.com/jeff-lewis/cls-hooked // Definitions by: Leo Liang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -18,6 +18,8 @@ export interface Namespace { bind(fn: F, context?: any): F; // tslint:disable-line: ban-types bindEmitter(emitter: EventEmitter): void; createContext(): any; + enter(context: any): void; + exit(context: any): void; } export function createNamespace(name: string): Namespace; diff --git a/types/clui/clui-tests.ts b/types/clui/clui-tests.ts new file mode 100644 index 0000000000..1968b10cba --- /dev/null +++ b/types/clui/clui-tests.ts @@ -0,0 +1,96 @@ +import { Gauge, Line, LineBuffer, Progress, Sparkline, Spinner } from 'clui'; +import * as clc from 'cli-color'; + +// LineBuffer +const outputBuffer = new LineBuffer({ + x: 0, + y: 0, + width: 'console', + height: 'console' +}); + +new Line(outputBuffer) + .column('Title Placehole', 20, [clc.green]) + .fill() + .store(); + +new Line(outputBuffer) + .fill() + .store(); + +new Line(outputBuffer) + .column('Suscipit', 20, [clc.cyan]) + .column('Voluptatem', 20, [clc.cyan]) + .column('Nesciunt', 20, [clc.cyan]) + .column('Laudantium', 11, [clc.cyan]) + .fill() + .store(); + +for (let l = 0; l < 20; l++) { + new Line(outputBuffer) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 11) + .fill() + .store(); +} + +outputBuffer.output(); + +// Line +new Line() + .padding(2) + .column('Column One', 20, [clc.cyan]) + .column('Column Two', 20, [clc.cyan]) + .column('Column Three', 20, [clc.cyan]) + .column('Column Four', 20, [clc.cyan]) + .fill() + .output(); + +new Line() + .padding(2) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .column((Math.random() * 100).toFixed(3), 20) + .fill() + .output(); + +// Gauge +const total = 33660133376; +const free = 17763860480; +const used = total - free; +const human = Math.ceil(used / 1000000) + ' MB'; + +console.log(Gauge(used, total, 20, total * 0.8, human)); + +// Sparkline +const reqsPerSec = [10, 12, 3, 7, 12, 9, 23, 10, 9, 19, 16, 18, 12, 12]; + +console.log(Sparkline(reqsPerSec, 'reqs/sec')); + +// Progress +const thisProgressBar = new Progress(20); +console.log(thisProgressBar.update(10, 30)); + +// or + +const thisPercentBar = new Progress(20); +console.log(thisPercentBar.update(0.4)); + +// Spinner +const countdown = new Spinner('Exiting in 10 seconds... ', ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷']); + +countdown.start(); + +let n = 10; +const interval = setInterval(() => { + n--; + countdown.message(`Exiting in ${n} seconds...`); + if (n === 0) { + console.log('\n'); + countdown.stop(); + clearInterval(interval); + } +}, 1000); diff --git a/types/clui/index.d.ts b/types/clui/index.d.ts new file mode 100644 index 0000000000..339ac031d9 --- /dev/null +++ b/types/clui/index.d.ts @@ -0,0 +1,157 @@ +// Type definitions for clui 0.3 +// Project: https://github.com/nathanpeck/clui#readme +// Definitions by: Farzad Majidfayyaz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as clc from 'cli-color'; + +export interface LineBufferOptions { + x?: number; + y?: number; + width?: number | 'console'; + height?: number | 'console'; + scroll?: number; +} + +export class LineBuffer { + /** + * Creates an object for buffering a group of text lines and then outputting them + * @param options Values to build the buffer + */ + constructor(options: LineBufferOptions); + + /** + * Return the height of the `LineBuffer`, when specified as `console` + */ + height(): number; + + /** + * Return the width of the `LineBuffer`, when specified as `console` + */ + width(): number; + + /** + * Put a `Line` object into the `LineBuffer` + * @param line The line object to put into the buffer + */ + addLine(line: Line): void; + + /** + * If you don't have enough lines in the buffer, this will fill the reset of + * the lines with empty spaces + */ + fill(): void; + + /** + * Draw the `LineBuffer` to screen + */ + output(): void; +} + +/** + * This chainable object can be used to generate a line of text with columns, padding, and fill + */ +export class Line { + /** + * Create a new instance of Line object + * @param buffer Object to be used as buffer + */ + constructor(buffer?: LineBuffer); + + /** + * Output `width` characters of blank space + * @param width Number of characters to print + */ + padding(width: number): Line; + + /** + * Output text within a column of the specified width + * @param text Text to print + * @param width Width of the column + * @param styles List of `cli-color` styles to apply + */ + column(text: string, width: number, styles?: clc.Format[]): Line; + + /** + * At the end of a line, fill the rest of the columns to the right edge + */ + fill(): Line; + + /** + * Print the generated line of text to the console + */ + output(): Line; + + /** + * Return the contents of this line as a string + */ + contents(): string; + + /** + * Store this line into the buffer + */ + store(): void; +} + +/** + * Creates a basic horizontal gauge to the screen + * @param value The current value of the metric being displayed by this gauge + * @param maxValue The highest possible value of the metric being displayed + * @param guageWidth How many columns widt to draw the gauge + * @param dangerZone The point after which the value will be drawn in red because it's too high + * @param suffix A value to output after the gauge itself + */ +export function Gauge( + value: number, + maxValue: number, + guageWidth: number, + dangerZone: number, + suffix: string, +): string; + +/** + * A simple command line sparkline that draws a series of values, and highlights the peak for the period + * @param values An array of values to go into the sparkline + * @param suffix A suffix to use when drawing the current and max values at the end of the sparkline + */ +export function Sparkline(values: number[], suffix: string): string; + +export class Progress { + /** + * Creates a progress bar + * @param length The desired length of the progress bar in characters + */ + constructor(length: number); + + /** + * Returns the progress bar min/max context to write to stdout + * @param currentValueOrPercent Current value (or percent) of the progress bar + * @param maxValue Maximum value of the progress bar + */ + update(currentValueOrPercent: number, maxValue?: number): string; +} + +export class Spinner { + /** + * Creates a new spinner + * @param statusText The default text to display while the spinner is spinning + * @param style Array of graphical characters used to draw the spinner + */ + constructor(statusText: string, style?: string[]); + + /** + * Show the spinner on the screen + */ + start(): void; + + /** + * Update the status message that follows the spinner + * @param statusMessage Message to be displayed + */ + message(statusMessage: string): void; + + /** + * Erase the spinner from the screen + */ + stop(): void; +} diff --git a/types/clui/tsconfig.json b/types/clui/tsconfig.json new file mode 100644 index 0000000000..05235b1de8 --- /dev/null +++ b/types/clui/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "clui-tests.ts" + ] +} diff --git a/types/decompress-response/tslint.json b/types/clui/tslint.json similarity index 100% rename from types/decompress-response/tslint.json rename to types/clui/tslint.json diff --git a/types/co-body/tslint.json b/types/co-body/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/co-body/tslint.json +++ b/types/co-body/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/codemirror/codemirror-showhint.d.ts b/types/codemirror/codemirror-showhint.d.ts index dfbbcdc4e1..524d427914 100644 --- a/types/codemirror/codemirror-showhint.d.ts +++ b/types/codemirror/codemirror-showhint.d.ts @@ -10,8 +10,6 @@ import * as CodeMirror from "codemirror"; declare module "codemirror" { - var commands: any; - /** Provides a framework for showing autocompletion hints. Defines editor.showHint, which takes an optional options object, and pops up a widget that allows the user to select a completion. Finding hints is done with a hinting functions (the hint option), which is a function that take an editor instance and options object, diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index 730e35b3f0..6acbabd2c1 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -1222,6 +1222,153 @@ declare namespace CodeMirror { */ function overlayMode(base: Mode, overlay: Mode, combine?: boolean): Mode; + interface CommandActions { + /** Select the whole content of the editor. */ + selectAll(cm: CodeMirror.Editor): void; + + /** When multiple selections are present, this deselects all but the primary selection. */ + singleSelection(cm: CodeMirror.Editor): void; + + /** Emacs-style line killing. Deletes the part of the line after the cursor. If that consists only of whitespace, the newline at the end of the line is also deleted. */ + killLine(cm: CodeMirror.Editor): void; + + /** Deletes the whole line under the cursor, including newline at the end. */ + deleteLine(cm: CodeMirror.Editor): void; + + /** Delete the part of the line before the cursor. */ + delLineLeft(cm: CodeMirror.Editor): void; + + /** Delete the part of the line from the left side of the visual line the cursor is on to the cursor. */ + delWrappedLineLeft(cm: CodeMirror.Editor): void; + + /** Delete the part of the line from the cursor to the right side of the visual line the cursor is on. */ + delWrappedLineRight(cm: CodeMirror.Editor): void; + + /** Undo the last change. Note that, because browsers still don't make it possible for scripts to react to or customize the context menu, selecting undo (or redo) from the context menu in a CodeMirror instance does not work. */ + undo(cm: CodeMirror.Editor): void; + + /** Redo the last undone change. */ + redo(cm: CodeMirror.Editor): void; + + /** Undo the last change to the selection, or if there are no selection-only changes at the top of the history, undo the last change. */ + undoSelection(cm: CodeMirror.Editor): void; + + /** Redo the last change to the selection, or the last text change if no selection changes remain. */ + redoSelection(cm: CodeMirror.Editor): void; + + /** Move the cursor to the start of the document. */ + goDocStart(cm: CodeMirror.Editor): void; + + /** Move the cursor to the end of the document. */ + goDocEnd(cm: CodeMirror.Editor): void; + + /** Move the cursor to the start of the line. */ + goLineStart(cm: CodeMirror.Editor): void; + + /** Move to the start of the text on the line, or if we are already there, to the actual start of the line (including whitespace). */ + goLineStartSmart(cm: CodeMirror.Editor): void; + + /** Move the cursor to the end of the line. */ + goLineEnd(cm: CodeMirror.Editor): void; + + /** Move the cursor to the right side of the visual line it is on. */ + goLineRight(cm: CodeMirror.Editor): void; + + /** Move the cursor to the left side of the visual line it is on. If this line is wrapped, that may not be the start of the line. */ + goLineLeft(cm: CodeMirror.Editor): void; + + /** Move the cursor to the left side of the visual line it is on. If that takes it to the start of the line, behave like goLineStartSmart. */ + goLineLeftSmart(cm: CodeMirror.Editor): void; + + /** Move the cursor up one line. */ + goLineUp(cm: CodeMirror.Editor): void; + + /** Move down one line. */ + goLineDown(cm: CodeMirror.Editor): void; + + /** Move the cursor up one screen, and scroll up by the same distance. */ + goPageUp(cm: CodeMirror.Editor): void; + + /** Move the cursor down one screen, and scroll down by the same distance. */ + goPageDown(cm: CodeMirror.Editor): void; + + /** Move the cursor one character left, going to the previous line when hitting the start of line. */ + goCharLeft(cm: CodeMirror.Editor): void; + + /** Move the cursor one character right, going to the next line when hitting the end of line. */ + goCharRight(cm: CodeMirror.Editor): void; + + /** Move the cursor one character left, but don't cross line boundaries. */ + goColumnLeft(cm: CodeMirror.Editor): void; + + /** Move the cursor one character right, don't cross line boundaries. */ + goColumnRight(cm: CodeMirror.Editor): void; + + /** Move the cursor to the start of the previous word. */ + goWordLeft(cm: CodeMirror.Editor): void; + + /** Move the cursor to the end of the next word. */ + goWordRight(cm: CodeMirror.Editor): void; + + /** Move to the left of the group before the cursor. A group is a stretch of word characters, a stretch of punctuation characters, a newline, or a stretch of more than one whitespace character. */ + goGroupLeft(cm: CodeMirror.Editor): void; + + /** Move to the right of the group after the cursor (see above). */ + goGroupRight(cm: CodeMirror.Editor): void; + + /** Delete the character before the cursor. */ + delCharBefore(cm: CodeMirror.Editor): void; + + /** Delete the character after the cursor. */ + delCharAfter(cm: CodeMirror.Editor): void; + + /** Delete up to the start of the word before the cursor. */ + delWordBefore(cm: CodeMirror.Editor): void; + + /** Delete up to the end of the word after the cursor. */ + delWordAfter(cm: CodeMirror.Editor): void; + + /** Delete to the left of the group before the cursor. */ + delGroupBefore(cm: CodeMirror.Editor): void; + + /** Delete to the start of the group after the cursor. */ + delGroupAfter(cm: CodeMirror.Editor): void; + + /** Auto-indent the current line or selection. */ + indentAuto(cm: CodeMirror.Editor): void; + + /** Indent the current line or selection by one indent unit. */ + indentMore(cm: CodeMirror.Editor): void; + + /** Dedent the current line or selection by one indent unit. */ + indentLess(cm: CodeMirror.Editor): void; + + /** Insert a tab character at the cursor. */ + insertTab(cm: CodeMirror.Editor): void; + + /** Insert the amount of spaces that match the width a tab at the cursor position would have. */ + insertSoftTab(cm: CodeMirror.Editor): void; + + /** If something is selected, indent it by one indent unit. If nothing is selected, insert a tab character. */ + defaultTabTab(cm: CodeMirror.Editor): void; + + /** Swap the characters before and after the cursor. */ + transposeChars(cm: CodeMirror.Editor): void; + + /** Insert a newline and auto-indent the new line. */ + newlineAndIndent(cm: CodeMirror.Editor): void; + + /** Flip the overwrite flag. */ + toggleOverwrite(cm: CodeMirror.Editor): void; + } + + /** + * Commands are parameter-less actions that can be performed on an editor. + * Their main use is for key bindings. + * Commands are defined by adding properties to the CodeMirror.commands object. + */ + var commands: CommandActions; + /** * async specifies that the lint process runs asynchronously. hasGutters specifies that lint errors should be displayed in the CodeMirror * gutter, note that you must use this in conjunction with [ "CodeMirror-lint-markers" ] as an element in the gutters argument on diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts index 851e891e8f..c9ccd13b29 100644 --- a/types/codemirror/test/index.ts +++ b/types/codemirror/test/index.ts @@ -100,3 +100,5 @@ widget1.clear(); widget2.clear(); htmlElement1.remove(); htmlElement2.remove(); + +CodeMirror.commands.newlineAndIndent(myCodeMirror); diff --git a/types/codemirror/tslint.json b/types/codemirror/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/codemirror/tslint.json +++ b/types/codemirror/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/coffeeify/tslint.json b/types/coffeeify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/coffeeify/tslint.json +++ b/types/coffeeify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 82fc32a7d3..891361627f 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -878,7 +878,7 @@ export class Buy implements Resource { /** * Associated transaction (e.g. a bank, fiat account) */ - transaction: ResourceRef; + transaction: ResourceRef | null; /** * Amount in bitcoin, litecoin or ethereum @@ -896,7 +896,7 @@ export class Buy implements Resource { subtotal: MoneyHash; /** - * Fee associated to this buy + * Fees associated to this buy */ fees: Fee[]; @@ -935,6 +935,26 @@ export class Buy implements Resource { */ requires_completion_step: boolean; + /** + * Transfer identifier + */ + id: string; + + /** + * Reference code shown in user's dashboard. + */ + user_reference: string; + + /** + * ISO timestamp + */ + created_at: string; + + /** + * ISO timestamp + */ + updated_at: string; + /** * 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 @@ -995,7 +1015,7 @@ export class Sell implements Resource { /** * Associated transaction (e.g. a bank, fiat account) */ - transaction: ResourceRef; + transaction: ResourceRef | null; /** * Amount in bitcoin, litecoin or ethereum @@ -1013,9 +1033,9 @@ export class Sell implements Resource { subtotal: MoneyHash; /** - * Fee associated to this sell + * Fees associated to this sell */ - fee: MoneyHash; + fees: MoneyHash[]; /** * Has this sell been committed? @@ -1032,6 +1052,26 @@ export class Sell implements Resource { */ payout_at?: string; + /** + * Transfer identifier + */ + id: string; + + /** + * Reference code shown in user's dashboard. + */ + user_reference: string; + + /** + * ISO timestamp + */ + created_at: string; + + /** + * ISO timestamp + */ + updated_at: string; + /** * Completes a sell that is created in commit: false state. * If the exchange rate has changed since the sell was created, this call will fail with the error “The exchange rate updated while you diff --git a/types/collections/tslint.json b/types/collections/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/collections/tslint.json +++ b/types/collections/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/collectionsjs/collectionsjs-tests.ts b/types/collectionsjs/collectionsjs-tests.ts new file mode 100644 index 0000000000..47ab0b00bb --- /dev/null +++ b/types/collectionsjs/collectionsjs-tests.ts @@ -0,0 +1,61 @@ +import Collection from 'collectionsjs'; + +const collectable = [ + { name: 'Arya Stark', age: 9 }, + { name: 'Bran Stark', age: 7 }, + { name: 'Jon Snow', age: 14 } +]; + +const characters = [ + { name: 'Ned Stark', age: 40}, + { name: 'Catelyn Stark', age: 35} +]; + +const item = { name: 'Sansa Stark', age: 13 }; + +const array = [ + { name: 'Robert Baratheon', age: 40 }, + { name: 'Joffrey Baratheon', age: 13 } +]; + +const collection = new Collection(collectable); // $ExpectType Collection<{ name: string; age: number; }> + +collection.add(item); // $ExpectType Collection<{ name: string; age: number; }> +collection.all(); // $ExpectType Collection<{ name: string; age: number; }> +collection.average('age'); // $ExpectType number +collection.chunk(2).all(); // $ExpectType Collection<{ name: string; age: number; }> +collection.collect(collectable); // $ExpectType Collection<{ name: string; age: number; }> +collection.concat(characters); // $ExpectType Collection<{ name: string; age: number; }> +collection.contains(stark => stark.name === 'John Snow'); // $ExpectType boolean +collection.count(); // $ExpectType number +collection.each(stark => stark.age = 3); // $ExpectType Collection<{ name: string; age: number; }> +collection.filter(stark => stark.age === 14); // $ExpectType Collection<{ name: string; age: number; }> +collection.find({ name: 'Bran Stark', age: 7 }); // $ExpectType number +collection.first(item => item.age > 7); // $ExpectType { name: string; age: number; } +collection.flatten(true); // $ExpectType Collection<{ name: string; age: number; }> +collection.get(2); // $ExpectType { name: string; age: number; } +collection.has({ name: 'Bran Stark', age: 7 }); // $ExpectType boolean +collection.join(); // $ExpectType string +collection.keys(); // $ExpectType Collection<{ name: string; age: number; }> +collection.last(); // $ExpectType { name: string; age: number; } +collection.map(stark => stark.name); // $ExpectType Collection +collection.pluck('name'); // $ExpectType Collection<{ name: string; age: number; }> +collection.push({name: 'Robb Stark', age: 17}); // $ExpectType Collection<{ name: string; age: number; }> +const value = new Collection([1, 2, 3]).reduce((previous, current) => previous + current, 0); // $ExpectType number +collection.reject(stark => stark.age < 14); // $ExpectType Collection<{ name: string; age: number; }> +collection.remove({name: 'Robb Stark', age: 17}); // $ExpectType boolean +collection.reverse(); // $ExpectType Collection<{ name: string; age: number; }> +collection.skip(2); // $ExpectType Collection<{ name: string; age: number; }> +collection.slice(1, 3); // $ExpectType Collection<{ name: string; age: number; }> +collection.sort(); // $ExpectType Collection<{ name: string; age: number; }> +collection.sortBy('name'); // $ExpectType Collection<{ name: string; age: number; }> +collection.stringify(); // $ExpectType string +collection.sum('age'); // $ExpectType number +collection.take(2); // $ExpectType Collection<{ name: string; age: number; }> +Collection.macro('addToMembers', (collection, n) => collection.map((collectionItem: any) => collectionItem + n)); + +collection.unique(stark => stark.age); // $ExpectType Collection<{ name: string; age: number; }> +collection.values(); // $ExpectType Collection<{ name: string; age: number; }> +collection.where('age', 14); // $ExpectType Collection<{ name: string; age: number; }> +collection.where(stark => stark.age === 14); // $ExpectType Collection<{ name: string; age: number; }> +collection.zip(array); // $ExpectType Collection<{ name: string; age: number; }> diff --git a/types/collectionsjs/index.d.ts b/types/collectionsjs/index.d.ts new file mode 100644 index 0000000000..1a9bfe7062 --- /dev/null +++ b/types/collectionsjs/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for collectionsjs 0.3 +// Project: https://github.com/logaretm/collectionsjs#readme +// Definitions by: Jaymeh +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.1 + +export default class Collection { + constructor(items?: T[]); + add(item: T): Collection; + all(): Collection; + average(property?: string | ((property?: number) => number)): number; + chunk(size: number): Collection; + collect(collectable: T[]): Collection; + concat(collection: T[]|Collection): Collection; + contains(closure: ((item: T) => boolean)): boolean; + count(): number; + each(callback: (item: T) => void): Collection; + filter(callback: (item: T) => boolean): Collection; + find(item: T): number; + first(callback?: ((item: T) => boolean)|null): T; + flatten(deep?: boolean): Collection; + get(index: number): T; + has(item: T): boolean; + join(separator?: string): string; + keys(): Collection; + last(callback?: ((item: T) => boolean)|null): T; + map(callback: (item: T) => R): Collection; + pluck(property: string): Collection; + push(item: T): Collection; + reduce(callback: (previous: R, current: T) => R, initial: R): R; + reject(callback: (item: T) => boolean): Collection; + remove(item: T): boolean; + reverse(): Collection; + skip(count: number): Collection; + slice(start: number, end?: number): Collection; + sort(compare?: () => boolean): Collection; + sortBy(property: string, order?: string): Collection; + stringify(): string; + sum(property: T extends object ? keyof T : never): number; + take(count: number): Collection; + static macro(name: string, callback: (coll: Collection, ...args: unknown[]) => unknown): void; + unique(callback?: string|null|((item: T) => any)): Collection; + values(): Collection; + where(key: K, value: T[K]): Collection; + where(callback: (item: T) => boolean): Collection; + zip(array: T[]|Collection): Collection; +} diff --git a/types/collectionsjs/tsconfig.json b/types/collectionsjs/tsconfig.json new file mode 100644 index 0000000000..6ec4a9edc3 --- /dev/null +++ b/types/collectionsjs/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "collectionsjs-tests.ts" + ] +} diff --git a/types/dom-loaded/tslint.json b/types/collectionsjs/tslint.json similarity index 100% rename from types/dom-loaded/tslint.json rename to types/collectionsjs/tslint.json diff --git a/types/colorbrewer/tslint.json b/types/colorbrewer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/colorbrewer/tslint.json +++ b/types/colorbrewer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/com.darktalker.cordova.screenshot/tslint.json b/types/com.darktalker.cordova.screenshot/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/com.darktalker.cordova.screenshot/tslint.json +++ b/types/com.darktalker.cordova.screenshot/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/combokeys/tslint.json b/types/combokeys/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/combokeys/tslint.json +++ b/types/combokeys/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cometd/index.d.ts b/types/cometd/index.d.ts index d7103f15cd..ff780cfd42 100644 --- a/types/cometd/index.d.ts +++ b/types/cometd/index.d.ts @@ -70,6 +70,15 @@ export interface Configuration { * CometD may fail to remain within the max URI length when encoded in JSON. */ maxURILength?: number; + /** + * Uses the scheduler service available in Web Workers via Worker.setTimeout(fn, delay) rather + * than using that available via Window.setTimeout(fn, delay). Browsers are now throttling the + * Window scheduler in background tabs to save battery in mobile devices, so the Window scheduler + * events are delayed by possibly several seconds, causing CometD sessions to timeout on the + * server. The Worker scheduler is not throttled and guarantees that scheduler events happen + * on time. + */ + useWorkerScheduler?: boolean; } export interface Message { diff --git a/types/command-line-commands/tslint.json b/types/command-line-commands/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/command-line-commands/tslint.json +++ b/types/command-line-commands/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/commangular/tslint.json b/types/commangular/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/commangular/tslint.json +++ b/types/commangular/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compare-version/tslint.json b/types/compare-version/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compare-version/tslint.json +++ b/types/compare-version/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/complex.js/complex.js-tests.ts b/types/complex.js/complex.js-tests.ts new file mode 100644 index 0000000000..0edef20998 --- /dev/null +++ b/types/complex.js/complex.js-tests.ts @@ -0,0 +1,61 @@ +import Complex from "complex.js"; + +Complex.ZERO; +Complex.PI; +Complex.E; +Complex.I; +Complex.INFINITY; +Complex.EPSILON; +Complex.ONE; +Complex.NAN; + +new Complex(1, 0); +new Complex(1, 0).abs(); +new Complex(1, 0).acos(); +new Complex(1, 0).acot(); +new Complex(1, 0).acoth(); +new Complex(1, 0).acsc(); +new Complex(1, 0).acsch(); +new Complex(1, 0).add(1, 2); +new Complex(1, 0).arg(); +new Complex(1, 0).asec(); +new Complex(1, 0).asech(); +new Complex(1, 0).asin(); +new Complex(1, 0).asinh(); +new Complex(1, 0).atan(); +new Complex(1, 0).atanh(); +new Complex(1, 0).ceil(5); +new Complex(1, 0).clone(); +new Complex(1, 0).conjugate(); +new Complex(1, 0).cos(); +new Complex(1, 0).cosh(); +new Complex(1, 0).cot(); +new Complex(1, 0).coth(); +new Complex(1, 0).csc(); +new Complex(1, 0).csch(); +new Complex(1, 0).div(3, 1); +new Complex(1, 0).equals(5, 3); +new Complex(1, 0).exp(); +new Complex(1, 0).floor(6); +new Complex(1, 0).inverse(); +new Complex(1, 0).isFinite(); +new Complex(1, 0).isInfinite(); +new Complex(1, 0).isNaN(); +new Complex(1, 0).isZero(); +new Complex(1, 0).log(); +new Complex(1, 0).mul(3, 1); +new Complex(1, 0).neg(); +new Complex(1, 0).pow(1, 2); +new Complex(1, 0).round(3); +new Complex(1, 0).sec(); +new Complex(1, 0).sech(); +new Complex(1, 0).sign(); +new Complex(1, 0).sin(); +new Complex(1, 0).sinh(); +new Complex(1, 0).sqrt(); +new Complex(1, 0).sub(5, 1); +new Complex(1, 0).tan(); +new Complex(1, 0).tanh(); +new Complex(1, 0).toString(); +new Complex(1, 0).toVector(); +new Complex(1, 0).valueOf(); diff --git a/types/complex.js/index.d.ts b/types/complex.js/index.d.ts new file mode 100644 index 0000000000..487fc4e30d --- /dev/null +++ b/types/complex.js/index.d.ts @@ -0,0 +1,304 @@ +// Type definitions for complex.js 2.0 +// Project: https://github.com/infusion/Complex.js +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Complex { + /** + * A complex zero value (south pole on the Riemann Sphere). + */ + static ZERO: Complex; + + /** + * A complex one instance. + */ + static ONE: Complex; + + /** + * A complex infinity value (north pole on the Riemann Sphere). + */ + static INFINITY: Complex; + + /** + * A complex NaN value (not on the Riemann Sphere). + */ + static NAN: Complex; + + /** + * An imaginary number i instance. + */ + static I: Complex; + + /** + * A complex PI instance. + */ + static PI: Complex; + + /** + * A complex euler number instance. + */ + static E: Complex; + + /** + * A small epsilon value used for equals() comparison in order to circumvent double inprecision. + */ + static EPSILON: number; + + constructor(x: number, y: number); + + /** + * Returns the complex sign, defined as the complex number + * normalized by it's absolute value. + */ + sign(): Complex; + + /** + * Adds another complex number. + */ + add(a: number, b: number): Complex; + + /** + * Subtracts another complex number. + */ + sub(a: number, b: number): Complex; + + /** + * Multiplies the number with another complex number. + */ + mul(a: number, b: number): Complex; + + /** + * Divides the number by another complex number. + */ + div(a: number, b: number): Complex; + + /** + * Returns the number raised to the complex exponent. + */ + pow(a: number, b: number): Complex; + + /** + * Returns the complex square root of the number. + */ + sqrt(): Complex; + + /** + * Returns e^n with complex exponent n + */ + exp(): Complex; + + /** + * Returns the natural logarithm (base E) of the actual complex number. + */ + log(): Complex; + + /** + * Calculates the magnitude of the complex number. + */ + abs(): number; + + /** + * Calculate the angle of the complex number. + */ + arg(): number; + + /** + * Calculates the multiplicative inverse of the complex number (1 / z). + */ + inverse(): Complex; + + /** + * Calculates the conjugate of the complex number (multiplies the imaginary part with -1). + */ + conjugate(): Complex; + + /** + * Negates the number (multiplies both the real and imaginary part with -1) in order to get the additive inverse. + */ + neg(): Complex; + + /** + * Floors the complex number parts towards zero. + */ + floor(places: number): Complex; + + /** + * Ceils the complex number parts off zero. + */ + ceil(places: number): Complex; + + /** + * Rounds the complex number parts. + */ + round(places: number): Complex; + + /** + * Checks if both numbers are exactly the same, + * if both numbers are infinite they are considered not equal. + */ + equals(a: number, b: number): boolean; + + /** + * Checks if the given number is not a number. + */ + isNaN(): boolean; + + /** + * Determines whether or not a complex number is at the zero pole of the + * Riemann sphere. + */ + isZero(): boolean; + + /** + * Checks if the given number is finite. + */ + isFinite(): boolean; + + /** + * Determines whether or not a complex number is at the infinity pole of the + * Riemann sphere. + */ + isInfinite(): boolean; + + /** + * Returns a new Complex instance with the same real and imaginary properties. + */ + clone(): Complex; + + /** + * Returns a Vector of the actual complex number with two components. + */ + toVector(): number[]; + + /** + * Returns a string representation of the actual number. As of v1.9.0 the output is a bit more human readable. + */ + toString(): string; + + /** + * Returns the real part of the number if imaginary part is zero. Otherwise null. + */ + valueOf(): number|undefined; + + /** + * Calculate the sine of the complex number. + */ + sin(): Complex; + + /** + * Calculate the complex arcus sinus. + */ + asin(): Complex; + + /** + * Calculate the complex sinh. + */ + sinh(): Complex; + + /** + * Calculate the complex asinh. + */ + asinh(): Complex; + + /** + * Calculate the cosine. + */ + cos(): Complex; + + /** + * Calculate the complex arcus cosinus. + */ + acos(): Complex; + + /** + * Calculate the complex cosh. + */ + cosh(): Complex; + + /** + * Calculate the complex asinh. + */ + acosh(): Complex; + + /** + * Calculate the tangent. + */ + tan(): Complex; + + /** + * Calculate the complex arcus tangent. + */ + atan(): Complex; + + /** + * Calculate the complex tanh. + */ + tanh(): Complex; + + /** + * Calculate the complex atanh. + */ + atanh(): Complex; + + /** + * Calculate the cotangent. + */ + cot(): Complex; + + /** + * Calculate the complex arcus cotangent. + */ + acot(): Complex; + + /** + * Calculate the complex coth. + */ + coth(): Complex; + + /** + * Calculate the complex acoth. + */ + acoth(): Complex; + + /** + * Calculate the secant. + */ + sec(): Complex; + + /** + * Calculate the complex arcus secant. + */ + asec(): Complex; + + /** + * Calculate the complex sech. + */ + sech(): Complex; + + /** + * Calculate the complex asech. + */ + asech(): Complex; + + /** + * Calculate the cosecans. + */ + csc(): Complex; + + /** + * Calculate the complex arcus cosecans. + */ + acsc(): Complex; + + /** + * Calculate the complex csch. + */ + csch(): Complex; + + /** + * Calculate the complex acsch. + */ + acsch(): Complex; +} + +export default Complex; diff --git a/types/complex.js/tsconfig.json b/types/complex.js/tsconfig.json new file mode 100644 index 0000000000..b4af58b032 --- /dev/null +++ b/types/complex.js/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "complex.js-tests.ts" + ] +} diff --git a/types/complex.js/tslint.json b/types/complex.js/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/complex.js/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/complex/complex-tests.ts b/types/complex/complex-tests.ts index 8268f0c135..7979c80435 100644 --- a/types/complex/complex-tests.ts +++ b/types/complex/complex-tests.ts @@ -1,4 +1,4 @@ -import Complex from 'complex'; +import Complex = require('complex'); let z: Complex = new Complex(2, 3); z = Complex.from(2, 3); diff --git a/types/complex/index.d.ts b/types/complex/index.d.ts index 3f44ba8e1e..4b3ad612e1 100644 --- a/types/complex/index.d.ts +++ b/types/complex/index.d.ts @@ -4,7 +4,8 @@ // Paul Vasich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export default class Complex { +export = Complex; +declare class Complex { /** * @param real The real part of the number * @param im The imaginary part of the number diff --git a/types/component-emitter/tslint.json b/types/component-emitter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/component-emitter/tslint.json +++ b/types/component-emitter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compose-function/tslint.json b/types/compose-function/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compose-function/tslint.json +++ b/types/compose-function/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/compression/tslint.json b/types/compression/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/compression/tslint.json +++ b/types/compression/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/concaveman/tslint.json b/types/concaveman/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/concaveman/tslint.json +++ b/types/concaveman/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/condense-whitespace/condense-whitespace-tests.ts b/types/condense-whitespace/condense-whitespace-tests.ts new file mode 100644 index 0000000000..027b106195 --- /dev/null +++ b/types/condense-whitespace/condense-whitespace-tests.ts @@ -0,0 +1,7 @@ +import condense = require("condense-whitespace"); + +// $ExpectType string +condense(" \n\n\t Hello World \t\n"); + +// $ExpectError +condense(1); diff --git a/types/condense-whitespace/index.d.ts b/types/condense-whitespace/index.d.ts new file mode 100644 index 0000000000..403d0eeec1 --- /dev/null +++ b/types/condense-whitespace/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for condense-whitespace 1.0 +// Project: https://github.com/sindresorhus/condense-whitespace +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function condenseWhitespace(str: string): string; + +export = condenseWhitespace; diff --git a/types/decompress-response/tsconfig.json b/types/condense-whitespace/tsconfig.json similarity index 92% rename from types/decompress-response/tsconfig.json rename to types/condense-whitespace/tsconfig.json index c7a77a9fd1..8d5705205d 100644 --- a/types/decompress-response/tsconfig.json +++ b/types/condense-whitespace/tsconfig.json @@ -6,8 +6,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, "strictFunctionTypes": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "decompress-response-tests.ts" + "condense-whitespace-tests.ts" ] } diff --git a/types/element-ready/tslint.json b/types/condense-whitespace/tslint.json similarity index 100% rename from types/element-ready/tslint.json rename to types/condense-whitespace/tslint.json diff --git a/types/conf/conf-tests.ts b/types/conf/conf-tests.ts deleted file mode 100644 index ce67cd4799..0000000000 --- a/types/conf/conf-tests.ts +++ /dev/null @@ -1,54 +0,0 @@ -import Conf = require('conf'); - -const conf = new Conf(); -new Conf({ - defaults: { - foo: 'bar', - unicorn: 'rainbow', - }, -}); -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'], - }, -}); -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.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', -}; -conf.path; // $ExpectType string - -for (const [key, value] of conf) { - key; // $ExpectType string - value; // $ExpectType string | number | boolean -} diff --git a/types/conf/index.d.ts b/types/conf/index.d.ts deleted file mode 100644 index 57d7285a3e..0000000000 --- a/types/conf/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// 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 - -/// - -declare class Conf implements Iterable<[string, T]> { - store: { [key: string]: T }; - readonly path: string; - readonly size: number; - - 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/v0/conf-tests.ts b/types/conf/v0/conf-tests.ts deleted file mode 100644 index 1368e45c29..0000000000 --- a/types/conf/v0/conf-tests.ts +++ /dev/null @@ -1,20 +0,0 @@ -import Conf = require('conf'); - -const conf = new Conf(); -conf.set('foo', 'bar'); -conf.set('hello', 1); -conf.set('unicorn', false); -conf.set('object', { - foo: 'bar', - unicorn: ['rainbow'] -}); - -conf.get('foo'); -conf.delete('foo'); -conf.has('foo'); -conf.clear(); - -for (const [key, value] of conf) { - key; // $ExpectType string - value; // $ExpectType string | number | boolean | symbol | {} -} diff --git a/types/conf/v0/index.d.ts b/types/conf/v0/index.d.ts deleted file mode 100644 index 21c136e823..0000000000 --- a/types/conf/v0/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for conf 0.11 -// Project: https://github.com/sindresorhus/conf -// Definitions by: Sam Verschueren -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Options { - defaults?: any; - configName?: string; - projectName?: string; - cwd?: string; -} - -declare class Conf implements Iterable<[string, string | number | boolean | symbol | {}]> { - path: string; - store: any; - - readonly size: number; - - constructor(options?: Options); - get(key: string): any; - set(key: string, val: string | number | boolean | symbol | {}): void; - set(object: {}): void; - has(key: string): boolean; - delete(key: string): void; - clear(): void; - [Symbol.iterator](): Iterator<[string, string | number | boolean | symbol | {}]>; -} - -export = Conf; diff --git a/types/conf/v1/conf-tests.ts b/types/conf/v1/conf-tests.ts deleted file mode 100644 index 4ee492da8d..0000000000 --- a/types/conf/v1/conf-tests.ts +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100644 index f08cff1584..0000000000 --- a/types/conf/v1/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -// 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/confidence/tslint.json b/types/confidence/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/confidence/tslint.json +++ b/types/confidence/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/config-yaml/index.d.ts b/types/config-yaml/index.d.ts index 6f2be7957b..2b4e07628d 100644 --- a/types/config-yaml/index.d.ts +++ b/types/config-yaml/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for config-yaml 1.1 // Project: https://github.com/neolao/config-yaml#readme -// Definitions by: My Self +// Definitions by: Arylo Yeung // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 diff --git a/types/config/tslint.json b/types/config/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/config/tslint.json +++ b/types/config/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/confit/tslint.json b/types/confit/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/confit/tslint.json +++ b/types/confit/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-datadog/index.d.ts b/types/connect-datadog/index.d.ts index df18c0c208..9b68fb6a4f 100644 --- a/types/connect-datadog/index.d.ts +++ b/types/connect-datadog/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for connect-datadog 0.0 // Project: https://github.com/datadog/node-connect-datadog // Definitions by: Moshe Good +// Michael Mifsud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -19,6 +20,6 @@ declare namespace Factory { method?: boolean; protocol?: boolean; response_code?: boolean; - dogstatsd?: dogstatsd.StatsD; + dogstatsd?: dogstatsd.StatsDClient; } } diff --git a/types/connect-flash/tslint.json b/types/connect-flash/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-flash/tslint.json +++ b/types/connect-flash/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-history-api-fallback/index.d.ts b/types/connect-history-api-fallback/index.d.ts index a39fbfdbd6..b32e61e147 100644 --- a/types/connect-history-api-fallback/index.d.ts +++ b/types/connect-history-api-fallback/index.d.ts @@ -10,26 +10,28 @@ import { Url } from 'url'; import * as core from "express-serve-static-core"; -declare function historyApiFallback(options?: Options): core.RequestHandler; -declare namespace historyApiFallback {} export = historyApiFallback; -interface Options { - disableDotRule?: true; - htmlAcceptHeaders?: string[]; - index?: string; - logger?: typeof console.log; - rewrites?: Rewrite[]; - verbose?: boolean; -} +declare function historyApiFallback(options?: historyApiFallback.Options): core.RequestHandler; -interface Context { - match: RegExpMatchArray; - parsedUrl: Url; -} -type RewriteTo = (context: Context) => string; +declare namespace historyApiFallback { + interface Options { + disableDotRule?: true; + htmlAcceptHeaders?: string[]; + index?: string; + logger?: typeof console.log; + rewrites?: Rewrite[]; + verbose?: boolean; + } -interface Rewrite { - from: RegExp; - to: string | RegExp | RewriteTo; + interface Context { + match: RegExpMatchArray; + parsedUrl: Url; + } + type RewriteTo = (context: Context) => string; + + interface Rewrite { + from: RegExp; + to: string | RegExp | RewriteTo; + } } diff --git a/types/connect-livereload/tslint.json b/types/connect-livereload/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-livereload/tslint.json +++ b/types/connect-livereload/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-modrewrite/tslint.json b/types/connect-modrewrite/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-modrewrite/tslint.json +++ b/types/connect-modrewrite/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-mongo/connect-mongo-tests.ts b/types/connect-mongo/connect-mongo-tests.ts index 351975d84c..4e3c7f8381 100644 --- a/types/connect-mongo/connect-mongo-tests.ts +++ b/types/connect-mongo/connect-mongo-tests.ts @@ -45,8 +45,8 @@ app.use(session({ // NativeMongoPromiseOptions var Client = mongodb.MongoClient; -var mongoDbPromise = Client.connect('mongodb://localhost/test'); +var mongoDbPromise = Client.connect('mongodb://localhost/test').then(client => client.db()) app.use(session({ secret: 'secret', - store: new MongoStore({ dbPromise: mongoDbPromise}) + store: new MongoStore({ dbPromise: mongoDbPromise }) })); diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index c0c9ab3043..dc0b76551d 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -4,14 +4,6 @@ "lib": [ "es6" ], - "paths": { - "mongodb": [ - "mongodb/v2" - ], - "mongoose": [ - "mongoose/v4" - ] - }, "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, diff --git a/types/connect-mongo/tslint.json b/types/connect-mongo/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-mongo/tslint.json +++ b/types/connect-mongo/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-mongodb-session/tslint.json b/types/connect-mongodb-session/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-mongodb-session/tslint.json +++ b/types/connect-mongodb-session/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-redis/connect-redis-tests.ts b/types/connect-redis/connect-redis-tests.ts index a312ffd3ca..603b226dcc 100644 --- a/types/connect-redis/connect-redis-tests.ts +++ b/types/connect-redis/connect-redis-tests.ts @@ -6,5 +6,8 @@ const store = new RedisStore({ host: 'localhost', port: 6379, logErrors: error => console.warn(error), - scanCount: 80, + scanCount: 80, + ttl: (store, sess, sessionID) => { + return 60; + } }); diff --git a/types/connect-redis/index.d.ts b/types/connect-redis/index.d.ts index c5a26de73a..9b56777ac3 100644 --- a/types/connect-redis/index.d.ts +++ b/types/connect-redis/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for connect-redis // Project: https://npmjs.com/package/connect-redis // Definitions by: Xavier Stouder +// Seth Butler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -26,7 +27,7 @@ declare module "connect-redis" { port?: number; socket?: string; url?: string; - ttl?: number; + ttl?: number | string | ((store: RedisStore, sess: Express.SessionData, sid: string) => number); disableTTL?: boolean; db?: number; pass?: string; diff --git a/types/connect-redis/tslint.json b/types/connect-redis/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-redis/tslint.json +++ b/types/connect-redis/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-slashes/tslint.json b/types/connect-slashes/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-slashes/tslint.json +++ b/types/connect-slashes/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect-timeout/tslint.json b/types/connect-timeout/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect-timeout/tslint.json +++ b/types/connect-timeout/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/connect/tslint.json b/types/connect/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/connect/tslint.json +++ b/types/connect/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/console-stamp/tslint.json b/types/console-stamp/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/console-stamp/tslint.json +++ b/types/console-stamp/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/consolidate/tslint.json b/types/consolidate/tslint.json index a403f5da2b..69c84d8f83 100644 --- a/types/consolidate/tslint.json +++ b/types/consolidate/tslint.json @@ -9,6 +9,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/consul/consul-tests.ts b/types/consul/consul-tests.ts index 988890766d..263b5beff5 100644 --- a/types/consul/consul-tests.ts +++ b/types/consul/consul-tests.ts @@ -511,6 +511,7 @@ consul = new Consul(); // Consul.Health { let health: Consul.Health = consul.health; + let name: string; health = new HealthStatic(consul); consul = health.consul; diff --git a/types/consul/tslint.json b/types/consul/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/consul/tslint.json +++ b/types/consul/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/contentful-resolve-response/tslint.json b/types/contentful-resolve-response/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/contentful-resolve-response/tslint.json +++ b/types/contentful-resolve-response/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/contextjs/tslint.json b/types/contextjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/contextjs/tslint.json +++ b/types/contextjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cookie-session/tslint.json b/types/cookie-session/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cookie-session/tslint.json +++ b/types/cookie-session/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cookie_js/tslint.json b/types/cookie_js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cookie_js/tslint.json +++ b/types/cookie_js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/copy-paste/tslint.json b/types/copy-paste/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/copy-paste/tslint.json +++ b/types/copy-paste/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/copy-text-to-clipboard/copy-text-to-clipboard-tests.ts b/types/copy-text-to-clipboard/copy-text-to-clipboard-tests.ts deleted file mode 100644 index 4a1e63b28c..0000000000 --- a/types/copy-text-to-clipboard/copy-text-to-clipboard-tests.ts +++ /dev/null @@ -1,8 +0,0 @@ -import copy = require('copy-text-to-clipboard'); - -const button: HTMLButtonElement | null = document.getElementById('my-button'); -if (button) { - button.addEventListener('click', () => { - copy('🦄🌈'); - }); -} diff --git a/types/copy-text-to-clipboard/index.d.ts b/types/copy-text-to-clipboard/index.d.ts deleted file mode 100644 index 56493778d0..0000000000 --- a/types/copy-text-to-clipboard/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Type definitions for copy-text-to-clipboard 1.0 -// Project: https://github.com/sindresorhus/copy-text-to-clipboard#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = copy; - -declare function copy(text: string): boolean; diff --git a/types/cordova-ionic/tslint.json b/types/cordova-ionic/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-ionic/tslint.json +++ b/types/cordova-ionic/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-app-version/tslint.json b/types/cordova-plugin-app-version/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-app-version/tslint.json +++ b/types/cordova-plugin-app-version/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-background-mode/tslint.json b/types/cordova-plugin-background-mode/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-background-mode/tslint.json +++ b/types/cordova-plugin-background-mode/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ble-central/tslint.json b/types/cordova-plugin-ble-central/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ble-central/tslint.json +++ b/types/cordova-plugin-ble-central/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-device-name/tslint.json b/types/cordova-plugin-device-name/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-device-name/tslint.json +++ b/types/cordova-plugin-device-name/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-email-composer/tslint.json b/types/cordova-plugin-email-composer/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-email-composer/tslint.json +++ b/types/cordova-plugin-email-composer/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ibeacon/tslint.json b/types/cordova-plugin-ibeacon/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ibeacon/tslint.json +++ b/types/cordova-plugin-ibeacon/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-insomnia/tslint.json b/types/cordova-plugin-insomnia/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-insomnia/tslint.json +++ b/types/cordova-plugin-insomnia/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-keyboard/tslint.json b/types/cordova-plugin-keyboard/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-keyboard/tslint.json +++ b/types/cordova-plugin-keyboard/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-mapsforge/tslint.json b/types/cordova-plugin-mapsforge/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-mapsforge/tslint.json +++ b/types/cordova-plugin-mapsforge/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ms-adal/tslint.json b/types/cordova-plugin-ms-adal/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ms-adal/tslint.json +++ b/types/cordova-plugin-ms-adal/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-ouralabs/tslint.json b/types/cordova-plugin-ouralabs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-ouralabs/tslint.json +++ b/types/cordova-plugin-ouralabs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-qrscanner/tslint.json b/types/cordova-plugin-qrscanner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-qrscanner/tslint.json +++ b/types/cordova-plugin-qrscanner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-spinner/tslint.json b/types/cordova-plugin-spinner/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-spinner/tslint.json +++ b/types/cordova-plugin-spinner/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-websql/tslint.json b/types/cordova-plugin-websql/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-websql/tslint.json +++ b/types/cordova-plugin-websql/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova-plugin-x-socialsharing/tslint.json b/types/cordova-plugin-x-socialsharing/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova-plugin-x-socialsharing/tslint.json +++ b/types/cordova-plugin-x-socialsharing/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova/tslint.json b/types/cordova/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/cordova/tslint.json +++ b/types/cordova/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordova_app_version_plugin/tslint.json b/types/cordova_app_version_plugin/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordova_app_version_plugin/tslint.json +++ b/types/cordova_app_version_plugin/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cordovarduino/tslint.json b/types/cordovarduino/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cordovarduino/tslint.json +++ b/types/cordovarduino/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/core-object/core-object-tests.ts b/types/core-object/core-object-tests.ts index b434ee97fc..dfdc0f4073 100644 --- a/types/core-object/core-object-tests.ts +++ b/types/core-object/core-object-tests.ts @@ -1,5 +1,5 @@ import { Mix, MethodNames } from 'core-object/-private/utils'; -import CoreObject, { ExtendOptions, ExtendThisType } from 'core-object'; +import CoreObject = require('core-object'); //////////// Mix //////////// @@ -24,14 +24,14 @@ names3; // $ExpectType "a" //////////// ExtendOptions //////////// -const extendOptions1: ExtendOptions<{}> = { a: 1, b: 'hi' }; -const extendOptions2: ExtendOptions<{ a: number }> = { b: 'hi' }; -const extendOptions3: ExtendOptions<{ a: number }> = { a: 5 }; -const extendOptions4: ExtendOptions<{ a: number }> = { a: 'hi' }; // $ExpectError +const extendOptions1: CoreObject.ExtendOptions<{}> = { a: 1, b: 'hi' }; +const extendOptions2: CoreObject.ExtendOptions<{ a: number }> = { b: 'hi' }; +const extendOptions3: CoreObject.ExtendOptions<{ a: number }> = { a: 5 }; +const extendOptions4: CoreObject.ExtendOptions<{ a: number }> = { a: 'hi' }; // $ExpectError //////////// ExtendThisType //////////// -declare function extendThisType1(options: T & ExtendThisType<{ prop: string; method: () => number }, T>): void; +declare function extendThisType1(options: T & CoreObject.ExtendThisType<{ prop: string; method: () => number }, T>): void; extendThisType1({ otherMethod() { this.prop; // $ExpectType string diff --git a/types/core-object/index.d.ts b/types/core-object/index.d.ts index aa4566cac2..7a6131bac4 100644 --- a/types/core-object/index.d.ts +++ b/types/core-object/index.d.ts @@ -6,18 +6,21 @@ import { Mix, Super, Constructor } from './-private/utils'; -/** The type of options allowed to be passed to `Base.extend()` */ -export type ExtendOptions = { [K in keyof Base]?: Base[K] } & Record; +declare namespace CoreObject { + /** The type of options allowed to be passed to `Base.extend()` */ + type ExtendOptions = { [K in keyof Base]?: Base[K] } & Record; -/** The `this` type for any methods on the options passed to `Base.extend()` */ -export type ExtendThisType = ThisType & { _super: Super }>; + /** The `this` type for any methods on the options passed to `Base.extend()` */ + type ExtendThisType = ThisType & { _super: Super }>; +} -export default class CoreObject { +declare class CoreObject { // TODO restrict to `Record` once we can restrict to 3.0+ on DT init(options?: Record): void; - static extend, Ext extends ExtendOptions>>( + static extend, Ext extends CoreObject.ExtendOptions>>( this: BaseClass, - options: Ext & ExtendThisType, Ext> + options: Ext & CoreObject.ExtendThisType, Ext> ): BaseClass & Constructor, Ext>>; } +export = CoreObject; diff --git a/types/cors/tslint.json b/types/cors/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cors/tslint.json +++ b/types/cors/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cote/cote-tests.ts b/types/cote/cote-tests.ts index 1851654625..d4af3ce95e 100644 --- a/types/cote/cote-tests.ts +++ b/types/cote/cote-tests.ts @@ -35,6 +35,7 @@ class Readme { }); const req = { + __subset: 'subset', type: 'randomRequest', payload: { val: Math.floor(Math.random() * 10) @@ -52,7 +53,8 @@ class Readme { name: 'Random Responder', namespace: 'rnd', key: 'a certain key', - respondsTo: ['randomRequest'] + respondsTo: ['randomRequest'], + subset: 'subset' }); interface RandomRequest { diff --git a/types/cote/index.d.ts b/types/cote/index.d.ts index 4c959af76b..93f5b7d63f 100644 --- a/types/cote/index.d.ts +++ b/types/cote/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cote 0.17 +// Type definitions for cote 0.19 // Project: https://github.com/dashersw/cote#readme // Definitions by: makepost // Labat Robin @@ -115,6 +115,11 @@ export interface ResponderAdvertisement extends Advertisement { * Request types that a Responder can listen to. */ respondsTo?: string[]; + + /** + * Advertisement attribute that lets you target a subgroup of responders using the __subset property of a request. + */ + subset?: string; } export class Publisher extends Component { diff --git a/types/couchbase/tslint.json b/types/couchbase/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/couchbase/tslint.json +++ b/types/couchbase/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/countdown/tslint.json b/types/countdown/tslint.json index d67ffb3a73..6c7fd03ccd 100644 --- a/types/countdown/tslint.json +++ b/types/countdown/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/counterpart/counterpart-tests.ts b/types/counterpart/counterpart-tests.ts index db9f1cf5d6..850b026ecf 100644 --- a/types/counterpart/counterpart-tests.ts +++ b/types/counterpart/counterpart-tests.ts @@ -2,6 +2,8 @@ import * as counterpart from 'counterpart'; counterpart('translation.to.be.used'); counterpart(['translation', 'to', 'be', 'used']); +counterpart.translate('translation.to.be.used'); +counterpart.translate(['translation', 'to', 'be', 'used']); counterpart.setSeparator('*'); diff --git a/types/counterpart/index.d.ts b/types/counterpart/index.d.ts index f09ad0708c..3fd0caeac7 100644 --- a/types/counterpart/index.d.ts +++ b/types/counterpart/index.d.ts @@ -9,6 +9,7 @@ type LocaleChangeHandler = (newLocale: string, oldLocale: string) => void; interface Counterpart { (key: string|string[], options?: object): string; + translate(key: string|string[], options?: object): string; setSeparator(value: string): string; onTranslationNotFound(callback: NotFoundHandler): void; diff --git a/types/countries-and-timezones/index.d.ts b/types/countries-and-timezones/index.d.ts index 1012133d8e..3a84ea3b76 100644 --- a/types/countries-and-timezones/index.d.ts +++ b/types/countries-and-timezones/index.d.ts @@ -16,9 +16,9 @@ export interface Timezone { countries: string[]; } -export function getAllCountries(): Country[]; +export function getAllCountries(): {[key: string]: Country}; -export function getAllTimezones(): Timezone[]; +export function getAllTimezones(): {[key: string]: Timezone}; export function getCountriesForTimezone(timezoneId: string): Country[]; diff --git a/types/cp-file/cp-file-tests.ts b/types/cp-file/cp-file-tests.ts deleted file mode 100644 index 173a650e8f..0000000000 --- a/types/cp-file/cp-file-tests.ts +++ /dev/null @@ -1,19 +0,0 @@ -import cpFile = require('cp-file'); - -cpFile('src/unicorn.png', 'dist/unicorn.png').then(() => {}); -cpFile('src/unicorn.png', 'dist/unicorn.png', {overwrite: false}).then(() => {}); -cpFile('src/unicorn.png', 'dist/unicorn.png') - .on('progress', data => { - let str: string; - let num: number; - - str = data.src; - str = data.dest; - num = data.size; - num = data.written; - num = data.percent; - }) - .then(() => {}); - -cpFile.sync('src/unicorn.png', 'dist/unicorn.png'); -cpFile.sync('src/unicorn.png', 'dist/unicorn.png', {overwrite: false}); diff --git a/types/cp-file/index.d.ts b/types/cp-file/index.d.ts deleted file mode 100644 index d0966f4c85..0000000000 --- a/types/cp-file/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Type definitions for cp-file 4.2 -// Project: https://github.com/sindresorhus/cp-file#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = cpFile; - -declare function cpFile(source: string, destination: string, options?: cpFile.Options): Promise & cpFile.ProgressEmitter; - -declare namespace cpFile { - function sync(source: string, destination: string, options?: Options): void; - - interface ProgressEmitter { - on(event: 'progress', handler: (data: ProgressData) => void): Promise; - } - - interface Options { - overwrite?: boolean; - } - - interface ProgressData { - src: string; - dest: string; - size: number; - written: number; - percent: number; - } -} diff --git a/types/cpy/cpy-tests.ts b/types/cpy/cpy-tests.ts deleted file mode 100644 index 1800ab35bf..0000000000 --- a/types/cpy/cpy-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import cpy = require('cpy'); - -cpy(['src/*.png', '!src/goat.png'], 'dist').then(() => {}); -cpy('foo.js', 'destination', { - rename: basename => `prefix-${basename}`, - cwd: '/', - parents: true, - stat: true, - overwrite: false, -}); -cpy('foo.js', 'destination') - .on('progress', progress => { - let num: number; - num = progress.completedFiles; - num = progress.totalFiles; - num = progress.completedSize; - }) - .then(() => {}); diff --git a/types/cpy/index.d.ts b/types/cpy/index.d.ts deleted file mode 100644 index b6ca781137..0000000000 --- a/types/cpy/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Type definitions for cpy 5.1 -// Project: https://github.com/sindresorhus/cpy#readme -// Definitions by: Mohamed Hegazy -// BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import glob = require('glob'); -import cpFile = require('cp-file'); - -export = cpy; -declare function cpy(files: string | string[], destination: string, opts?: cpy.Options): Promise & cpy.ProgressEmitter; - -declare namespace cpy { - interface ProgressEmitter { - on(event: 'progress', handler: (progress: ProgressData) => void): Promise; - } - - type Options = CpyOptions & glob.IOptions & cpFile.Options; - - interface CpyOptions { - cwd?: string; - parents?: boolean; - rename?: string | ((basename: string) => string); - } - - interface ProgressData { - completedFiles: number; - totalFiles: number; - completedSize: number; - } -} diff --git a/types/cradle/tslint.json b/types/cradle/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cradle/tslint.json +++ b/types/cradle/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/create-error/tslint.json b/types/create-error/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/create-error/tslint.json +++ b/types/create-error/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/createjs-lib/tslint.json b/types/createjs-lib/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/createjs-lib/tslint.json +++ b/types/createjs-lib/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/createjs/tslint.json b/types/createjs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/createjs/tslint.json +++ b/types/createjs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/credential/credential-tests.ts b/types/credential/credential-tests.ts index 9d1a59ec65..81b6c368c0 100644 --- a/types/credential/credential-tests.ts +++ b/types/credential/credential-tests.ts @@ -11,15 +11,20 @@ var newPassword = 'I have a really great password.'; pw.hash(newPassword, function(err, hash) { if (err) { throw err; } console.log('Store the password hash.', hash); + if (typeof hash === "string") { + console.log('The hash is a string, as expected'); + } else { + console.log('The has is NOT a string'); + } }); -var storedHash = { +var storedHash = JSON.stringify({ "hash": "gNofnhlBl36AdRyktwATxKoqWKa6hsIEzwCmW/YXN//7PtiJwCRbepV9fUKu0L9TJELCKoDiBy6rGM8ov7lg2yLY", "salt": "yyN3KUzlr4KrKWMM2K3d2Ddxf8OTq+vkKG+mtnmQVIibxSJz8drfzkYzqcH0EM+PVKR/1nClRr/CPDuJsq+FOcIw", "keyLength": 66, "hashMethod": "pbkdf2", "iterations": 181019 -}; +}); var userInput = 'I have a really great password.'; pw.verify(storedHash, userInput, function(err, isValid) { diff --git a/types/credential/index.d.ts b/types/credential/index.d.ts index 16b588dd72..cec4719468 100644 --- a/types/credential/index.d.ts +++ b/types/credential/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for credential +// Type definitions for credential 2.0 // Project: https://github.com/ericelliott/credential // Definitions by: Phú // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,24 +10,16 @@ interface defaultOptions { hashMethod: string; } -interface hashObject { - hash: string; - salt: string; - keyLength: number; - hashMethod: string; - iterations: number; -} - -type HashCallback = (err: Error, hash: hashObject) => void; +type HashCallback = (err: Error, hash: string) => void; type VerifyCallback = (err: Error, isValid: boolean) => void; declare function credential(defaultOptions?: defaultOptions): { hash(password: string, callback: HashCallback): void; - hash(password: string): Promise; + hash(password: string): Promise; // iterations(work: number, base): number; - verify(hash: hashObject | string, password: string, callback: VerifyCallback): void; - verify(hash: hashObject | string, password: string): Promise; + verify(hash: string, password: string, callback: VerifyCallback): void; + verify(hash: string, password: string): Promise; expired(hash: string, days: number): boolean; } diff --git a/types/credential/tslint.json b/types/credential/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/credential/tslint.json +++ b/types/credential/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/credit-card-type/tslint.json b/types/credit-card-type/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/credit-card-type/tslint.json +++ b/types/credit-card-type/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cron/cron-tests.ts b/types/cron/cron-tests.ts index 21e28f9c0f..f152498eca 100644 --- a/types/cron/cron-tests.ts +++ b/types/cron/cron-tests.ts @@ -1,5 +1,7 @@ import cron = require('cron'); +import moment = require('moment'); + var CronJob = cron.CronJob; var CronTime = cron.CronTime; @@ -34,6 +36,22 @@ var job = new CronJob(new Date(), () => { timeZone /* Time zone of this job. */ ); +// Another example with Moment +var job = new CronJob(moment(), () => { + /* runs once at the specified moment. */ + }, () => { + /* This function is executed when the job stops */ + }, + true, /* Start the job right now */ + timeZone /* Time zone of this job. */ +); + +// Another example with system commands +var job = new CronJob('00 30 11 * * 1-5', 'ls', { command: 'ls', args: ['./'] }, + true, /* Start the job right now */ + timeZone /* Time zone of this job. */ +); + // For good measure var job = new CronJob({ cronTime: '00 30 11 * * 1-5', @@ -47,9 +65,14 @@ var job = new CronJob({ start: false, timeZone: 'America/Los_Angeles' }); -console.log(job.lastDate()); -console.log(job.nextDates(1)); -console.log(job.running); +const ld = job.lastDate(); // $ExpectType Date +console.log(ld); +const nd = job.nextDates(); // $ExpectType Moment +console.log(nd); +const nds = job.nextDates(1); // $ExpectType Moment | Moment[] +console.log(nds);// Should be a Moment array +const ru = job.running // $ExpectType boolean +console.log(ru); job.setTime(new CronTime('00 30 11 * * 1-2')); job.start(); job.stop(); @@ -67,4 +90,5 @@ try { // Check cronTime fomat new CronTime('* * * * * *'); new CronTime(new Date()); +new CronTime(moment()); diff --git a/types/cron/index.d.ts b/types/cron/index.d.ts index 596a9536ca..de4398333c 100644 --- a/types/cron/index.d.ts +++ b/types/cron/index.d.ts @@ -1,9 +1,16 @@ -// Type definitions for cron 1.6 +// Type definitions for cron 1.7 // Project: https://www.npmjs.com/package/cron // Definitions by: Hiroki Horiuchi // Lundarl Gholoi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +import { Moment } from 'moment'; +import { SpawnOptions } from "child_process"; + +export declare type CronCommand = (() => void) | string | { command: string, args?: ReadonlyArray, options?: SpawnOptions}; + export declare class CronTime { /** * Create a new ```CronTime```. @@ -11,13 +18,18 @@ export declare class CronTime { * @param zone Timezone name. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). * @param utcOffset UTC offset. Don't use both ```zone``` and ```utcOffset``` together or weird things may happen. */ - constructor(source: string | Date, zone?: string, utcOffset?: string | number); + constructor(source: string | Date | Moment, zone?: string, utcOffset?: string | number); /** * Tells you when ```CronTime``` will be run. - * @param i Indicate which turn of run after now. If not given return next run time. */ - public sendAt(i?: number): Date; + public sendAt(): Moment; + /** + * Tells you when ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + * @returns A `Moment` when the source passed in the constructor is a `Date` or a `Moment` and an array of `Moment` when the source is a string + */ + public sendAt(i?: number): Moment | Moment[]; /** * Get the number of milliseconds in the future at which to fire our callbacks. */ @@ -28,15 +40,15 @@ export declare interface CronJobParameters { /** * The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. */ - cronTime: string | Date; + cronTime: string | Date | Moment; /** * The function to fire at the specified time. If an ```onComplete``` callback was provided, ```onTick``` will receive it as an argument. ```onTick``` may call ```onComplete``` when it has finished its work. */ - onTick: () => void; + onTick: CronCommand; /** * A function that will fire when the job is stopped with ```job.stop()```, and may also be called by ```onTick``` at the end of each run. */ - onComplete?: () => void; + onComplete?: CronCommand; /** * Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your ```onTick``` function, it just gives you more control over the behavior of your jobs. */ @@ -85,7 +97,7 @@ export declare class CronJob { * @param utcOffset This allows you to specify the offset of your timezone rather than using the ```timeZone``` param. Probably don't use both ```timeZone``` and ```utcOffset``` together or weird things may happen. * @param unrefTimeout If you have code that keeps the event loop running and want to stop the node process when that finishes regardless of the state of your cronjob, you can do so making use of this parameter. This is off by default and cron will run as if it needs to control the event loop. For more information take a look at [timers#timers_timeout_unref](https://nodejs.org/api/timers.html#timers_timeout_unref) from the NodeJS docs. */ - constructor(cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean); + constructor(cronTime: string | Date | Moment, onTick: CronCommand, onComplete?: CronCommand, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean); /** * Create a new ```CronJob```. * @param options Job parameters. @@ -111,9 +123,15 @@ export declare class CronJob { public lastDate(): Date; /** * Tells you when a ```CronTime``` will be run. - * @param i Indicate which turn of run after now. If not given return next run time. */ - public nextDates(i?: number): Date; + public nextDate(): Moment; + public nextDates(): Moment; + /** + * Tells you when a ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + * @returns A `Moment` when the cronTime passed in the constructor is a `Date` or a `Moment` and an array of `Moment` when the cronTime is a string + */ + public nextDates(i?: number): Moment | Moment[]; /** * Add another ```onTick``` function. * @param callback Target function. @@ -122,8 +140,8 @@ export declare class CronJob { } export declare var job: - ((cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean) => CronJob) + ((cronTime: string | Date | Moment, onTick: () => void, onComplete?: CronCommand, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean, utcOffset?: string | number, unrefTimeout?: boolean) => CronJob) | ((options: CronJobParameters) => CronJob); -export declare var time: (source: string | Date, zone?: string) => CronTime; -export declare var sendAt: (cronTime: CronTime) => Date; -export declare var timeout: (cronTime: CronTime) => number; +export declare var time: (source: string | Date | Moment, zone?: string) => CronTime; +export declare var sendAt: (cronTime: string | Date | Moment) => Moment; +export declare var timeout: (cronTime: string | Date | Moment) => number; diff --git a/types/cron/package.json b/types/cron/package.json new file mode 100644 index 0000000000..19e5fb0d14 --- /dev/null +++ b/types/cron/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "moment": ">=2.14.0" + } +} diff --git a/types/cron/tslint.json b/types/cron/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cron/tslint.json +++ b/types/cron/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cross-spawn/cross-spawn-tests.ts b/types/cross-spawn/cross-spawn-tests.ts index 6cb36510d8..f6dac4ea72 100644 --- a/types/cross-spawn/cross-spawn-tests.ts +++ b/types/cross-spawn/cross-spawn-tests.ts @@ -8,7 +8,7 @@ pw.on('error', (err: Error) => { console.log(err); }); -const r1: Error = spawn.sync('foo').error; +const r1: Error | undefined = spawn.sync('foo').error; const r2: string[] = spawn.sync('foo').output; const r3: Buffer = spawn.sync('foo').stdout; const r4: Buffer = spawn.sync('foo').stderr; diff --git a/types/cross-storage/tslint.json b/types/cross-storage/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cross-storage/tslint.json +++ b/types/cross-storage/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crossfilter/tslint.json b/types/crossfilter/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crossfilter/tslint.json +++ b/types/crossfilter/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crossroads/tslint.json b/types/crossroads/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crossroads/tslint.json +++ b/types/crossroads/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/crpc/crpc-tests.ts b/types/crpc/crpc-tests.ts index ade069cbba..b9b59ba718 100644 --- a/types/crpc/crpc-tests.ts +++ b/types/crpc/crpc-tests.ts @@ -1,3 +1,3 @@ -import crpc from 'crpc'; +import crpc = require('crpc'); const client = crpc('https://example.com/'); diff --git a/types/crpc/index.d.ts b/types/crpc/index.d.ts index 8947443c42..a599dacab5 100644 --- a/types/crpc/index.d.ts +++ b/types/crpc/index.d.ts @@ -4,6 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 -export type Client = (path: string, body: any, options?: {} | null) => Promise; +declare namespace crpc { + type Client = (path: string, body: any, options?: {} | null) => Promise; +} -export default function crpc(baseUrl: string, options?: {}): Client; +export = crpc; +declare function crpc(baseUrl: string, options?: {}): crpc.Client; diff --git a/types/crypto-js/tslint.json b/types/crypto-js/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/crypto-js/tslint.json +++ b/types/crypto-js/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cryptojs/tslint.json b/types/cryptojs/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cryptojs/tslint.json +++ b/types/cryptojs/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cson/tslint.json b/types/cson/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cson/tslint.json +++ b/types/cson/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/css-font-loading-module/tslint.json b/types/css-font-loading-module/tslint.json index 65c83fb1e3..1c56ba06b6 100644 --- a/types/css-font-loading-module/tslint.json +++ b/types/css-font-loading-module/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { + "npm-naming": false, "dt-header": false } } diff --git a/types/css-modules-loader-core/css-modules-loader-core-tests.ts b/types/css-modules-loader-core/css-modules-loader-core-tests.ts new file mode 100644 index 0000000000..d8fe2966d7 --- /dev/null +++ b/types/css-modules-loader-core/css-modules-loader-core-tests.ts @@ -0,0 +1,24 @@ +/// + +import Core, { Source } from "css-modules-loader-core"; + +const core = new Core(); +const emptyPlugins = new Core([]); +const withPlugins = new Core([ + Core.values, + Core.localByDefault, + Core.extractImports, + Core.scope +]); +const withDefaultPlugins = new Core(Core.defaultPlugins); + +// $ExpectError +const noArray = new Core(Core.values); + +// Validating the source can be anything that has toString() defined +const bufferSource: Source = new Buffer("str"); + +core.load("str").then(({ injectableSource, exportTokens }) => { + const str: string = injectableSource; + exportTokens["key"] = "value"; +}); diff --git a/types/css-modules-loader-core/index.d.ts b/types/css-modules-loader-core/index.d.ts new file mode 100644 index 0000000000..d7bd533ac1 --- /dev/null +++ b/types/css-modules-loader-core/index.d.ts @@ -0,0 +1,50 @@ +// Type definitions for css-modules-loader-core 1.1 +// Project: https://github.com/css-modules/css-modules-loader-core +// Definitions by: Spencer Miskoviak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +import { Plugin } from "postcss"; + +declare namespace Core { + type Source = + | string + | { + toString(): string; + }; + + type PathFetcher = ( + file: string, + relativeTo: string, + depTrace: string + ) => void; + + interface ExportTokens { + [index: string]: string; + } + + interface Result { + injectableSource: string; + exportTokens: ExportTokens; + } +} + +declare class Core { + static values: Plugin<{}>; + static localByDefault: Plugin<{}>; + static extractImports: Plugin<{}>; + static scope: Plugin<{}>; + static defaultPlugins: Array>; + + constructor(plugins?: Array>); + + load( + source: Core.Source, + sourcePath?: string, + trace?: string, + pathFetcher?: Core.PathFetcher + ): Promise; +} + +export = Core; +export as namespace Core; diff --git a/types/css-modules-loader-core/package.json b/types/css-modules-loader-core/package.json new file mode 100644 index 0000000000..06a694067a --- /dev/null +++ b/types/css-modules-loader-core/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "postcss": "7.x.x" + } +} diff --git a/types/css-modules-loader-core/tsconfig.json b/types/css-modules-loader-core/tsconfig.json new file mode 100644 index 0000000000..a4b15a0258 --- /dev/null +++ b/types/css-modules-loader-core/tsconfig.json @@ -0,0 +1,24 @@ +{ + "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", + "css-modules-loader-core-tests.ts" + ] +} diff --git a/types/file-type/tslint.json b/types/css-modules-loader-core/tslint.json similarity index 100% rename from types/file-type/tslint.json rename to types/css-modules-loader-core/tslint.json diff --git a/types/css-modules-require-hook/tslint.json b/types/css-modules-require-hook/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/css-modules-require-hook/tslint.json +++ b/types/css-modules-require-hook/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/css/tslint.json b/types/css/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/css/tslint.json +++ b/types/css/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cssbeautify/tslint.json b/types/cssbeautify/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cssbeautify/tslint.json +++ b/types/cssbeautify/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/csurf/tslint.json b/types/csurf/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/csurf/tslint.json +++ b/types/csurf/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cuid/tslint.json b/types/cuid/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cuid/tslint.json +++ b/types/cuid/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cuint/cuint-tests.ts b/types/cuint/cuint-tests.ts new file mode 100644 index 0000000000..6a5abe305e --- /dev/null +++ b/types/cuint/cuint-tests.ts @@ -0,0 +1,5 @@ +import { UINT32 } from "cuint"; + +const u = UINT32(1, 2); +const d = u.fromBits(4, 5, 6); +d.add(u.multiply(d)).rotl(17).subtract(u).shiftRight(123); diff --git a/types/cuint/index.d.ts b/types/cuint/index.d.ts new file mode 100644 index 0000000000..4b20b33973 --- /dev/null +++ b/types/cuint/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for cuint 0.2 +// Project: https://github.com/pierrec/js-cuint +// Definitions by: Lukas Tetzlaff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Uint { + clone(): this; + add(x: this): this; + subtract(x: this): this; + multiply(x: this): this; + xor(x: this): this; + rotl(n: number): this; + shiftRight(n: number): this; + + fromNumber(n: number): this; + fromBits(...bits: number[]): this; + + _low: number; + _high: number; + + toString(base?: number): string; +} + +export interface UintConstructor { + // called as a function: + (low: number, high?: number): T; + // tslint:disable-next-line:unified-signatures + (text: string, radix?: number): T; + + // called as a constructor: + new (low: number, high?: number): T; + // tslint:disable-next-line:unified-signatures + new (text: string, radix?: number): T; + + prototype: T; + } + +export const UINT64: UintConstructor; +export const UINT32: UintConstructor; diff --git a/types/boxen/tsconfig.json b/types/cuint/tsconfig.json similarity index 94% rename from types/boxen/tsconfig.json rename to types/cuint/tsconfig.json index 6d34147e83..44d73f84be 100644 --- a/types/boxen/tsconfig.json +++ b/types/cuint/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "boxen-tests.ts" + "cuint-tests.ts" ] } diff --git a/types/filenamify-url/tslint.json b/types/cuint/tslint.json similarity index 100% rename from types/filenamify-url/tslint.json rename to types/cuint/tslint.json diff --git a/types/custom-error-generator/tslint.json b/types/custom-error-generator/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/custom-error-generator/tslint.json +++ b/types/custom-error-generator/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cybozulabs-md5/tslint.json b/types/cybozulabs-md5/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/cybozulabs-md5/tslint.json +++ b/types/cybozulabs-md5/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 507a5f773d..3ba776e14f 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -1,12 +1,21 @@ -// Type definitions for cypress-axe 0.3 +// Type definitions for cypress-axe 0.4 // Project: https://github.com/avanslaars/cypress-axe#readme // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -declare namespace Cypress { - interface Chainable { - injectAxe(): void; - checkA11y(): void; +import { ElementContext, RunOptions } from 'axe-core'; + +declare module 'axe-core' { + interface Node {} +} + +declare global { + namespace Cypress { + interface Chainable { + injectAxe(): void; + checkA11y(context?: ElementContext, options?: RunOptions): void; + configureAxe(options?: RunOptions): void; + } } } diff --git a/types/cypress-axe/package.json b/types/cypress-axe/package.json new file mode 100644 index 0000000000..71df6dd355 --- /dev/null +++ b/types/cypress-axe/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "axe-core": "^3.1.2" + } +} diff --git a/types/cypress-axe/tslint.json b/types/cypress-axe/tslint.json index 3db14f85ea..4f44991c3c 100644 --- a/types/cypress-axe/tslint.json +++ b/types/cypress-axe/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false + } +} diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index b4ca7de92f..aec7c9bf6c 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Cytoscape.js 3.3 +// Type definitions for Cytoscape.js 3.4 // Project: http://js.cytoscape.org/ // Definitions by: Fabian Schmidt and Fred Eisele // Shenghan Gao @@ -3229,7 +3229,7 @@ declare namespace cytoscape { * This finds the shortest path from the starting node to all other nodes in the collection. * http://js.cytoscape.org/#eles.bellmanFord */ - bellmanFort(options: SearchBellmanFordOptions): SearchBellmanFordResult; + bellmanFord(options: SearchBellmanFordOptions): SearchBellmanFordResult; /** * Perform Kruskal's algorithm on the elements in the collection, * returning the minimum spanning tree, assuming undirected edges. diff --git a/types/d3-array/d3-array-tests.ts b/types/d3-array/d3-array-tests.ts index b0d00d5d20..697543830b 100644 --- a/types/d3-array/d3-array-tests.ts +++ b/types/d3-array/d3-array-tests.ts @@ -70,7 +70,7 @@ const mixedObjectArray = [ ]; const mixedObjectOrUndefinedArray = [...mixedObjectArray, undefined]; -const mixedObjectArrayLike = mixedObjectArray as ArrayLike; +const mixedObjectArrayLike = mixedObjectArray as Iterable; let typedArray = Uint8Array.from(numbersArray); let readonlyNumbersArray = numbersArray as ReadonlyArray; @@ -81,55 +81,55 @@ const readonlyDateArray = dateArray as ReadonlyArray; const readonlyMixedObjectArray = mixedObjectArray as ReadonlyArray; const readonlyMixedObjectOrUndefinedArray = mixedObjectOrUndefinedArray as ReadonlyArray; -function accessorMixedObjectToNum(datum: MixedObject, index: number, array: ArrayLike): number { +function accessorMixedObjectToNum(datum: MixedObject, index: number, array: Iterable): number { return datum.num; } -function accessorMixedObjectToStr(datum: MixedObject, index: number, array: ArrayLike): string { +function accessorMixedObjectToStr(datum: MixedObject, index: number, array: Iterable): string { return datum.str; } -function accessorMixedObjectToNumeric(datum: MixedObject, index: number, array: ArrayLike): NumCoercible { +function accessorMixedObjectToNumeric(datum: MixedObject, index: number, array: Iterable): NumCoercible { return datum.numeric; } -function accessorMixedObjectToDate(datum: MixedObject, index: number, array: ArrayLike): Date { +function accessorMixedObjectToDate(datum: MixedObject, index: number, array: Iterable): Date { return datum.date; } -function accessorMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): number | undefined | null { +function accessorMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable): number | undefined | null { return datum ? datum.num : undefined; } -function accessorMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): string | undefined | null { +function accessorMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable): string | undefined | null { return datum ? datum.str : undefined; } -function accessorLikeMixedObjectToNum(datum: MixedObject, index: number, array: ArrayLike): number { +function accessorLikeMixedObjectToNum(datum: MixedObject, index: number, array: Iterable): number { return datum.num; } -function accessorLikeMixedObjectToStr(datum: MixedObject, index: number, array: ArrayLike): string { +function accessorLikeMixedObjectToStr(datum: MixedObject, index: number, array: Iterable): string { return datum.str; } -function accessorLikeMixedObjectToNumeric(datum: MixedObject, index: number, array: ArrayLike): NumCoercible { +function accessorLikeMixedObjectToNumeric(datum: MixedObject, index: number, array: Iterable): NumCoercible { return datum.numeric; } -function accessorLikeMixedObjectToDate(datum: MixedObject, index: number, array: ArrayLike): Date { +function accessorLikeMixedObjectToDate(datum: MixedObject, index: number, array: Iterable): Date { return datum.date; } -function accessorLikeMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): number | undefined | null { +function accessorLikeMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable): number | undefined | null { return datum ? datum.num : undefined; } -function accessorLikeMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): string | undefined | null { +function accessorLikeMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable): string | undefined | null { return datum ? datum.str : undefined; } -function accessorReadOnlyMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): number | undefined | null { +function accessorReadOnlyMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: Iterable): number | undefined | null { return datum ? datum.num : undefined; } @@ -485,6 +485,12 @@ num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(201 num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14), 1); num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14), 3, 4); +// quickselect +numbersArray = d3Array.quickselect(numbersArray, 3); +numbersArray = d3Array.quickselect(numbersArray, 3, 0); +numbersArray = d3Array.quickselect(numbersArray, 3, 0, 5); +numbersArray = d3Array.quickselect(numbersArray, 3, 0, 5, d3Array.descending); + // ascending() ----------------------------------------------------------------- num = d3Array.ascending(undefined, 20); @@ -536,6 +542,23 @@ mergedArray = d3Array.merge([testArray1, [15, 30]]); // fails, type mismatch mergedArray = d3Array.merge(readonlyTestArrays); // inferred type mergedArray = d3Array.merge(readonlyTestArrays); // explicit type +interface ObjDefinition { + name: string; + amount: string; + date: string; +} + +const objArray: ObjDefinition[] = [ + { name: "jim", amount: "34.0", date: "11/12/2015" }, + { name: "carl", amount: "120.11", date: "11/12/2015" }, + { name: "stacy", amount: "12.01", date: "01/04/2016" }, + { name: "stacy", amount: "34.05", date: "01/04/2016" } +]; + +const grouped: Map = d3Array.group(objArray, d => d.name); +const rolledup: Map = d3Array.rollup(objArray, d => d.length, d => d.name); +const rolledup2: Map = d3Array.rollup(objArray, d => d.map(u => u.name).join(' '), d => d.name); + // cross() --------------------------------------------------------------------- let crossed: Array<[string, number]>; @@ -780,7 +803,7 @@ histoMixedObject_Date = histoMixedObject_Date.domain(timeScale.domain()); // fai domainFnDate = histoMixedObject_Date.domain(); histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain([new Date(2014, 3, 15), new Date(2017, 4, 15)]); histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain([domain[0], domain[domain.length]]); -histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain((values) => [values[0]!, values[values.length]!]); +histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain((values) => [values[0]!, values[values.length]!]); // thresholds(...) ------------------------------------------------------------- @@ -935,8 +958,3 @@ num = d3Array.thresholdScott(readonlyNumbersArray, -1, 234); num = d3Array.thresholdSturges(numbersArray); num = d3Array.thresholdSturges(typedArray); num = d3Array.thresholdSturges(readonlyNumbersArray); - -// Deprecated ================================================================== - -const histDeprecatedNumber: d3Array.HistogramGenerator = d3Array.histogram(); -const histDeprecatedDate: d3Array.HistogramGenerator = d3Array.histogram(); diff --git a/types/d3-array/index.d.ts b/types/d3-array/index.d.ts index 16a0e659cb..5de77e4e10 100644 --- a/types/d3-array/index.d.ts +++ b/types/d3-array/index.d.ts @@ -1,13 +1,14 @@ -// Type definitions for D3JS d3-array module 1.2 +// Type definitions for D3JS d3-array module 2.0 // Project: https://github.com/d3/d3-array, https://d3js.org/d3-array // Definitions by: Alex Ford // Boris Yankov // Tom Wanzek -// denisname +// denisname , +// Hugues Stefanski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 1.2.1 +// Last module patch version validated against: 2.0.3 // -------------------------------------------------------------------------- // Shared Types and Interfaces @@ -32,128 +33,128 @@ export interface Numeric { /** * Return the maximum value in the array of strings using natural order. */ -export function max(array: ArrayLike): string | undefined; +export function max(array: Iterable): string | undefined; /** * Return the maximum value in the array of numbers using natural order. */ -export function max(array: ArrayLike): T | undefined; +export function max(array: Iterable): T | undefined; /** * Return the maximum value in the array using natural order and a projection function to map values to strings. */ -export function max(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => string | undefined | null): string | undefined; +export function max(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => string | undefined | null): string | undefined; /** * Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values. */ -export function max(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => U | undefined | null): U | undefined; +export function max(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => U | undefined | null): U | undefined; /** * Return the minimum value in the array using natural order. */ -export function min(array: ArrayLike): string | undefined; +export function min(array: Iterable): string | undefined; /** * Return the minimum value in the array using natural order. */ -export function min(array: ArrayLike): T | undefined; +export function min(array: Iterable): T | undefined; /** * Return the minimum value in the array using natural order. */ -export function min(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => string | undefined | null): string | undefined; +export function min(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => string | undefined | null): string | undefined; /** * Return the minimum value in the array using natural order. */ -export function min(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => U | undefined | null): U | undefined; +export function min(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => U | undefined | null): U | undefined; /** * Return the min and max simultaneously. */ -export function extent(array: ArrayLike): [string, string] | [undefined, undefined]; +export function extent(array: Iterable): [string, string] | [undefined, undefined]; /** * Return the min and max simultaneously. */ -export function extent(array: ArrayLike): [T, T] | [undefined, undefined]; +export function extent(array: Iterable): [T, T] | [undefined, undefined]; /** * Return the min and max simultaneously. */ -export function extent(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => string | undefined | null): [string, string] | [undefined, undefined]; +export function extent(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => string | undefined | null): [string, string] | [undefined, undefined]; /** * Return the min and max simultaneously. */ -export function extent(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => U | undefined | null): [U, U] | [undefined, undefined]; +export function extent(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => U | undefined | null): [U, U] | [undefined, undefined]; /** * Return the mean of an array of numbers */ -export function mean(array: ArrayLike): number | undefined; +export function mean(array: Iterable): number | undefined; /** * Return the mean of an array of numbers */ -export function mean(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => number | undefined | null): number | undefined; +export function mean(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => number | undefined | null): number | undefined; /** * Return the median of an array of numbers */ -export function median(array: ArrayLike): number | undefined; +export function median(array: Iterable): number | undefined; /** * Return the median of an array of numbers */ -export function median(array: ArrayLike, accessor: (element: T, i: number, array: ArrayLike) => number | undefined | null): number | undefined; +export function median(array: Iterable, accessor: (element: T, i: number, array: Iterable) => number | undefined | null): number | undefined; /** * Returns the p-quantile of an array of numbers */ -export function quantile(array: ArrayLike, p: number): number | undefined; +export function quantile(array: Iterable, p: number): number | undefined; -export function quantile(array: ArrayLike, p: number, accessor: (element: T, i: number, array: ArrayLike) => number | undefined | null): number | undefined; +export function quantile(array: Iterable, p: number, accessor: (element: T, i: number, array: Iterable) => number | undefined | null): number | undefined; /** * Compute the sum of an array of numbers. */ -export function sum(array: ArrayLike): number; +export function sum(array: Iterable): number; /** * Compute the sum of an array, using the given accessor to convert values to numbers. */ -export function sum(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => number | undefined | null): number; +export function sum(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => number | undefined | null): number; /** * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers. */ -export function deviation(array: ArrayLike): number | undefined; +export function deviation(array: Iterable): number | undefined; /** * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array, * using the given accessor to convert values to numbers. */ -export function deviation(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => number | undefined | null): number | undefined; +export function deviation(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => number | undefined | null): number | undefined; /** * Compute an unbiased estimator of the population variance of the given array of numbers. */ -export function variance(array: ArrayLike): number | undefined; +export function variance(array: Iterable): number | undefined; /** * Compute an unbiased estimator of the population variance of the given array, * using the given accessor to convert values to numbers. */ -export function variance(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => number | undefined | null): number | undefined; +export function variance(array: Iterable, accessor: (datum: T, index: number, array: Iterable) => number | undefined | null): number | undefined; // -------------------------------------------------------------------------------------- // Searching Arrays // -------------------------------------------------------------------------------------- -export function scan(array: ArrayLike, comparator?: (a: number, b: number) => number): number | undefined; -export function scan(array: ArrayLike, comparator: (a: T, b: T) => number): number | undefined; +export function scan(array: Iterable, comparator?: (a: number, b: number) => number): number | undefined; +export function scan(array: Iterable, comparator: (a: T, b: T) => number): number | undefined; export function bisectLeft(array: ArrayLike, x: number, lo?: number, hi?: number): number; export function bisectLeft(array: ArrayLike, x: string, lo?: number, hi?: number): number; @@ -173,6 +174,44 @@ export interface Bisector { export function bisector(comparator: (a: T, b: U) => number): Bisector; export function bisector(accessor: (x: T) => U): Bisector; +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + */ +export function quickselect(array: ArrayLike, k: number): T[]; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + * @param left The left index of the range to sort. + */ +export function quickselect(array: ArrayLike, k: number, left: number): T[]; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + * @param left The left index of the range to sort. + * @param right The right index. + */ +export function quickselect(array: ArrayLike, k: number, left: number, right: number): T[]; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + * @param left The left index of the range to sort. + * @param right The right index. + * @param compare The compare function. + */ +export function quickselect(array: ArrayLike, k: number, left: number, right: number, compare: (a: Primitive | undefined, b: Primitive | undefined) => number): T[]; + // NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. /** * Compares two primitive values for sorting (in ascending order). @@ -189,6 +228,22 @@ export function descending(a: Primitive | undefined, b: Primitive | undefined): // Transforming Arrays // -------------------------------------------------------------------------------------- +/** + * Groups the specified array of values into a Map from key to array of value. + * @param a The array to group. + * @param key The key function. + */ +export function group(a: Iterable, key: (value: TObject) => TKey): Map; + +/** + * Groups and reduces the specified array of values into a Map from key to value. + * + * @param a The array to group. + * @param reduce The reduce function. + * @param key The key function. + */ +export function rollup(a: Iterable, reduce: (value: TObject[]) => TReduce, key: (value: TObject) => TKey): Map; + /** * Returns the Cartesian product of the two arrays a and b. * For each element i in the specified array a and each element j in the specified array b, in order, @@ -197,7 +252,7 @@ export function descending(a: Primitive | undefined, b: Primitive | undefined): * @param a First input array. * @param b Second input array. */ -export function cross(a: ArrayLike, b: ArrayLike): Array<[S, T]>; +export function cross(a: Iterable, b: Iterable): Array<[S, T]>; /** * Returns the Cartesian product of the two arrays a and b. @@ -208,12 +263,12 @@ export function cross(a: ArrayLike, b: ArrayLike): Array<[S, T]>; * @param b Second input array. * @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value. */ -export function cross(a: ArrayLike, b: ArrayLike, reducer: (a: S, b: T) => U): U[]; +export function cross(a: Iterable, b: Iterable, reducer: (a: S, b: T) => U): U[]; /** * Merges the specified arrays into a single array. */ -export function merge(arrays: ArrayLike>): T[]; +export function merge(arrays: Iterable>): T[]; /** * For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. @@ -221,7 +276,7 @@ export function merge(arrays: ArrayLike>): T[]; * * @param array Array of input elements */ -export function pairs(array: ArrayLike): Array<[T, T]>; +export function pairs(array: Iterable): Array<[T, T]>; /** * For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1. * Returns the resulting array of pair-wise reduced elements. @@ -230,7 +285,7 @@ export function pairs(array: ArrayLike): Array<[T, T]>; * @param array Array of input elements * @param reducer A reducer function taking as input to adjacent elements of the input array and returning a reduced value. */ -export function pairs(array: ArrayLike, reducer: (a: T, b: T) => U): U[]; +export function pairs(array: Iterable, reducer: (a: T, b: T) => U): U[]; /** * Returns a permutation of the specified array using the specified array of indexes. @@ -351,36 +406,6 @@ export type ThresholdNumberArrayGenerator = export type ThresholdDateArrayGenerator = (values: ArrayLike, min: Date, max: Date) => Value[]; -/** - * @deprecated Use ThresholdNumberArrayGenerator or ThresholdDateArrayGenerator. - */ -export type ThresholdArrayGenerator = ThresholdNumberArrayGenerator; - -/** - * @deprecated Use `HistogramGeneratorNumber` for `number` values and `HistogramGeneratorDate for `Date` values. - */ -export interface HistogramGenerator { - (data: ArrayLike): Array>; - - value(): (d: Datum, i: number, data: ArrayLike) => Value; - value(valueAccessor: (d: Datum, i: number, data: ArrayLike) => Value): this; - - domain(): (values: ArrayLike) => [Value, Value] | [undefined, undefined]; - domain(domain: [Value, Value]): this; - domain(domainAccessor: (values: ArrayLike) => [Value, Value] | [undefined, undefined]): this; - - /** - * Set the array of values to be used as thresholds in determining the bins. - * - * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, - * and the last bin.x1 is always equal to the maximum domain value. - * - * @param thresholds Array of threshold values used for binning. The elements must - * be of the same type as the materialized values of the histogram. - */ - thresholds(thresholds: ArrayLike): this; -} - export interface HistogramCommon { (data: ArrayLike): Array>; @@ -419,9 +444,9 @@ export interface HistogramGeneratorDate e } export interface HistogramGeneratorNumber extends HistogramCommon { - domain(): (values: ArrayLike) => [number, number] | [undefined, undefined]; + domain(): (values: Iterable) => [number, number] | [undefined, undefined]; domain(domain: [number, number]): this; - domain(domainAccessor: (values: ArrayLike) => [number, number] | [undefined, undefined]): this; + domain(domainAccessor: (values: Iterable) => [number, number] | [undefined, undefined]): this; thresholds(): ThresholdCountGenerator | ThresholdNumberArrayGenerator; /** @@ -475,12 +500,6 @@ export function histogram(): HistogramGeneratorNumber; export function histogram(): HistogramGeneratorNumber; export function histogram(): HistogramGeneratorDate; -/** - * @deprecated Do not use Value generic which mixes number and Date types. Use either number or Date - * (in combination with undefined, as applicable) to obtain a type-specific histogram generator. - */ -export function histogram(): HistogramGenerator; - // -------------------------------------------------------------------------------------- // Histogram Thresholds // -------------------------------------------------------------------------------------- diff --git a/types/d3-array/v1/d3-array-tests.ts b/types/d3-array/v1/d3-array-tests.ts new file mode 100644 index 0000000000..01529191b8 --- /dev/null +++ b/types/d3-array/v1/d3-array-tests.ts @@ -0,0 +1,941 @@ +/** + * Typescript definition tests for d3/d3-array module + * + * Note: These tests are intended to test the definitions only + * in the sense of typing and call signature consistency. They + * are not intended as functional tests. + */ + +import * as d3Array from 'd3-array'; +import { scaleTime } from 'd3-scale'; +import { timeYear } from 'd3-time'; + +// ----------------------------------------------------------------------------- +// Preparatory Steps +// ----------------------------------------------------------------------------- + +class NumCoercible { + a: number; + + constructor(a: number) { + this.a = a; + } + valueOf() { + return this.a; + } +} + +class MixedObject { + num: number; + str: string; + numeric: NumCoercible; + date: Date; + + constructor(a: number, date: Date) { + this.num = a; + this.str = a.toString(); + this.numeric = new NumCoercible(a); + this.date = date; + } +} + +let num: number; +let undef: undefined; +let mixedObject: MixedObject; + +let numOrUndefined: number | undefined; +let strOrUndefined: string | undefined; +let numericOrUndefined: NumCoercible | undefined; +let dateOrUndefined: Date | undefined; +let mixedObjectOrUndefined: MixedObject | undefined; +let numOrUndefinedExtent: [number, number] | [undefined, undefined]; +let strOrUndefinedExtent: [string, string] | [undefined, undefined]; +let numericOrUndefinedExtent: [NumCoercible, NumCoercible] | [undefined, undefined]; +let dateMixedOrUndefined: [Date, Date] | [undefined, undefined]; +let mixedOrUndefinedExtent: [d3Array.Primitive | NumCoercible, d3Array.Primitive | NumCoercible] | [undefined, undefined]; +let dateOrUndefinedExtent: [Date, Date] | [undefined, undefined]; + +let numbersArray = [10, 20, 30, 40, 50]; +const numbersOrUndefinedArray = [10, 20, undefined, null, 40, 50]; +let stringyNumbersArray = ['10', '20', '30', '40', '50']; +const numericArray = [new NumCoercible(10), new NumCoercible(20), new NumCoercible(30), new NumCoercible(40), new NumCoercible(50)]; +let dateArray = [new Date(2016, 6, 1), new Date(2016, 7, 30), new Date(2015, 3, 15)]; + +const mixedObjectArray = [ + new MixedObject(10, new Date(2016, 6, 1)), + new MixedObject(20, new Date(2016, 7, 30)), + new MixedObject(30, new Date(2015, 3, 15)), + new MixedObject(40, new Date(2014, 3, 15)), + new MixedObject(50, new Date(2017, 4, 15)) +]; + +const mixedObjectOrUndefinedArray = [...mixedObjectArray, undefined]; +const mixedObjectArrayLike = mixedObjectArray as ArrayLike; + +let typedArray = Uint8Array.from(numbersArray); +let readonlyNumbersArray = numbersArray as ReadonlyArray; +const readonlyNumbersOrUndefinedArray = numbersOrUndefinedArray as ReadonlyArray; +const readonlyStringyNumbersArray = stringyNumbersArray as ReadonlyArray; +const readonlyNumericArray = numericArray as ReadonlyArray; +const readonlyDateArray = dateArray as ReadonlyArray; +const readonlyMixedObjectArray = mixedObjectArray as ReadonlyArray; +const readonlyMixedObjectOrUndefinedArray = mixedObjectOrUndefinedArray as ReadonlyArray; + +function accessorMixedObjectToNum(datum: MixedObject, index: number, array: ArrayLike): number { + return datum.num; +} + +function accessorMixedObjectToStr(datum: MixedObject, index: number, array: ArrayLike): string { + return datum.str; +} + +function accessorMixedObjectToNumeric(datum: MixedObject, index: number, array: ArrayLike): NumCoercible { + return datum.numeric; +} + +function accessorMixedObjectToDate(datum: MixedObject, index: number, array: ArrayLike): Date { + return datum.date; +} + +function accessorMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): number | undefined | null { + return datum ? datum.num : undefined; +} + +function accessorMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): string | undefined | null { + return datum ? datum.str : undefined; +} + +function accessorLikeMixedObjectToNum(datum: MixedObject, index: number, array: ArrayLike): number { + return datum.num; +} + +function accessorLikeMixedObjectToStr(datum: MixedObject, index: number, array: ArrayLike): string { + return datum.str; +} + +function accessorLikeMixedObjectToNumeric(datum: MixedObject, index: number, array: ArrayLike): NumCoercible { + return datum.numeric; +} + +function accessorLikeMixedObjectToDate(datum: MixedObject, index: number, array: ArrayLike): Date { + return datum.date; +} + +function accessorLikeMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): number | undefined | null { + return datum ? datum.num : undefined; +} + +function accessorLikeMixedObjectToStrOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): string | undefined | null { + return datum ? datum.str : undefined; +} + +function accessorReadOnlyMixedObjectToNumOrUndefined(datum: MixedObject | undefined, index: number, array: ArrayLike): number | undefined | null { + return datum ? datum.num : undefined; +} + +// ----------------------------------------------------------------------------- +// Test Statistics +// ----------------------------------------------------------------------------- + +// max() ----------------------------------------------------------------------- + +// without accessors + +numOrUndefined = d3Array.max(numbersArray); +strOrUndefined = d3Array.max(stringyNumbersArray); +numericOrUndefined = d3Array.max(numericArray); +dateOrUndefined = d3Array.max(dateArray); + +// ArrayLike test cases + +numOrUndefined = d3Array.max(typedArray); +numOrUndefined = d3Array.max(readonlyNumbersOrUndefinedArray); +strOrUndefined = d3Array.max(readonlyStringyNumbersArray); +numericOrUndefined = d3Array.max(readonlyNumericArray); +dateOrUndefined = d3Array.max(readonlyDateArray); + +// with accessors + +numOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToNum); +strOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToStr); +numericOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToNumeric); +dateOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToDate); +numOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToNumOrUndefined); +strOrUndefined = d3Array.max(mixedObjectArray, accessorMixedObjectToStrOrUndefined); +numOrUndefined = d3Array.max(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +numOrUndefined = d3Array.max(mixedObjectArrayLike, accessorLikeMixedObjectToNum); +numOrUndefined = d3Array.max(mixedObjectArray, accessorLikeMixedObjectToNum); +numOrUndefined = d3Array.max(mixedObjectArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +numOrUndefined = d3Array.max(mixedObjectArray, (d) => { + const l: MixedObject = d; + return l.num; +}); + +strOrUndefined = d3Array.max(mixedObjectArray, (d) => { + const l: MixedObject = d; + return l.str; +}); + +// $ExpectError +numOrUndefined = d3Array.max(readonlyNumbersArray, (d, i, a) => { a.push(3); return 0; }); + +// min() ----------------------------------------------------------------------- + +// without accessors + +numOrUndefined = d3Array.min(numbersArray); +strOrUndefined = d3Array.min(stringyNumbersArray); +numericOrUndefined = d3Array.min(numericArray); +dateOrUndefined = d3Array.min(dateArray); + +// ArrayLike test cases + +numOrUndefined = d3Array.min(typedArray); +numOrUndefined = d3Array.min(readonlyNumbersOrUndefinedArray); +strOrUndefined = d3Array.min(readonlyStringyNumbersArray); +numericOrUndefined = d3Array.min(readonlyNumericArray); +dateOrUndefined = d3Array.min(readonlyDateArray); + +// with accessors + +numOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToNum); +strOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToStr); +numericOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToNumeric); +dateOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToDate); +numOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToNumOrUndefined); +strOrUndefined = d3Array.min(mixedObjectArray, accessorMixedObjectToStrOrUndefined); +numOrUndefined = d3Array.min(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +// extent() -------------------------------------------------------------------- + +// without accessors + +numOrUndefinedExtent = d3Array.extent(numbersArray); +strOrUndefinedExtent = d3Array.extent(stringyNumbersArray); +numericOrUndefinedExtent = d3Array.extent(numericArray); +dateOrUndefinedExtent = d3Array.extent(dateArray); + +// ArrayLike test cases + +numOrUndefinedExtent = d3Array.extent(typedArray); +numOrUndefinedExtent = d3Array.extent(readonlyNumbersOrUndefinedArray); +strOrUndefinedExtent = d3Array.extent(readonlyStringyNumbersArray); +numericOrUndefinedExtent = d3Array.extent(readonlyNumericArray); +dateOrUndefinedExtent = d3Array.extent(readonlyDateArray); + +// with accessors + +numOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToNum); +strOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToStr); +mixedOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToNumeric); +dateMixedOrUndefined = d3Array.extent(mixedObjectArray, accessorMixedObjectToDate); +numOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToNumOrUndefined); +strOrUndefinedExtent = d3Array.extent(mixedObjectArray, accessorMixedObjectToStrOrUndefined); +numOrUndefinedExtent = d3Array.extent(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +// mean() ---------------------------------------------------------------------- + +numOrUndefined = d3Array.mean(numbersArray); +numOrUndefined = d3Array.mean(numericArray); +numOrUndefined = d3Array.mean(numbersOrUndefinedArray); + +numOrUndefined = d3Array.mean(typedArray); +numOrUndefined = d3Array.mean(readonlyNumbersOrUndefinedArray); +numOrUndefined = d3Array.mean(readonlyNumericArray); +numOrUndefined = d3Array.mean(readonlyNumbersOrUndefinedArray); + +numOrUndefined = d3Array.mean(mixedObjectArray, accessorMixedObjectToNum); +numOrUndefined = d3Array.mean(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined); +numOrUndefined = d3Array.mean(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +// median() -------------------------------------------------------------------- + +numOrUndefined = d3Array.median(numbersArray); +numOrUndefined = d3Array.median(numericArray); +numOrUndefined = d3Array.median(numbersOrUndefinedArray); + +numOrUndefined = d3Array.median(typedArray); +numOrUndefined = d3Array.median(readonlyNumbersArray); +numOrUndefined = d3Array.median(readonlyNumericArray); +numOrUndefined = d3Array.median(readonlyNumbersOrUndefinedArray); + +numOrUndefined = d3Array.median(mixedObjectArray, accessorMixedObjectToNum); +numOrUndefined = d3Array.median(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined); +numOrUndefined = d3Array.median(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +// quantile() ------------------------------------------------------------------ + +numOrUndefined = d3Array.quantile(numbersArray, 0.5); +numOrUndefined = d3Array.quantile(numericArray, 0.5); +numOrUndefined = d3Array.quantile(numbersOrUndefinedArray, 0.5); + +numOrUndefined = d3Array.quantile(typedArray, 0.5); +numOrUndefined = d3Array.quantile(readonlyNumbersArray, 0.5); +numOrUndefined = d3Array.quantile(readonlyNumericArray, 0.5); +numOrUndefined = d3Array.quantile(readonlyNumbersOrUndefinedArray, 0.5); + +numOrUndefined = d3Array.quantile(mixedObjectArray, 0.5, accessorMixedObjectToNum); +numOrUndefined = d3Array.quantile(mixedObjectOrUndefinedArray, 0.5, accessorMixedObjectToNumOrUndefined); +numOrUndefined = d3Array.quantile(readonlyMixedObjectOrUndefinedArray, 0.5, accessorReadOnlyMixedObjectToNumOrUndefined); + +// sum() ----------------------------------------------------------------------- + +numOrUndefined = d3Array.sum(numbersArray); +numOrUndefined = d3Array.sum(numericArray); +numOrUndefined = d3Array.sum(numbersOrUndefinedArray); + +numOrUndefined = d3Array.sum(typedArray); +numOrUndefined = d3Array.sum(readonlyNumbersArray); +numOrUndefined = d3Array.sum(readonlyNumericArray); +numOrUndefined = d3Array.sum(readonlyNumbersOrUndefinedArray); + +numOrUndefined = d3Array.sum(mixedObjectArray, accessorMixedObjectToNum); +numOrUndefined = d3Array.sum(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined); +numOrUndefined = d3Array.sum(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +// deviation() ----------------------------------------------------------------- + +numOrUndefined = d3Array.deviation(numbersArray); +numOrUndefined = d3Array.deviation(numericArray); +numOrUndefined = d3Array.deviation(numbersOrUndefinedArray); + +numOrUndefined = d3Array.deviation(typedArray); +numOrUndefined = d3Array.deviation(readonlyNumbersArray); +numOrUndefined = d3Array.deviation(readonlyNumericArray); +numOrUndefined = d3Array.deviation(readonlyNumbersOrUndefinedArray); + +numOrUndefined = d3Array.deviation(mixedObjectArray, accessorMixedObjectToNum); +numOrUndefined = d3Array.deviation(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined); +numOrUndefined = d3Array.deviation(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +// variance() ------------------------------------------------------------------ + +numOrUndefined = d3Array.variance(numbersArray); +numOrUndefined = d3Array.variance(numericArray); +numOrUndefined = d3Array.variance(numbersOrUndefinedArray); + +numOrUndefined = d3Array.variance(typedArray); +numOrUndefined = d3Array.variance(readonlyNumbersArray); +numOrUndefined = d3Array.variance(readonlyNumericArray); +numOrUndefined = d3Array.variance(readonlyNumbersOrUndefinedArray); + +numOrUndefined = d3Array.variance(mixedObjectArray, accessorMixedObjectToNum); +numOrUndefined = d3Array.variance(mixedObjectOrUndefinedArray, accessorMixedObjectToNumOrUndefined); +numOrUndefined = d3Array.variance(readonlyMixedObjectOrUndefinedArray, accessorReadOnlyMixedObjectToNumOrUndefined); + +// ----------------------------------------------------------------------------- +// Test Searching Arrays +// ----------------------------------------------------------------------------- + +numbersArray = [0, 2, 3, 4, 7, 8]; +stringyNumbersArray = ['0', '2', '3', '4', '7', '8']; +dateArray = [new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)]; +typedArray = Uint8Array.from(numbersArray); + +// scan() ---------------------------------------------------------------------- + +numOrUndefined = d3Array.scan(numbersArray); +numOrUndefined = d3Array.scan(typedArray); +numOrUndefined = d3Array.scan(readonlyNumbersArray); + +numOrUndefined = d3Array.scan(mixedObjectArray, (a, b) => { + const aElem: MixedObject = a; + const bElem: MixedObject = b; + return a.num - b.num; +}); + +numOrUndefined = d3Array.scan(readonlyMixedObjectArray, (a, b) => { + const aElem: MixedObject = a; + const bElem: MixedObject = b; + return a.num - b.num; +}); + +numOrUndefined = d3Array.scan(mixedObjectOrUndefinedArray, (a, b) => { + const aElem: MixedObject | undefined = a; + const bElem: MixedObject | undefined = b; + return a && b ? a.num - b.num : NaN; +}); + +numOrUndefined = d3Array.scan(readonlyMixedObjectOrUndefinedArray, (a, b) => { + const aElem: MixedObject | undefined = a; + const bElem: MixedObject | undefined = b; + return a && b ? a.num - b.num : NaN; +}); + +// bisectLeft() ---------------------------------------------------------------- + +num = d3Array.bisectLeft(numbersArray, 4); +num = d3Array.bisectLeft(numbersArray, 4, 1); +num = d3Array.bisectLeft(numbersArray, 4, 1, 4); + +num = d3Array.bisectLeft(stringyNumbersArray, '21'); +num = d3Array.bisectLeft(stringyNumbersArray, '21', 1); +num = d3Array.bisectLeft(stringyNumbersArray, '21', 1, 4); + +num = d3Array.bisectLeft(dateArray, new Date(2011, 2, 1)); +num = d3Array.bisectLeft(dateArray, new Date(2011, 2, 1), 1); +num = d3Array.bisectLeft(dateArray, new Date(2011, 2, 1), 1, 2); + +num = d3Array.bisectLeft(typedArray, 4); +num = d3Array.bisectLeft(typedArray, 4, 1); +num = d3Array.bisectLeft(typedArray, 4, 1, 4); + +num = d3Array.bisectLeft(readonlyNumbersArray, 4); +num = d3Array.bisectLeft(readonlyNumbersArray, 4, 1); +num = d3Array.bisectLeft(readonlyNumbersArray, 4, 1, 4); + +num = d3Array.bisectLeft(readonlyStringyNumbersArray, '21'); +num = d3Array.bisectLeft(readonlyStringyNumbersArray, '21', 1); +num = d3Array.bisectLeft(readonlyStringyNumbersArray, '21', 1, 4); + +num = d3Array.bisectLeft(readonlyDateArray, new Date(2011, 2, 1)); +num = d3Array.bisectLeft(readonlyDateArray, new Date(2011, 2, 1), 1); +num = d3Array.bisectLeft(readonlyDateArray, new Date(2011, 2, 1), 1, 2); + +// bisectRight() --------------------------------------------------------------- + +num = d3Array.bisectRight(numbersArray, 4); +num = d3Array.bisectRight(numbersArray, 4, 1); +num = d3Array.bisectRight(numbersArray, 4, 1, 4); + +num = d3Array.bisectRight(stringyNumbersArray, '21'); +num = d3Array.bisectRight(stringyNumbersArray, '21', 1); +num = d3Array.bisectRight(stringyNumbersArray, '21', 1, 4); + +num = d3Array.bisectRight(dateArray, new Date(2011, 2, 1)); +num = d3Array.bisectRight(dateArray, new Date(2011, 2, 1), 1); +num = d3Array.bisectRight(dateArray, new Date(2011, 2, 1), 1, 2); + +num = d3Array.bisectRight(typedArray, 4); +num = d3Array.bisectRight(typedArray, 4, 1); +num = d3Array.bisectRight(typedArray, 4, 1, 4); + +num = d3Array.bisectRight(readonlyNumbersArray, 4); +num = d3Array.bisectRight(readonlyNumbersArray, 4, 1); +num = d3Array.bisectRight(readonlyNumbersArray, 4, 1, 4); + +num = d3Array.bisectRight(readonlyStringyNumbersArray, '21'); +num = d3Array.bisectRight(readonlyStringyNumbersArray, '21', 1); +num = d3Array.bisectRight(readonlyStringyNumbersArray, '21', 1, 4); + +num = d3Array.bisectRight(readonlyDateArray, new Date(2011, 2, 1)); +num = d3Array.bisectRight(readonlyDateArray, new Date(2011, 2, 1), 1); +num = d3Array.bisectRight(readonlyDateArray, new Date(2011, 2, 1), 1, 2); + +// bisect() -------------------------------------------------------------------- + +num = d3Array.bisect(numbersArray, 4); +num = d3Array.bisect(numbersArray, 4, 1); +num = d3Array.bisect(numbersArray, 4, 1, 4); + +num = d3Array.bisect(stringyNumbersArray, '21'); +num = d3Array.bisect(stringyNumbersArray, '21', 1); +num = d3Array.bisect(stringyNumbersArray, '21', 1, 4); + +num = d3Array.bisect(dateArray, new Date(2011, 2, 1)); +num = d3Array.bisect(dateArray, new Date(2011, 2, 1), 1); +num = d3Array.bisect(dateArray, new Date(2011, 2, 1), 1, 2); + +num = d3Array.bisect(typedArray, 4); +num = d3Array.bisect(typedArray, 4, 1); +num = d3Array.bisect(typedArray, 4, 1, 4); + +num = d3Array.bisect(readonlyNumbersArray, 4); +num = d3Array.bisect(readonlyNumbersArray, 4, 1); +num = d3Array.bisect(readonlyNumbersArray, 4, 1, 4); + +num = d3Array.bisect(readonlyStringyNumbersArray, '21'); +num = d3Array.bisect(readonlyStringyNumbersArray, '21', 1); +num = d3Array.bisect(readonlyStringyNumbersArray, '21', 1, 4); + +num = d3Array.bisect(readonlyDateArray, new Date(2011, 2, 1)); +num = d3Array.bisect(readonlyDateArray, new Date(2011, 2, 1), 1); +num = d3Array.bisect(readonlyDateArray, new Date(2011, 2, 1), 1, 2); + +// bisector() ------------------------------------------------------------------ + +mixedObjectArray.sort((a, b) => a.date.valueOf() - b.date.valueOf()); + +let mixedObjectDateBisectorObject: d3Array.Bisector; + +// define using accessor +mixedObjectDateBisectorObject = d3Array.bisector(el => el.date); + +// define using comparator +mixedObjectDateBisectorObject = d3Array.bisector((el, x) => + el.date.valueOf() - x.valueOf()); + +// bisect left +num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14)); +num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14), 1); +num = mixedObjectDateBisectorObject.left(mixedObjectArray, new Date(2015, 3, 14), 3, 4); + +num = mixedObjectDateBisectorObject.left(readonlyMixedObjectArray, new Date(2015, 3, 14)); +num = mixedObjectDateBisectorObject.left(readonlyMixedObjectArray, new Date(2015, 3, 14), 1); +num = mixedObjectDateBisectorObject.left(readonlyMixedObjectArray, new Date(2015, 3, 14), 3, 4); + +// bisect right +num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14)); +num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 1); +num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14), 3, 4); + +num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14)); +num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14), 1); +num = mixedObjectDateBisectorObject.right(readonlyMixedObjectArray, new Date(2015, 3, 14), 3, 4); + +// ascending() ----------------------------------------------------------------- + +num = d3Array.ascending(undefined, 20); +num = d3Array.ascending(10, 20); +num = d3Array.ascending('10', '20'); +num = d3Array.ascending(new Date(2016, 6, 13), new Date(2016, 6, 14)); + +// descending() ---------------------------------------------------------------- + +num = d3Array.descending(undefined, 20); +num = d3Array.descending(10, 20); +num = d3Array.descending('10', '20'); +num = d3Array.descending(new Date(2016, 6, 13), new Date(2016, 6, 14)); + +// ----------------------------------------------------------------------------- +// Test Transforming Arrays +// ----------------------------------------------------------------------------- + +// merge() --------------------------------------------------------------------- + +const testArray1 = [ + new MixedObject(10, new Date(2016, 6, 1)), + new MixedObject(20, new Date(2016, 7, 30)), + new MixedObject(30, new Date(2015, 3, 15)), + new MixedObject(40, new Date(2014, 3, 15)), + new MixedObject(50, new Date(2017, 4, 15)) +]; + +const testArray2 = [ + new MixedObject(40, new Date(2016, 3, 1)), + new MixedObject(50, new Date(2016, 9, 30)), +]; + +let testArrays: MixedObject[][] = [testArray1, testArray2]; + +const readonlyTestArray1 = testArray1 as ReadonlyArray; +const readonlyTestArray2 = testArray2 as ReadonlyArray; +const readonlyTestArrays = [testArray1, testArray2] as ReadonlyArray>; + +let mergedArray: MixedObject[]; + +mergedArray = d3Array.merge(testArrays); // inferred type +mergedArray = d3Array.merge(testArrays); // explicit type +// $ExpectError +mergedArray = d3Array.merge([[10, 40, 30], [15, 30]]); // fails, type mismatch +// $ExpectError +mergedArray = d3Array.merge([testArray1, [15, 30]]); // fails, type mismatch + +mergedArray = d3Array.merge(readonlyTestArrays); // inferred type +mergedArray = d3Array.merge(readonlyTestArrays); // explicit type + +// cross() --------------------------------------------------------------------- + +let crossed: Array<[string, number]>; + +const chars = ['x', 'y']; +const nums = [1, 2]; + +crossed = d3Array.cross(chars, nums); +crossed = d3Array.cross(chars, nums); + +let strArray: string[] = d3Array.cross([2, 3], [5, 6], (a, b) => (a + b) + 'px'); +strArray = d3Array.cross([2, 3], [5, 6], (a, b) => { + const aa: number = a; + const bb: number = b; + return (aa + bb) + 'px'; +}); + +const readonlyChars = chars as ReadonlyArray; +const readonlyNums = new Uint8Array(nums); + +crossed = d3Array.cross(readonlyChars, readonlyNums); +crossed = d3Array.cross(readonlyChars, readonlyNums); + +strArray = d3Array.cross([2, 3] as ReadonlyArray, new Uint8ClampedArray([5, 6]), (a, b) => (a + b) + 'px'); +strArray = d3Array.cross([2, 3] as ReadonlyArray, new Uint8ClampedArray([5, 6]), (a, b) => { + const aa: number = a; + const bb: number = b; + return (aa + bb) + 'px'; +}); + +d3Array.cross(new Uint8Array([1, 2, 3, 4, 5]), new Uint8Array([10, 20, 30, 40, 50])); + +// pairs() --------------------------------------------------------------------- + +let pairs: Array<[MixedObject, MixedObject]>; + +pairs = d3Array.pairs(mergedArray); + +numbersArray = d3Array.pairs(mergedArray, (a, b) => b.num - a.num); +numbersArray = d3Array.pairs(mergedArray, (a, b) => { + const aa: MixedObject = a; + const bb: MixedObject = b; + return bb.num - aa.num; +}); + +const readonlyMergedArray = mergedArray as ReadonlyArray; +pairs = d3Array.pairs(readonlyMergedArray); + +numbersArray = d3Array.pairs(readonlyMergedArray, (a, b) => b.num - a.num); +numbersArray = d3Array.pairs(readonlyMergedArray, (a, b) => { + const aa: MixedObject = a; + const bb: MixedObject = b; + return bb.num - aa.num; +}); + +// permute() ------------------------------------------------------------------- + +// getting a permutation of array elements +mergedArray = d3Array.permute(mergedArray, [1, 0, 2, 5, 3, 4, 6]); +mergedArray = d3Array.permute(readonlyMergedArray, [1, 0, 2, 5, 3, 4, 6]); +mergedArray = d3Array.permute(readonlyMergedArray, nums); + +// Getting an ordered array with object properties + +const testObject = { + val: 10, + name: 'Test', + when: new Date(), + more: [10, 30, 40] +}; + +const p1: Array = d3Array.permute(testObject, ['name', 'val', 'when', 'more']); +const p2: Array = d3Array.permute(testObject, ['when', 'more']); +// $ExpectError +const p3 = d3Array.permute(testObject, ['when', 'unknown']); + +// range() --------------------------------------------------------------------- + +numbersArray = d3Array.range(10); +numbersArray = d3Array.range(1, 10); +numbersArray = d3Array.range(1, 10, 0.5); + +// shuffle() ------------------------------------------------------------------- + +mergedArray = d3Array.shuffle(mergedArray); +mergedArray = d3Array.shuffle(mergedArray, 1); +mergedArray = d3Array.shuffle(mergedArray, 1, 3); +// $ExpectError +mergedArray = d3Array.shuffle(readonlyMergedArray); // fails, shuffle mutates input array in-place + +// Test each TypedArray explicitly. Can't use ArrayLike in this case because shuffle is mutable and ArrayLike would include ReadonlyArray +const resultInt8: Int8Array = d3Array.shuffle(new Int8Array(numbersArray)); +const resultUint8: Uint8Array = d3Array.shuffle(new Uint8Array(numbersArray)); +const resultUint8Clamped: Uint8ClampedArray = d3Array.shuffle(new Uint8ClampedArray(numbersArray)); +const resultInt16: Int16Array = d3Array.shuffle(new Int16Array(numbersArray)); +const resultUint6: Uint16Array = d3Array.shuffle(new Uint16Array(numbersArray)); +const resultInt32: Int32Array = d3Array.shuffle(new Int32Array(numbersArray)); +const resultUint32: Uint32Array = d3Array.shuffle(new Uint32Array(numbersArray)); +const resultFloat32: Float32Array = d3Array.shuffle(new Float32Array(numbersArray)); +const resultFloat64: Float64Array = d3Array.shuffle(new Float64Array(numbersArray)); + +// ticks() --------------------------------------------------------------------- + +numbersArray = d3Array.ticks(1, 10, 5); + +// tickIncrement() ------------------------------------------------------------------ + +let numDiff: number = d3Array.tickIncrement(1, 10, 5); + +// tickStep() ------------------------------------------------------------------ + +numDiff = d3Array.tickStep(1, 10, 5); + +// transpose() ----------------------------------------------------------------- + +testArrays = d3Array.transpose([testArray1, testArray2]); +testArrays = d3Array.transpose([readonlyTestArray1, readonlyTestArray2] as ReadonlyArray>); + +// zip() ----------------------------------------------------------------------- + +testArrays = d3Array.zip(testArray1, testArray2); +testArrays = d3Array.zip(readonlyTestArray1, readonlyTestArray2); + +// ----------------------------------------------------------------------------- +// Test Histogram +// ----------------------------------------------------------------------------- + +const timeScale = scaleTime(); + +// Create histogram generator ================================================== + +// number - number +let histoNumber_Number: d3Array.HistogramGeneratorNumber; +histoNumber_Number = d3Array.histogram(); +histoNumber_Number = d3Array.histogram(); + +// MixedObject - number | undefined +let histoMixed_NumberOrUndefined: d3Array.HistogramGeneratorNumber; +histoMixed_NumberOrUndefined = d3Array.histogram(); + +// MixedObject | undefined - number | undefined +let histoMixedOrUndefined_NumberOrUndefined: d3Array.HistogramGeneratorNumber; +histoMixedOrUndefined_NumberOrUndefined = d3Array.histogram(); + +// MixedObject | undefined - number +let histoMixedOrUndefined_Number: d3Array.HistogramGeneratorNumber; +histoMixedOrUndefined_Number = d3Array.histogram(); + +// MixedObject - Date +let histoMixedObject_Date: d3Array.HistogramGeneratorDate; +histoMixedObject_Date = d3Array.histogram(); + +// MixedObject - Date | undefined +let histoMixedObject_DateOrUndefined: d3Array.HistogramGeneratorDate; +histoMixedObject_DateOrUndefined = d3Array.histogram(); + +let defaultHistogram: d3Array.HistogramGeneratorNumber; +defaultHistogram = d3Array.histogram(); + +// Configure histogram generator =============================================== + +// value(...) ------------------------------------------------------------------ + +let valueAccessorFn: (d: MixedObject, i: number, data: MixedObject[]) => Date; +valueAccessorFn = histoMixedObject_Date.value(); + +type valueAccessor = (d: D, i: number, data: D[]) => V; + +// number - number +const valueFnNumber_Number: valueAccessor = histoNumber_Number.value(); +histoNumber_Number = histoNumber_Number.value((d: number, i: number, data: ArrayLike) => { + return d - num; +}); + +// MixedObject - number | undefined +const valueFnMixedObject_NumberOrUndefined: valueAccessor = histoMixed_NumberOrUndefined.value(); +histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.value((d: MixedObject, i: number, data: ArrayLike) => { + return d.str === "NA" ? undefined : d.num; +}); + +// MixedObject | undefined - number | undefined +const valueFnMixedOrUndefined_NumberOrUndefined: valueAccessor = histoMixedOrUndefined_NumberOrUndefined.value(); +histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.value((d: MixedObject | undefined, i: number, data: ArrayLike) => { + return d ? d.num : undefined; +}); + +// MixedObject | undefined - number +const valueFnMixedOrUndefined_Number: valueAccessor = histoMixedOrUndefined_Number.value(); +histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.value((d: MixedObject | undefined, i: number, data: ArrayLike) => { + return d ? d.num : 0; +}); + +// MixedObject - Date +const valueFnMixedObject_Date: valueAccessor = histoMixedObject_Date.value(); +histoMixedObject_Date = histoMixedObject_Date.value((d: MixedObject, i: number, data: ArrayLike) => { + return d.date; +}); + +// MixedObject - Date | undefined +const valueFnMixedObject_DateOrUndefined: valueAccessor = histoMixedObject_DateOrUndefined.value(); +histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.value((d: MixedObject, i: number, data: ArrayLike) => { + return d.date; +}); + +// domain(...) ----------------------------------------------------------------- + +const domain = timeScale.domain(); +let domainFnNumber: (array: number[]) => [number, number] | [undefined, undefined]; +let domainFnNumberOrUndef: (array: Array) => [number, number] | [undefined, undefined]; +let domainFnDate: (values: Date[]) => [Date, Date]; + +// number - number +domainFnNumber = histoNumber_Number.domain(); +histoNumber_Number = histoNumber_Number.domain([0, 100]); +histoNumber_Number = histoNumber_Number.domain(d3Array.extent); + +// MixedObject - number | undefined +domainFnNumber = histoNumber_Number.domain(); +histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.domain([0, 100]); +histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.domain(d3Array.extent); + +// MixedObject | undefined - number | undefined +domainFnNumberOrUndef = histoMixedOrUndefined_NumberOrUndefined.domain(); +histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.domain([0, 100]); +histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.domain(d3Array.extent); + +// MixedObject | undefined - number +domainFnNumber = histoMixedOrUndefined_Number.domain(); +histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.domain([0, 100]); +histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.domain(d3Array.extent); + +// MixedObject - Date +domainFnDate = histoMixedObject_Date.domain(); +histoMixedObject_Date = histoMixedObject_Date.domain([new Date(2014, 3, 15), new Date(2017, 4, 15)]); +histoMixedObject_Date = histoMixedObject_Date.domain([domain[0], domain[domain.length]]); +histoMixedObject_Date = histoMixedObject_Date.domain((values) => [values[0], values[values.length]]); +// $ExpectError +histoMixedObject_Date = histoMixedObject_Date.domain(timeScale.domain()); // fails, as scale domain is an array with possibly more than the two elements expected by histogram + +// MixedObject - Date | undefined +domainFnDate = histoMixedObject_Date.domain(); +histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain([new Date(2014, 3, 15), new Date(2017, 4, 15)]); +histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain([domain[0], domain[domain.length]]); +histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.domain((values) => [values[0]!, values[values.length]!]); + +// thresholds(...) ------------------------------------------------------------- + +type thresholdsWithUndefinedCont = d3Array.ThresholdCountGenerator; +type thresholdsWithUndefinedArray = d3Array.ThresholdNumberArrayGenerator; + +let thresholds: d3Array.ThresholdCountGenerator | d3Array.ThresholdNumberArrayGenerator; +let thresholdsWithUndefined: thresholdsWithUndefinedCont | thresholdsWithUndefinedArray; +const thresholdsArray: d3Array.ThresholdNumberArrayGenerator = (x: ArrayLike) => [5, 10, 20]; + +let thresholdsDate: d3Array.ThresholdDateArrayGenerator; +let thresholdsDateOrUndefined: d3Array.ThresholdDateArrayGenerator; + +// number - number +thresholds = histoNumber_Number.thresholds(); +histoNumber_Number = histoNumber_Number.thresholds(3); +histoNumber_Number = histoNumber_Number.thresholds([5, 10, 20]); +histoNumber_Number = histoNumber_Number.thresholds(d3Array.thresholdScott); +histoNumber_Number = histoNumber_Number.thresholds(thresholdsArray); + +// MixedObject - number | undefined +thresholdsWithUndefined = histoMixed_NumberOrUndefined.thresholds(); +histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.thresholds(3); +histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.thresholds([5, 10, 20]); +histoMixed_NumberOrUndefined = histoMixed_NumberOrUndefined.thresholds(d3Array.thresholdScott); + +// MixedObject | undefined - number | undefined +thresholdsWithUndefined = histoMixedOrUndefined_NumberOrUndefined.thresholds(); +histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.thresholds(3); +histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.thresholds([5, 10, 20]); +histoMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined.thresholds(d3Array.thresholdScott); + +// MixedObject | undefined - number +thresholds = histoMixedOrUndefined_Number.thresholds(); +histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.thresholds(5); +histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.thresholds([5, 10, 20]); +histoMixedOrUndefined_Number = histoMixedOrUndefined_Number.thresholds(d3Array.thresholdSturges); + +// MixedObject - Date +thresholdsDate = histoMixedObject_Date.thresholds(); +histoMixedObject_Date = histoMixedObject_Date.thresholds([new Date(2015, 11, 15), new Date(2016, 6, 1), new Date(2016, 8, 30)]); +histoMixedObject_Date = histoMixedObject_Date.thresholds(timeScale.ticks(timeYear)); +histoMixedObject_Date = histoMixedObject_Date.thresholds((values: ArrayLike) => [new Date(2015, 11, 15), new Date(2016, 6, 1), new Date(2016, 8, 30)]); +histoMixedObject_Date = histoMixedObject_Date.thresholds((values: ArrayLike, min: Date, max: Date) => { + const thresholds: Date[] = [values[0], values[2], values[4]]; + return thresholds; +}); +// $ExpectError +histoMixedObject_Date = histoMixedObject_Date.thresholds(d3Array.thresholdScott); + +// MixedObject - Date | undefined +thresholdsDateOrUndefined = histoMixedObject_DateOrUndefined.thresholds(); +histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.thresholds([new Date(2015, 11, 15), new Date(2016, 6, 1), new Date(2016, 8, 30)]); +histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.thresholds(timeScale.ticks(timeYear)); +histoMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined.thresholds((values: ArrayLike, min: Date, max: Date) => { + const thresholds: Date[] = [values[0]!, new Date(2015, 11, 15), values[values.length]!]; + return thresholds; +}); + +// Use histogram generator ===================================================== + +undef = d3Array.histogram()([])[0].x0 as undefined; +undef = d3Array.histogram()([undefined])[0].x0 as undefined; + +// number - number +let binsNumber_Number: Array>; +binsNumber_Number = histoNumber_Number([-1, 0, 1, 1, 3, 20, 234]); + +let binNumber_Number: d3Array.Bin; +binNumber_Number = binsNumber_Number[0]; + +num = binNumber_Number.length; +num = binNumber_Number[0]; +numOrUndefined = binNumber_Number.x0; +numOrUndefined = binNumber_Number.x1; + +// MixedObject - number | undefined +let binsNumberMixed_NumberOrUndefined: Array>; +binsNumberMixed_NumberOrUndefined = histoMixed_NumberOrUndefined(mixedObjectArray); + +let binNumberMixed_NumberOrUndefined: d3Array.Bin; +binNumberMixed_NumberOrUndefined = binsNumberMixed_NumberOrUndefined[0]; + +num = binNumberMixed_NumberOrUndefined.length; +mixedObject = binNumberMixed_NumberOrUndefined[0]; +numOrUndefined = binNumberMixed_NumberOrUndefined.x0; +numOrUndefined = binNumberMixed_NumberOrUndefined.x1; + +// MixedObject | undefined - number | undefined +let binsNumberMixedOrUndefined_NumberOrUndefined: Array>; +binsNumberMixedOrUndefined_NumberOrUndefined = histoMixedOrUndefined_NumberOrUndefined(mixedObjectArray); + +let binNumberMixedOrUndefined_NumberOrUndefined: d3Array.Bin; +binNumberMixedOrUndefined_NumberOrUndefined = binsNumberMixedOrUndefined_NumberOrUndefined[0]; + +num = binNumberMixedOrUndefined_NumberOrUndefined.length; +mixedObjectOrUndefined = binNumberMixedOrUndefined_NumberOrUndefined[0]; +numOrUndefined = binNumberMixedOrUndefined_NumberOrUndefined.x0; +numOrUndefined = binNumberMixedOrUndefined_NumberOrUndefined.x1; + +// MixedObject | undefined - number +let binsNumberMixedOrUndefined_Number: Array>; +binsNumberMixedOrUndefined_Number = histoMixedOrUndefined_Number(mixedObjectArray); + +let binNumberMixedOrUndefined_Number: d3Array.Bin; +binNumberMixedOrUndefined_Number = binsNumberMixedOrUndefined_Number[0]; + +num = binNumberMixedOrUndefined_Number.length; +mixedObjectOrUndefined = binNumberMixedOrUndefined_Number[0]; +numOrUndefined = binNumberMixedOrUndefined_Number.x0; +numOrUndefined = binNumberMixedOrUndefined_Number.x1; + +// MixedObject - Date +let binsMixedObject_Date: Array>; +binsMixedObject_Date = histoMixedObject_Date(mixedObjectArray); +binsMixedObject_Date = histoMixedObject_Date(readonlyMixedObjectArray); + +let binMixedObject_Date: d3Array.Bin; +binMixedObject_Date = binsMixedObject_Date[0]; + +num = binMixedObject_Date.length; +mixedObject = binMixedObject_Date[0]; +dateOrUndefined = binMixedObject_Date.x0; +dateOrUndefined = binMixedObject_Date.x1; + +// MixedObject - Date | undefined +let binsMixedObject_DateOrUndefined: Array>; +binsMixedObject_DateOrUndefined = histoMixedObject_DateOrUndefined(mixedObjectArray); + +let binMixedObject_DateOrUndefined: d3Array.Bin; +binMixedObject_DateOrUndefined = binsMixedObject_DateOrUndefined[0]; + +num = binMixedObject_DateOrUndefined.length; +mixedObject = binMixedObject_DateOrUndefined[0]; +dateOrUndefined = binMixedObject_DateOrUndefined.x0; +dateOrUndefined = binMixedObject_DateOrUndefined.x1; + +// Histogram Thresholds ======================================================== + +numbersArray = [-1, 0, 1, 1, 3, 20, 234]; +typedArray = new Uint8Array(numbersArray); +readonlyNumbersArray = numbersArray as ReadonlyArray; + +num = d3Array.thresholdFreedmanDiaconis(numbersArray, -1, 234); +num = d3Array.thresholdFreedmanDiaconis(typedArray, -1, 234); +num = d3Array.thresholdFreedmanDiaconis(readonlyNumbersArray, -1, 234); + +num = d3Array.thresholdScott(numbersArray, -1, 234); +num = d3Array.thresholdScott(typedArray, -1, 234); +num = d3Array.thresholdScott(readonlyNumbersArray, -1, 234); + +num = d3Array.thresholdSturges(numbersArray); +num = d3Array.thresholdSturges(typedArray); +num = d3Array.thresholdSturges(readonlyNumbersArray); + +// Deprecated ================================================================== + +const histDeprecatedNumber: d3Array.HistogramGenerator = d3Array.histogram(); +const histDeprecatedDate: d3Array.HistogramGenerator = d3Array.histogram(); diff --git a/types/d3-array/v1/index.d.ts b/types/d3-array/v1/index.d.ts new file mode 100644 index 0000000000..7320e1c223 --- /dev/null +++ b/types/d3-array/v1/index.d.ts @@ -0,0 +1,547 @@ +// Type definitions for D3JS d3-array module 1.2 +// Project: https://github.com/d3/d3-array +// Definitions by: Alex Ford +// Boris Yankov +// Tom Wanzek +// denisname , +// Hugues Stefanski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// Last module patch version validated against: 1.2.1 + +// -------------------------------------------------------------------------- +// Shared Types and Interfaces +// -------------------------------------------------------------------------- + +/** + * Administrivia: JavaScript primitive types and Date + */ +export type Primitive = number | string | boolean | Date; + +/** + * Administrivia: anything with a valueOf(): number method is comparable, so we allow it in numeric operations + */ +export interface Numeric { + valueOf(): number; +} + +// -------------------------------------------------------------------------------------- +// Descriptive Statistics +// -------------------------------------------------------------------------------------- + +/** + * Return the maximum value in the array of strings using natural order. + */ +export function max(array: ArrayLike): string | undefined; + +/** + * Return the maximum value in the array of numbers using natural order. + */ +export function max(array: ArrayLike): T | undefined; + +/** + * Return the maximum value in the array using natural order and a projection function to map values to strings. + */ +export function max(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => string | undefined | null): string | undefined; + +/** + * Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values. + */ +export function max(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => U | undefined | null): U | undefined; + +/** + * Return the minimum value in the array using natural order. + */ +export function min(array: ArrayLike): string | undefined; + +/** + * Return the minimum value in the array using natural order. + */ +export function min(array: ArrayLike): T | undefined; + +/** + * Return the minimum value in the array using natural order. + */ +export function min(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => string | undefined | null): string | undefined; + +/** + * Return the minimum value in the array using natural order. + */ +export function min(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => U | undefined | null): U | undefined; + +/** + * Return the min and max simultaneously. + */ +export function extent(array: ArrayLike): [string, string] | [undefined, undefined]; + +/** + * Return the min and max simultaneously. + */ +export function extent(array: ArrayLike): [T, T] | [undefined, undefined]; + +/** + * Return the min and max simultaneously. + */ +export function extent(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => string | undefined | null): [string, string] | [undefined, undefined]; + +/** + * Return the min and max simultaneously. + */ +export function extent(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => U | undefined | null): [U, U] | [undefined, undefined]; + +/** + * Return the mean of an array of numbers + */ +export function mean(array: ArrayLike): number | undefined; + +/** + * Return the mean of an array of numbers + */ +export function mean(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => number | undefined | null): number | undefined; + +/** + * Return the median of an array of numbers + */ +export function median(array: ArrayLike): number | undefined; + +/** + * Return the median of an array of numbers + */ +export function median(array: ArrayLike, accessor: (element: T, i: number, array: ArrayLike) => number | undefined | null): number | undefined; + +/** + * Returns the p-quantile of an array of numbers + */ +export function quantile(array: ArrayLike, p: number): number | undefined; + +export function quantile(array: ArrayLike, p: number, accessor: (element: T, i: number, array: ArrayLike) => number | undefined | null): number | undefined; + +/** + * Compute the sum of an array of numbers. + */ +export function sum(array: ArrayLike): number; + +/** + * Compute the sum of an array, using the given accessor to convert values to numbers. + */ +export function sum(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => number | undefined | null): number; + +/** + * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers. + */ +export function deviation(array: ArrayLike): number | undefined; + +/** + * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array, + * using the given accessor to convert values to numbers. + */ +export function deviation(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => number | undefined | null): number | undefined; + +/** + * Compute an unbiased estimator of the population variance of the given array of numbers. + */ +export function variance(array: ArrayLike): number | undefined; + +/** + * Compute an unbiased estimator of the population variance of the given array, + * using the given accessor to convert values to numbers. + */ +export function variance(array: ArrayLike, accessor: (datum: T, index: number, array: ArrayLike) => number | undefined | null): number | undefined; + +// -------------------------------------------------------------------------------------- +// Searching Arrays +// -------------------------------------------------------------------------------------- + +export function scan(array: ArrayLike, comparator?: (a: number, b: number) => number): number | undefined; +export function scan(array: ArrayLike, comparator: (a: T, b: T) => number): number | undefined; + +export function bisectLeft(array: ArrayLike, x: number, lo?: number, hi?: number): number; +export function bisectLeft(array: ArrayLike, x: string, lo?: number, hi?: number): number; +export function bisectLeft(array: ArrayLike, x: Date, lo?: number, hi?: number): number; + +export function bisectRight(array: ArrayLike, x: number, lo?: number, hi?: number): number; +export function bisectRight(array: ArrayLike, x: string, lo?: number, hi?: number): number; +export function bisectRight(array: ArrayLike, x: Date, lo?: number, hi?: number): number; + +export const bisect: typeof bisectRight; + +export interface Bisector { + left(array: ArrayLike, x: U, lo?: number, hi?: number): number; + right(array: ArrayLike, x: U, lo?: number, hi?: number): number; +} + +export function bisector(comparator: (a: T, b: U) => number): Bisector; +export function bisector(accessor: (x: T) => U): Bisector; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + */ +export function quickselect(array: ArrayLike, k: number): T[]; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + * @param left The left index of the range to sort. + */ +export function quickselect(array: ArrayLike, k: number, left: number): T[]; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + * @param left The left index of the range to sort. + * @param right The right index. + */ +export function quickselect(array: ArrayLike, k: number, left: number, right: number): T[]; + +/** + * Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right]. + * + * @param array The array to partially sort (in place). + * @param k The middle index for partial sorting. + * @param left The left index of the range to sort. + * @param right The right index. + * @param compare The compare function. + */ +export function quickselect(array: ArrayLike, k: number, left: number, right: number, compare: (a: Primitive | undefined, b: Primitive | undefined) => number): T[]; + +// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. +/** + * Compares two primitive values for sorting (in ascending order). + */ +export function ascending(a: Primitive | undefined, b: Primitive | undefined): number; + +// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. +/** + * Compares two primitive values for sorting (in ascending order). + */ +export function descending(a: Primitive | undefined, b: Primitive | undefined): number; + +// -------------------------------------------------------------------------------------- +// Transforming Arrays +// -------------------------------------------------------------------------------------- + +/** + * Groups the specified array of values into a Map from key to array of value. + * @param a The array to group. + * @param key The key function. + */ +export function group(a: ArrayLike, key: (value: TObject) => TKey): Map; + +/** + * Groups and reduces the specified array of values into a Map from key to value. + * + * @param a The array to group. + * @param reduce The reduce function. + * @param key The key function. + */ +export function rollup(a: ArrayLike, reduce: (value: TObject[]) => TReduce, key: (value: TObject) => TKey): Map; + +/** + * Returns the Cartesian product of the two arrays a and b. + * For each element i in the specified array a and each element j in the specified array b, in order, + * it creates a two-element array for each pair. + * + * @param a First input array. + * @param b Second input array. + */ +export function cross(a: ArrayLike, b: ArrayLike): Array<[S, T]>; + +/** + * Returns the Cartesian product of the two arrays a and b. + * For each element i in the specified array a and each element j in the specified array b, in order, + * invokes the specified reducer function passing the element i and element j. + * + * @param a First input array. + * @param b Second input array. + * @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value. + */ +export function cross(a: ArrayLike, b: ArrayLike, reducer: (a: S, b: T) => U): U[]; + +/** + * Merges the specified arrays into a single array. + */ +export function merge(arrays: ArrayLike>): T[]; + +/** + * For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. + * Returns the empty array if the input array has fewer than two elements. + * + * @param array Array of input elements + */ +export function pairs(array: ArrayLike): Array<[T, T]>; +/** + * For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1. + * Returns the resulting array of pair-wise reduced elements. + * Returns the empty array if the input array has fewer than two elements. + * + * @param array Array of input elements + * @param reducer A reducer function taking as input to adjacent elements of the input array and returning a reduced value. + */ +export function pairs(array: ArrayLike, reducer: (a: T, b: T) => U): U[]; + +/** + * Returns a permutation of the specified array using the specified array of indexes. + * The returned array contains the corresponding element in array for each index in indexes, in order. + * For example, `permute(["a", "b", "c"], [1, 2, 0]) // ["b", "c", "a"]` + */ +export function permute(array: { [key: number]: T }, keys: ArrayLike): T[]; + +/** + * Extract the values from an object into an array with a stable order. For example: + * `var object = {yield: 27, year: 1931, site: "University Farm"};` + * `d3.permute(object, ["site", "yield"]); // ["University Farm", 27]` + */ +export function permute(object: T, keys: ArrayLike): Array; + +/** + * Generates a 0-based numeric sequence. The output range does not include 'stop'. + */ +export function range(stop: number): number[]; + +/** + * Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'. + */ +export function range(start: number, stop: number, step?: number): number[]; + +/** + * Randomizes the order of the specified array using the Fisher–Yates shuffle. + */ +export function shuffle(array: T[], lo?: number, hi?: number): T[]; +export function shuffle(array: Int8Array, lo?: number, hi?: number): Int8Array; +export function shuffle(array: Uint8Array, lo?: number, hi?: number): Uint8Array; +export function shuffle(array: Uint8ClampedArray, lo?: number, hi?: number): Uint8ClampedArray; +export function shuffle(array: Int16Array, lo?: number, hi?: number): Int16Array; +export function shuffle(array: Uint16Array, lo?: number, hi?: number): Uint16Array; +export function shuffle(array: Int32Array, lo?: number, hi?: number): Int32Array; +export function shuffle(array: Uint32Array, lo?: number, hi?: number): Uint32Array; +export function shuffle(array: Float32Array, lo?: number, hi?: number): Float32Array; +export function shuffle(array: Float64Array, lo?: number, hi?: number): Float64Array; + +/** + * Generate an array of approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive). + * Each value is a power of ten multiplied by 1, 2 or 5. See also d3.tickIncrement, d3.tickStep and linear.ticks. + * + * Ticks are inclusive in the sense that they may include the specified start and stop values if (and only if) they are exact, + * nicely-rounded values consistent with the inferred step. More formally, each returned tick t satisfies start ≤ t and t ≤ stop. + * + * @param start Start value for ticks + * @param stop Stop value for ticks + * @param count count + 1 is the approximate number of ticks to be returned by d3.ticks. + */ +export function ticks(start: number, stop: number, count: number): number[]; + +/** + * Returns the difference between adjacent tick values if the same arguments were passed to d3.ticks: + * a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5. + * + * Like d3.tickStep, except requires that start is always less than or equal to step, and if the tick step for the given start, + * stop and count would be less than one, returns the negative inverse tick step instead. + * + * This method is always guaranteed to return an integer, and is used by d3.ticks to avoid guarantee that the returned tick values + * are represented as precisely as possible in IEEE 754 floating point. + * + * @param start Start value for ticks + * @param stop Stop value for ticks + * @param count count + 1 is the approximate number of ticks to be returned by d3.ticks. + */ +export function tickIncrement(start: number, stop: number, count: number): number; + +/** + * Returns the difference between adjacent tick values if the same arguments were passed to d3.ticks: + * a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5. + * + * Note that due to the limited precision of IEEE 754 floating point, the returned value may not be exact decimals; + * use d3-format to format numbers for human consumption. + * + * @param start Start value for ticks + * @param stop Stop value for ticks + * @param count count + 1 is the approximate number of ticks to be returned by d3.ticks. + */ +export function tickStep(start: number, stop: number, count: number): number; + +/** + * Transpose a matrix provided in Array of Arrays format. + */ +export function transpose(matrix: ArrayLike>): T[][]; + +/** + * Returns an array of arrays, where the ith array contains the ith element from each of the argument arrays. + * The returned array is truncated in length to the shortest array in arrays. If arrays contains only a single array, the returned array + * contains one-element arrays. With no arguments, the returned array is empty. + */ +export function zip(...arrays: Array>): T[][]; + +// -------------------------------------------------------------------------------------- +// Histogram +// -------------------------------------------------------------------------------------- + +export interface Bin extends Array { + x0: Value | undefined; + x1: Value | undefined; +} + +/** + * Type definition for threshold generator which returns the count of recommended thresholds + */ +export type ThresholdCountGenerator = + (values: ArrayLike, min: number, max: number) => number; + +/** + * Type definition for threshold generator which returns an array of recommended numbers thresholds + */ +export type ThresholdNumberArrayGenerator = + (values: ArrayLike, min: number, max: number) => Value[]; + +/** + * Type definition for threshold generator which returns an array of recommended dates thresholds + */ +export type ThresholdDateArrayGenerator = + (values: ArrayLike, min: Date, max: Date) => Value[]; + +/** + * @deprecated Use ThresholdNumberArrayGenerator or ThresholdDateArrayGenerator. + */ +export type ThresholdArrayGenerator = ThresholdNumberArrayGenerator; + +/** + * @deprecated Use `HistogramGeneratorNumber` for `number` values and `HistogramGeneratorDate for `Date` values. + */ +export interface HistogramGenerator { + (data: ArrayLike): Array>; + + value(): (d: Datum, i: number, data: ArrayLike) => Value; + value(valueAccessor: (d: Datum, i: number, data: ArrayLike) => Value): this; + + domain(): (values: ArrayLike) => [Value, Value] | [undefined, undefined]; + domain(domain: [Value, Value]): this; + domain(domainAccessor: (values: ArrayLike) => [Value, Value] | [undefined, undefined]): this; + + /** + * Set the array of values to be used as thresholds in determining the bins. + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param thresholds Array of threshold values used for binning. The elements must + * be of the same type as the materialized values of the histogram. + */ + thresholds(thresholds: ArrayLike): this; +} + +export interface HistogramCommon { + (data: ArrayLike): Array>; + + value(): (d: Datum, i: number, data: ArrayLike) => Value; + value(valueAccessor: (d: Datum, i: number, data: ArrayLike) => Value): this; +} + +export interface HistogramGeneratorDate extends HistogramCommon { + domain(): (values: ArrayLike) => [Date, Date]; + domain(domain: [Date, Date]): this; + domain(domainAccessor: (values: ArrayLike) => [Date, Date]): this; + + thresholds(): ThresholdDateArrayGenerator; + /** + * Set the array of values to be used as thresholds in determining the bins. + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param thresholds Array of threshold values used for binning. The elements must + * be of the same type as the materialized values of the histogram. + */ + thresholds(thresholds: ArrayLike): this; + /** + * Set a threshold accessor function, which returns the array of values to be used as + * thresholds in determining the bins. + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param thresholds A function which accepts as arguments the array of materialized values, and + * optionally the domain minimum and maximum. The function calculates and returns the array of values to be used as + * thresholds in determining the bins. + */ + thresholds(thresholds: ThresholdDateArrayGenerator): this; +} + +export interface HistogramGeneratorNumber extends HistogramCommon { + domain(): (values: ArrayLike) => [number, number] | [undefined, undefined]; + domain(domain: [number, number]): this; + domain(domainAccessor: (values: ArrayLike) => [number, number] | [undefined, undefined]): this; + + thresholds(): ThresholdCountGenerator | ThresholdNumberArrayGenerator; + /** + * Divide the domain uniformly into approximately count bins. IMPORTANT: This threshold + * setting approach only works, when the materialized values are numbers! + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param count The desired number of uniform bins. + */ + thresholds(count: number): this; + /** + * Set a threshold accessor function, which returns the desired number of bins. + * Divides the domain uniformly into approximately count bins. IMPORTANT: This threshold + * setting approach only works, when the materialized values are numbers! + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param count A function which accepts as arguments the array of materialized values, and + * optionally the domain minimum and maximum. The function calculates and returns the suggested + * number of bins. + */ + thresholds(count: ThresholdCountGenerator): this; + /** + * Set the array of values to be used as thresholds in determining the bins. + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param thresholds Array of threshold values used for binning. The elements must + * be of the same type as the materialized values of the histogram. + */ + thresholds(thresholds: ArrayLike): this; + /** + * Set a threshold accessor function, which returns the array of values to be used as + * thresholds in determining the bins. + * + * Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value, + * and the last bin.x1 is always equal to the maximum domain value. + * + * @param thresholds A function which accepts as arguments the array of materialized values, and + * optionally the domain minimum and maximum. The function calculates and returns the array of values to be used as + * thresholds in determining the bins. + */ + thresholds(thresholds: ThresholdNumberArrayGenerator): this; +} + +export function histogram(): HistogramGeneratorNumber; +export function histogram(): HistogramGeneratorNumber; +export function histogram(): HistogramGeneratorDate; + +/** + * @deprecated Do not use Value generic which mixes number and Date types. Use either number or Date + * (in combination with undefined, as applicable) to obtain a type-specific histogram generator. + */ +export function histogram(): HistogramGenerator; + +// -------------------------------------------------------------------------------------- +// Histogram Thresholds +// -------------------------------------------------------------------------------------- + +export function thresholdFreedmanDiaconis(values: ArrayLike, min: number, max: number): number; // of type ThresholdCountGenerator + +export function thresholdScott(values: ArrayLike, min: number, max: number): number; // of type ThresholdCountGenerator + +export function thresholdSturges(values: ArrayLike): number; // of type ThresholdCountGenerator diff --git a/types/conf/v0/tsconfig.json b/types/d3-array/v1/tsconfig.json similarity index 80% rename from types/conf/v0/tsconfig.json rename to types/d3-array/v1/tsconfig.json index 004bd4a1b5..3edd84862c 100644 --- a/types/conf/v0/tsconfig.json +++ b/types/d3-array/v1/tsconfig.json @@ -2,9 +2,9 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], - "target": "es6", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -13,17 +13,17 @@ "typeRoots": [ "../../" ], + "types": [], "paths": { - "conf": [ - "conf/v0" + "d3-array": [ + "d3-array/v1" ] }, - "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "conf-tests.ts" + "d3-array-tests.ts" ] } \ No newline at end of file diff --git a/types/mem/tslint.json b/types/d3-array/v1/tslint.json similarity index 72% rename from types/mem/tslint.json rename to types/d3-array/v1/tslint.json index 71ee04c4e1..54efb0b84e 100644 --- a/types/mem/tslint.json +++ b/types/d3-array/v1/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { + "unified-signatures": false, "no-unnecessary-generics": false } } diff --git a/types/d3-box/tslint.json b/types/d3-box/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-box/tslint.json +++ b/types/d3-box/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3-cloud/d3-cloud-tests.ts b/types/d3-cloud/d3-cloud-tests.ts index e3bffed4cb..19a140959f 100644 --- a/types/d3-cloud/d3-cloud-tests.ts +++ b/types/d3-cloud/d3-cloud-tests.ts @@ -27,8 +27,11 @@ d3.layout.cloud().size([300, 300]) .font("Impact") .fontSize(function(d:ICompTextSize) { return d.size; }) .on("end", draw) + .random() + .canvas() .start(); + function draw(words:ICompTextSize[]) { d3.select("body").append("svg") .attr("width", 300) diff --git a/types/d3-cloud/index.d.ts b/types/d3-cloud/index.d.ts index fdf2dbc719..b0a3b8a78c 100644 --- a/types/d3-cloud/index.d.ts +++ b/types/d3-cloud/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for d3JS cloud layout plugin by Jason Davies v1.2.2 +// Type definitions for d3JS cloud layout plugin by Jason Davies v1.2.5 // Project: https://github.com/jasondavies/d3-cloud -// Definitions by: hans windhoff +// Definitions by: hans windhoff , locknono // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as d3 from 'd3'; @@ -71,6 +71,24 @@ declare module 'd3' { padding(padding: number): Cloud; padding(padding: (datum: T, index: number) => number): Cloud; + /** + * If specified, sets the internal random number generator,used for selecting the initial position of each word, + * and the clockwise/counterclockwise direction of the spiral for each word. + * + * @param randomFunction should return a number in the range [0, 1).The default is Math.random. + */ + random(): Cloud; + random(randomFunction: () => number): Cloud; + + /** + * If specified, sets the canvas generator function, which is used internally to draw text. + * When using Node.js, you will almost definitely override the default, e.g. using the canvas module. + * @param canvasGenerator should return a HTMLCanvasElement.The default is: ()=>{document.createElement("canvas");} + * + */ + canvas():Cloud; + canvas(canvasGenerator: () => HTMLCanvasElement): Cloud; + on(type: "word", listener: (word: T) => void): Cloud; on(type: "end", listener: (tags: T[], bounds: { x: number; y: number }[]) => void): Cloud; on(type: string, listener: (...args: any[]) => void): Cloud; diff --git a/types/d3-cloud/tslint.json b/types/d3-cloud/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-cloud/tslint.json +++ b/types/d3-cloud/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3-dsv/v0/tslint.json b/types/d3-dsv/v0/tslint.json index bafaae7817..f6fabe4180 100644 --- a/types/d3-dsv/v0/tslint.json +++ b/types/d3-dsv/v0/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // TODO + "npm-naming": false, "dt-header": false } } diff --git a/types/d3-sankey/index.d.ts b/types/d3-sankey/index.d.ts index 4f70bbbe61..3f10e2d1ae 100644 --- a/types/d3-sankey/index.d.ts +++ b/types/d3-sankey/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-sankey module 0.7 +// Type definitions for D3JS d3-sankey module 0.11 // Project: https://github.com/d3/d3-sankey/ // Definitions by: Tom Wanzek , Alex Ford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 0.7.1 +// Last module patch version validated against: 0.11 import { Link } from 'd3-shape'; @@ -337,6 +337,18 @@ export interface SankeyLayout, b: SankeyNode) => number) | undefined; + + /** + * Set the node comparison function and return this Sankey layout generator. + * + * @param compare Node comparison function. + */ + nodeSort(compare: (a: SankeyNode, b: SankeyNode) => number): this; } /** diff --git a/types/d3-tip/tslint.json b/types/d3-tip/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3-tip/tslint.json +++ b/types/d3-tip/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3.slider/tslint.json b/types/d3.slider/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3.slider/tslint.json +++ b/types/d3.slider/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/d3/tsconfig.json b/types/d3/tsconfig.json index bc3e8cf886..9a4848b338 100644 --- a/types/d3/tsconfig.json +++ b/types/d3/tsconfig.json @@ -13,6 +13,11 @@ "typeRoots": [ "../" ], + "paths": { + "d3-array": [ + "d3-array/v1" + ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/d3/v4/tsconfig.json b/types/d3/v4/tsconfig.json index bf267af99d..6b2cee09dd 100644 --- a/types/d3/v4/tsconfig.json +++ b/types/d3/v4/tsconfig.json @@ -19,6 +19,9 @@ ], "d3": [ "d3/v4" + ], + "d3-array": [ + "d3-array/v1" ] }, "types": [], diff --git a/types/d3kit/tsconfig.json b/types/d3kit/tsconfig.json index 40e266f6f9..79051ab233 100644 --- a/types/d3kit/tsconfig.json +++ b/types/d3kit/tsconfig.json @@ -13,6 +13,11 @@ "typeRoots": [ "../" ], + "paths": { + "d3-array": [ + "d3-array/v1" + ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/d3pie/tslint.json b/types/d3pie/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/d3pie/tslint.json +++ b/types/d3pie/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dat.gui/tslint.json b/types/dat.gui/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/dat.gui/tslint.json +++ b/types/dat.gui/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/data-driven/tslint.json b/types/data-driven/tslint.json index a41bf5d19a..3d59f55fda 100644 --- a/types/data-driven/tslint.json +++ b/types/data-driven/tslint.json @@ -8,6 +8,7 @@ "callable-types": false, "comment-format": false, "dt-header": false, + "npm-naming": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/datadog-statsd-metrics-collector/datadog-statsd-metrics-collector-tests.ts b/types/datadog-statsd-metrics-collector/datadog-statsd-metrics-collector-tests.ts new file mode 100644 index 0000000000..ef5691a57d --- /dev/null +++ b/types/datadog-statsd-metrics-collector/datadog-statsd-metrics-collector-tests.ts @@ -0,0 +1,43 @@ +import datadog = require('node-dogstatsd'); +import Collector = require('datadog-statsd-metrics-collector'); + +const client = new datadog.StatsD('localhost'); + +// constructors +let collector = new Collector(client); +collector = new Collector(client, 1000); + +// interface +const key = 'key'; +const timeValue = 99; +const sampleRate = 0.85; +const incrementBy = 7; +const decrementBy = 5; +const gaugeValue = 199; +const tags: string[] = ['tag1', 'tag2']; + +collector.timing(key, timeValue); +collector.timing(key, timeValue, sampleRate); +collector.timing(key, timeValue, sampleRate, tags); + +collector.increment(key); +collector.increment(key, sampleRate); +collector.increment(key, sampleRate, tags); + +collector.incrementBy(key, incrementBy); +collector.incrementBy(key, incrementBy, tags); + +collector.decrement(key); +collector.decrement(key, sampleRate); +collector.decrement(key, sampleRate, tags); + +collector.decrementBy(key, decrementBy); +collector.decrementBy(key, decrementBy, tags); + +collector.gauge(key, gaugeValue); +collector.gauge(key, gaugeValue, sampleRate); +collector.gauge(key, gaugeValue, sampleRate, tags); + +collector.histogram(key, timeValue); +collector.histogram(key, timeValue, sampleRate); +collector.histogram(key, timeValue, sampleRate, tags); diff --git a/types/datadog-statsd-metrics-collector/index.d.ts b/types/datadog-statsd-metrics-collector/index.d.ts new file mode 100644 index 0000000000..741c5a9f43 --- /dev/null +++ b/types/datadog-statsd-metrics-collector/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for datadog-statsd-metrics-collector 1.1 +// Project: https://github.com/xzyfer/datadog-statsd-metrics-collector#readme +// Definitions by: Michael Mifsud +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import dogstatsd = require('node-dogstatsd'); + +declare class Collector implements dogstatsd.StatsDClient { + constructor(client: dogstatsd.StatsDClient, delayMilliseconds?: number); + + timing(stat: string, time: number, sample_rate?: number, tags?: string[]): void; + + increment(stat: string, sample_rate?: number, tags?: string[]): void; + incrementBy(stat: string, value: number, tags?: string[]): void; + + decrement(stat: string, sample_rate?: number, tags?: string[]): void; + decrementBy(stat: string, value: number, tags?: string[]): void; + + gauge(stat: string, value: number, sample_rate?: number, tags?: string[]): void; + + histogram(stat: string, time: number, sample_rate?: number, tags?: string[]): void; +} + +export = Collector; diff --git a/types/datadog-statsd-metrics-collector/tsconfig.json b/types/datadog-statsd-metrics-collector/tsconfig.json new file mode 100644 index 0000000000..d136060376 --- /dev/null +++ b/types/datadog-statsd-metrics-collector/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", + "datadog-statsd-metrics-collector-tests.ts" + ] +} diff --git a/types/fkill/tslint.json b/types/datadog-statsd-metrics-collector/tslint.json similarity index 100% rename from types/fkill/tslint.json rename to types/datadog-statsd-metrics-collector/tslint.json diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts index de739a673a..bdb10aa671 100644 --- a/types/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -578,7 +578,7 @@ $('#example tbody').on('click', 'td', () => { const cell_invalidate_1 = cell.invalidate(); const cell_invalidate_2 = cell.invalidate("data"); -$('#example tbody').on('click', 'td', () => { +$('#example tbody').on('click', 'td', function() { this.innerHTML = (parseInt(this.innerHTML, 10) + 1).toString(); dt.cell(this).invalidate().draw(); }); @@ -615,7 +615,7 @@ dt.columns('.select-filter').eq(0).each((colIdx: any) => { // Create the select list and search operation const select = $('') .appendTo( - dt.column(0).footer() + dt.column(0).footer() ) .on('change', () => { dt @@ -735,7 +735,7 @@ $('#example').on('click', 'tbody td', () => { alert('Data source: ' + dt.column(idx).dataSrc()); }); -const column_footer = column.footer(); +const column_footer: HTMLElement = column.footer(); const column_p = dt.column(0); // $(column.footer()).html( // column_p @@ -745,15 +745,15 @@ const column_p = dt.column(0); // }) // ); -const column_header = column.header(); +const column_header: HTMLElement = column.header(); $('#example tbody').on('click', 'td', function() { const idx = dt.cell(this).index().column; - const title = dt.column(idx).header(); + const title: HTMLElement = dt.column(idx).header(); alert('Column title clicked on: ' + $(title).html()); }); -let column_index = column.index(); +let column_index: number = column.index(); column_index = column.index("visibile"); dt.column(0).visible(false); @@ -762,18 +762,16 @@ alert(idx); // will show 0 dt.column('0:visible').order('asc'); -const column_nodes = column.nodes(); -dt.column(-1) - .nodes(); -// .to$() // Convert to a jQuery object -// .addClass('ready'); +const column_nodes: DataTables.Api = column.nodes(); +column_nodes.to$() // Convert to a jQuery object + .addClass('ready'); const column_search_get = column.search(); let column_search_set = column.search("string"); column_search_set = column.search("string", true); column_search_set = column.search("string", true, false); column_search_set = column.search("string", true, false, true); -$('#column3_search').on('keyup', () => { +$('#column3_search').on('keyup', function() { dt .columns(3) .search((this as HTMLInputElement).value) @@ -784,7 +782,7 @@ dt.columns('.select-filter').eq(0).each((colIdx: any) => { // Create the select list and search operation const select = $('